3 ms·
> You just can't jump into real mode from x64 mode, you need a virtualized environment in 32 bit mode to do that. I think what you mean is the vm86 mode is not
by bonzini 10y ago
> You just can't jump into real mode from x64 mode, you need a virtualized environment in 32 bit mode to do that.
I think what you mean is the vm86 mode is not available in 64-bit protected mode (no hardware task switching and 64-bit IRET ignores EFLAGS.VM).
But you can jump into real mode from 64-bit protected mode by clearing PE and PG at the same time. There are a couple more chores to do (clear EFER.LME and CR4.PAE) if you want the real mode code to be able to enter 16- or 32-bit protected mode. This[1] is an example.
[1] https://github.com/tianocore/edk2/blob/master/MdePkg/Library/BaseLib/X64/Thunk16.nasm https://github.com/tianocore/edk2/blob/master/MdePkg/Library...