Hey there
After solving some problems i had with my bootloader (yes i decided to write my own :S) I came across AMD's manuals that say:
To jump into long mode you have to setup 32bit pmode first then reinitialise it for long mode.
a) is it possible to jump directly to long mode from real mode? (without the whole initialization stuff)
b) is it possible to go back to real mode without having problems (since no 32bit enviroment is initialized )
c) out of personal experience i have noticed that i can use 32bit gpr's even when im working on 16bits (e.g. EAX without having initialized 32bit mode) is it possible to use 64bit gprs too??
Thanks in advance
64bit long mode questions...
Re: 64bit long mode questions...
i thing not, you must in PM first then activate PAE, setting up paging, enable LME, enable paging and jump to long modeIcydemon wrote: a) is it possible to jump directly to long mode from real mode? (without the whole initialization stuff)
Re: 64bit long mode questions...
Hi,
Cheers,
Brendan
Yes, I've done it before. You need to enable long mode in the MSR, then set the PG and PE flags in CR0 at the same time.Icydemon wrote:a) is it possible to jump directly to long mode from real mode? (without the whole initialization stuff)
I haven't tried this, but AFAIK it would be possible. You'd need to make sure your code is identity mapped below 1 MB, switch to a 16-bit segments in long mode, then clear the PE bit in CR0, then reload segment registers.Icydemon wrote:b) is it possible to go back to real mode without having problems (since no 32bit enviroment is initialized )
No. Unless your code is 64-bit code the instruction prefixes that allow access to 64-bit GPRs behave differently (the CPU decodes them as other instructions, etc instead of as instruction prefixes).Icydemon wrote:c) out of personal experience i have noticed that i can use 32bit gpr's even when im working on 16bits (e.g. EAX without having initialized 32bit mode) is it possible to use 64bit gprs too??
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
