When the boot loader invokes the 32-bit operating system, the machine must have the following state:
EAX
0x2BADB002
; the presence of this
value indicates to the operating system that it was loaded by a
Multiboot-compliant boot loader (e.g. as opposed to another type of
boot loader that the operating system can also be loaded from).
EBX
CS
0
and a limit of 0xFFFFFFFF
. The exact value is undefined.
DS
ES
FS
GS
SS
0
and a limit of 0xFFFFFFFF
. The exact values are all undefined.
A20 gate
CR0
EFLAGS
All other processor registers and flag bits are undefined. This includes, in particular:
ESP
GDTR
GDTR
may be invalid, so the OS image must not load any segment
registers (even just reloading the same values!) until it sets up its
own GDT
.
IDTR
IDT
.
However, other machine state should be left by the boot loader in normal working order, i.e. as initialized by the BIOS (or DOS, if that's what the boot loader runs from). In other words, the operating system should be able to make BIOS calls and such after being loaded, as long as it does not overwrite the BIOS data structures before doing so. Also, the boot loader must leave the PIC programmed with the normal BIOS/DOS values, even if it changed them during the switch to 32-bit mode.