diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-07-19 05:23:48 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-07-20 19:18:58 -0400 |
commit | 9ca8f72a9297f2052d806bd1111e176533aa69bd (patch) | |
tree | 520e3a306588bd49ae618a7e1930028e4e38ea01 /Documentation/x86 | |
parent | bacef661acdb634170a8faddbc1cf28e8f8b9eee (diff) |
x86, efi: Handover Protocol
As things currently stand, traditional EFI boot loaders and the EFI
boot stub are carrying essentially the same initialisation code
required to setup an EFI machine for booting a kernel. There's really
no need to have this code in two places and the hope is that, with
this new protocol, initialisation and booting of the kernel can be
left solely to the kernel's EFI boot stub. The responsibilities of the
boot loader then become,
o Loading the kernel image from boot media
File system code still needs to be carried by boot loaders for the
scenario where the kernel and initrd files reside on a file system
that the EFI firmware doesn't natively understand, such as ext4, etc.
o Providing a user interface
Boot loaders still need to display any menus/interfaces, for example
to allow the user to select from a list of kernels.
Bump the boot protocol number because we added the 'handover_offset'
field to indicate the location of the handover protocol entry point.
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Acked-and-Tested-by: Matthew Garrett <mjg@redhat.com>
Link: http://lkml.kernel.org/r/1342689828-16815-1-git-send-email-matt@console-pimps.org
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'Documentation/x86')
-rw-r--r-- | Documentation/x86/boot.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt index 7c3a8801b7ce..c6539a4278b6 100644 --- a/Documentation/x86/boot.txt +++ b/Documentation/x86/boot.txt | |||
@@ -54,6 +54,9 @@ Protocol 2.10: (Kernel 2.6.31) Added a protocol for relaxed alignment | |||
54 | beyond the kernel_alignment added, new init_size and | 54 | beyond the kernel_alignment added, new init_size and |
55 | pref_address fields. Added extended boot loader IDs. | 55 | pref_address fields. Added extended boot loader IDs. |
56 | 56 | ||
57 | Protocol 2.11: (Kernel 3.6) Added a field for offset of EFI handover | ||
58 | protocol entry point. | ||
59 | |||
57 | **** MEMORY LAYOUT | 60 | **** MEMORY LAYOUT |
58 | 61 | ||
59 | The traditional memory map for the kernel loader, used for Image or | 62 | The traditional memory map for the kernel loader, used for Image or |
@@ -189,6 +192,7 @@ Offset Proto Name Meaning | |||
189 | of struct setup_data | 192 | of struct setup_data |
190 | 0258/8 2.10+ pref_address Preferred loading address | 193 | 0258/8 2.10+ pref_address Preferred loading address |
191 | 0260/4 2.10+ init_size Linear memory required during initialization | 194 | 0260/4 2.10+ init_size Linear memory required during initialization |
195 | 0264/4 2.11+ handover_offset Offset of handover entry point | ||
192 | 196 | ||
193 | (1) For backwards compatibility, if the setup_sects field contains 0, the | 197 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
194 | real value is 4. | 198 | real value is 4. |
@@ -690,6 +694,16 @@ Offset/size: 0x260/4 | |||
690 | else | 694 | else |
691 | runtime_start = pref_address | 695 | runtime_start = pref_address |
692 | 696 | ||
697 | Field name: handover_offset | ||
698 | Type: read | ||
699 | Offset/size: 0x264/4 | ||
700 | |||
701 | This field is the offset from the beginning of the kernel image to | ||
702 | the EFI handover protocol entry point. Boot loaders using the EFI | ||
703 | handover protocol to boot the kernel should jump to this offset. | ||
704 | |||
705 | See EFI HANDOVER PROTOCOL below for more details. | ||
706 | |||
693 | 707 | ||
694 | **** THE IMAGE CHECKSUM | 708 | **** THE IMAGE CHECKSUM |
695 | 709 | ||
@@ -1010,3 +1024,30 @@ segment; __BOOS_CS must have execute/read permission, and __BOOT_DS | |||
1010 | must have read/write permission; CS must be __BOOT_CS and DS, ES, SS | 1024 | must have read/write permission; CS must be __BOOT_CS and DS, ES, SS |
1011 | must be __BOOT_DS; interrupt must be disabled; %esi must hold the base | 1025 | must be __BOOT_DS; interrupt must be disabled; %esi must hold the base |
1012 | address of the struct boot_params; %ebp, %edi and %ebx must be zero. | 1026 | address of the struct boot_params; %ebp, %edi and %ebx must be zero. |
1027 | |||
1028 | **** EFI HANDOVER PROTOCOL | ||
1029 | |||
1030 | This protocol allows boot loaders to defer initialisation to the EFI | ||
1031 | boot stub. The boot loader is required to load the kernel/initrd(s) | ||
1032 | from the boot media and jump to the EFI handover protocol entry point | ||
1033 | which is hdr->handover_offset bytes from the beginning of | ||
1034 | startup_{32,64}. | ||
1035 | |||
1036 | The function prototype for the handover entry point looks like this, | ||
1037 | |||
1038 | efi_main(void *handle, efi_system_table_t *table, struct boot_params *bp) | ||
1039 | |||
1040 | 'handle' is the EFI image handle passed to the boot loader by the EFI | ||
1041 | firmware, 'table' is the EFI system table - these are the first two | ||
1042 | arguments of the "handoff state" as described in section 2.3 of the | ||
1043 | UEFI specification. 'bp' is the boot loader-allocated boot params. | ||
1044 | |||
1045 | The boot loader *must* fill out the following fields in bp, | ||
1046 | |||
1047 | o hdr.code32_start | ||
1048 | o hdr.cmd_line_ptr | ||
1049 | o hdr.cmdline_size | ||
1050 | o hdr.ramdisk_image (if applicable) | ||
1051 | o hdr.ramdisk_size (if applicable) | ||
1052 | |||
1053 | All other fields should be zero. | ||