From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cA0p9-0008VH-TD for mharc-grub-devel@gnu.org; Thu, 24 Nov 2016 15:40:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cA0p6-0008SS-HL for grub-devel@gnu.org; Thu, 24 Nov 2016 15:40:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cA0p5-00023e-1U for grub-devel@gnu.org; Thu, 24 Nov 2016 15:40:48 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:30544) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cA0p4-00023D-OG for grub-devel@gnu.org; Thu, 24 Nov 2016 15:40:46 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAOKegZv012978 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Nov 2016 20:40:42 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uAOKefVX008267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Nov 2016 20:40:42 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uAOKefDH020533; Thu, 24 Nov 2016 20:40:41 GMT Received: from olila.local.net-space.pl (/10.175.249.101) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Nov 2016 12:40:40 -0800 From: Daniel Kiper To: grub-devel@gnu.org, xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, arvidjaar@gmail.com, eric.snowberg@oracle.com, jgross@suse.com, konrad.wilk@oracle.com, phcoder@gmail.com, seth.goldberg@oracle.com Subject: [MULTIBOOT2 DOC PATCH v2 05/11] multiboot2: Add description of support for EFI boot services Date: Thu, 24 Nov 2016 21:40:04 +0100 Message-Id: <1480020010-18421-6-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1480020010-18421-1-git-send-email-daniel.kiper@oracle.com> References: <1480020010-18421-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 20:40:50 -0000 Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - clarify physical address meaning for EFI amd64 mode with boot services enabled (suggested by Andrew Cooper). --- doc/multiboot.texi | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++- doc/multiboot2.h | 2 + 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/doc/multiboot.texi b/doc/multiboot.texi index f0f167e..cc1edab 100644 --- a/doc/multiboot.texi +++ b/doc/multiboot.texi @@ -534,6 +534,66 @@ The physical address to which the boot loader should jump in order to start running the operating system. @end table +@subsection EFI i386 entry address tag of Multiboot2 header + +@example +@group + +-------------------+ +u16 | type = 8 | +u16 | flags | +u32 | size | +u_virt | entry_addr | + +-------------------+ +@end group +@end example + +All of the address fields in this tag are physical addresses. +The meaning of each is as follows: + +@table @code + +@item entry_addr +The physical address to which the boot loader should jump in order to +start running EFI i386 compatible operating system code. +@end table + +This tag is taken into account only on EFI i386 platforms +when Multiboot2 image header contains EFI boot services tag. +Then entry point specified in ELF header and the entry address +tag of Multiboot2 header are ignored. + +@subsection EFI amd64 entry address tag of Multiboot2 header + +@example +@group + +-------------------+ +u16 | type = 9 | +u16 | flags | +u32 | size | +u_virt | entry_addr | + +-------------------+ +@end group +@end example + +All of the address fields in this tag are physical addresses (paging +mode is enabled and any memory space defined by the UEFI memory map +is identity mapped, hence, virtual address equals physical address; +Unified Extensible Firmware Interface Specification, Version 2.6, +section 2.3.4, x64 Platforms, boot services). The meaning of each +is as follows: + +@table @code + +@item entry_addr +The physical address to which the boot loader should jump in order to +start running EFI amd64 compatible operating system code. +@end table + +This tag is taken into account only on EFI amd64 platforms +when Multiboot2 image header contains EFI boot services tag. +Then entry point specified in ELF header and the entry address +tag of Multiboot2 header are ignored. + @node Console header tags @subsection Flags tag @@ -714,12 +774,63 @@ The OS image must leave interrupts disabled until it sets up its own On EFI system boot services must be terminated. +@section EFI i386 machine state with boot services enabled + +When the boot loader invokes the 32-bit operating system on EFI i386 +platform and EFI boot services tag together with EFI i386 entry address +tag are present in the image Multiboot2 header, the machine must have the +following state: + +@table @samp +@item EAX +Must contain the magic value @samp{0x36d76289}; 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). + +@item EBX +Must contain the 32-bit physical address of the Multiboot2 +information structure provided by the boot loader (@pxref{Boot +information format}). +@end table + +All other processor registers, flag bits and state are set accordingly +to Unified Extensible Firmware Interface Specification, Version 2.6, +section 2.3.2, IA-32 Platforms, boot services. + +@section EFI amd64 machine state with boot services enabled + +When the boot loader invokes the 64-bit operating system on EFI amd64 +platform and EFI boot services tag together with EFI amd64 entry address +tag are present in the image Multiboot2 header, the machine must have the +following state: + +@table @samp +@item RAX +Must contain the magic value @samp{0x36d76289}; 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). + +@item RBX +Must contain the 64-bit physical address (paging mode is enabled and any +memory space defined by the UEFI memory map is identity mapped, hence, +virtual address equals physical address; Unified Extensible Firmware +Interface Specification, Version 2.6, section 2.3.4, x64 Platforms, boot +services) of the Multiboot2 information structure provided by the boot +loader (@pxref{Boot information format}). +@end table + +All other processor registers, flag bits and state are set accordingly +to Unified Extensible Firmware Interface Specification, Version 2.6, +section 2.3.4, x64 Platforms, boot services. + @node Boot information format @section Boot information @subsection Boot information format -Upon entry to the operating system, the @code{EBX} register contains the -physical address of a @dfn{Multiboot2 information} data structure, +Upon entry to the operating system, the @code{R5/EBX/RBX} register contains +the physical address of a @dfn{Multiboot2 information} data structure, through which the boot loader communicates vital information to the operating system. The operating system can use or ignore any parts of the structure as it chooses; all information passed by the boot loader diff --git a/doc/multiboot2.h b/doc/multiboot2.h index 78337f5..240400d 100644 --- a/doc/multiboot2.h +++ b/doc/multiboot2.h @@ -69,6 +69,8 @@ #define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5 #define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6 #define MULTIBOOT_HEADER_TAG_EFI_BS 7 +#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI32 8 +#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 #define MULTIBOOT_ARCHITECTURE_I386 0 #define MULTIBOOT_ARCHITECTURE_MIPS32 4 -- 1.7.10.4