GNU Info

Info Node: (multiboot.info)Machine state

(multiboot.info)Machine state


Next: Boot information format Prev: OS image format Up: Specification
Enter node , (file) or (file)node

Machine state
=============

   FIXME: Use a table like the chapter "Header layout".

   When the boot loader invokes the 32-bit operating system, the machine
must have the following state:

   * `CS' must be a 32-bit read/execute code segment with an offset of 0
     and a limit of 0xFFFFFFFF.

   * `DS', `ES', `FS', `GS', and `SS' must be a 32-bit read/write data
     segment with an offset of 0 and a limit of 0xFFFFFFFF.

   * The address 20 line must be usable for standard linear 32-bit
     addressing of memory (in standard PC hardware, it is wired to 0 at
     bootup, forcing addresses in the 1-2 MB range to be mapped to the
     0-1 MB range, 3-4 is mapped to 2-3, etc.).

   * Paging must be turned off.

   * The processor interrupt flag must be turned off.

   * `EAX' must contain the magic value 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' must contain the 32-bit physical address of the Multiboot
     information structure provided by the boot loader (Note: Boot
     information format).

   All other processor registers and flag bits are undefined. This
includes, in particular:

   * `ESP': the 32-bit operating system must create its own stack as
     soon as it needs one.

   * `GDTR': Even though the segment registers are set up as described
     above, the `GDTR' may be invalid, so the operating system must not
     load any segment registers (even just reloading the same values!)
     until it sets up its own `GDT'.

   * `IDTR': The operating system must leave interrupts disabled until
     it sets up its own `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.


automatically generated by info2www version 1.2.2.9