diff options
author | Huang, Ying <ying.huang@intel.com> | 2007-10-23 22:18:49 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2007-10-29 19:22:22 -0400 |
commit | aa69432a68fb0aec49551fd69fe920a6df572573 (patch) | |
tree | 65e354e8025a594bd8197885cbc9c9f557c730d6 /Documentation/i386/boot.txt | |
parent | 076e21a0142ac33d53bc0cca58c6170d4ad14f5d (diff) |
x86 boot: document for 32 bit boot protocol
This patch documents the 32-bit boot protocol of x86. It has been used
by Kexec and LinuxBIOS. This patch is based on the proposal of Peter
Anvin.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation/i386/boot.txt')
-rw-r--r-- | Documentation/i386/boot.txt | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 2f75e750e4f5..fc49b79bc1ab 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt | |||
@@ -785,3 +785,41 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and | |||
785 | After completing your hook, you should jump to the address | 785 | After completing your hook, you should jump to the address |
786 | that was in this field before your boot loader overwrote it | 786 | that was in this field before your boot loader overwrote it |
787 | (relocated, if appropriate.) | 787 | (relocated, if appropriate.) |
788 | |||
789 | |||
790 | **** 32-bit BOOT PROTOCOL | ||
791 | |||
792 | For machine with some new BIOS other than legacy BIOS, such as EFI, | ||
793 | LinuxBIOS, etc, and kexec, the 16-bit real mode setup code in kernel | ||
794 | based on legacy BIOS can not be used, so a 32-bit boot protocol needs | ||
795 | to be defined. | ||
796 | |||
797 | In 32-bit boot protocol, the first step in loading a Linux kernel | ||
798 | should be to setup the boot parameters (struct boot_params, | ||
799 | traditionally known as "zero page"). The memory for struct boot_params | ||
800 | should be allocated and initialized to all zero. Then the setup header | ||
801 | from offset 0x01f1 of kernel image on should be loaded into struct | ||
802 | boot_params and examined. The end of setup header can be calculated as | ||
803 | follow: | ||
804 | |||
805 | 0x0202 + byte value at offset 0x0201 | ||
806 | |||
807 | In addition to read/modify/write the setup header of the struct | ||
808 | boot_params as that of 16-bit boot protocol, the boot loader should | ||
809 | also fill the additional fields of the struct boot_params as that | ||
810 | described in zero-page.txt. | ||
811 | |||
812 | After setupping the struct boot_params, the boot loader can load the | ||
813 | 32/64-bit kernel in the same way as that of 16-bit boot protocol. | ||
814 | |||
815 | In 32-bit boot protocol, the kernel is started by jumping to the | ||
816 | 32-bit kernel entry point, which is the start address of loaded | ||
817 | 32/64-bit kernel. | ||
818 | |||
819 | At entry, the CPU must be in 32-bit protected mode with paging | ||
820 | disabled; a GDT must be loaded with the descriptors for selectors | ||
821 | __BOOT_CS(0x10) and __BOOT_DS(0x18); both descriptors must be 4G flat | ||
822 | segment; __BOOS_CS must have execute/read permission, and __BOOT_DS | ||
823 | must have read/write permission; CS must be __BOOT_CS and DS, ES, SS | ||
824 | must be __BOOT_DS; interrupt must be disabled; %esi must hold the base | ||
825 | address of the struct boot_params; %ebp, %edi and %ebx must be zero. | ||