From 614305743031bdfc02cb4ce346e450cd1d476e17 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 18 Feb 2016 02:44:19 +0000 Subject: [librm] Add support for running in 64-bit long mode Add support for running the BIOS version of iPXE in 64-bit long mode. A 64-bit BIOS version of iPXE can be built using e.g. make bin-x86_64-pcbios/ipxe.usb make bin-x86_64-pcbios/8086100e.mrom The 64-bit BIOS version should appear to function identically to the normal 32-bit BIOS version. The physical memory layout is unaltered: iPXE is still relocated to the top of the available 32-bit address space. The code is linked to a virtual address of 0xffffffffeb000000 (in the negative 2GB as required by -mcmodel=kernel), with 4kB pages created to cover the whole of .textdata. 2MB pages are created to cover the whole of the 32-bit address space. The 32-bit portions of the code run with VIRTUAL_CS and VIRTUAL_DS configured such that truncating a 64-bit virtual address gives a 32-bit virtual address pointing to the same physical location. The stack pointer remains as a physical address when running in long mode (although the .stack section is accessible via the negative 2GB virtual address); this is done in order to simplify the handling of interrupts occurring while executing a portion of 32-bit code with flat physical addressing via PHYS_CODE(). Interrupts may be enabled in either 64-bit long mode, 32-bit protected mode with virtual addresses, 32-bit protected mode with physical addresses, or 16-bit real mode. Interrupts occurring in any mode other than real mode will be reflected down to real mode and handled by whichever ISR is hooked into the BIOS interrupt vector table. Signed-off-by: Michael Brown --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 2a9cc9e8..3ffa1eba 100644 --- a/src/Makefile +++ b/src/Makefile @@ -151,6 +151,9 @@ all : $(ALL) everything : $(Q)$(MAKE) --no-print-directory $(ALL) \ bin/3c509.rom bin/intel.rom bin/intel.mrom \ + bin-x86_64-pcbios/8086100e.mrom bin-x86_64-pcbios/intel.rom \ + bin-x86_64-pcbios/ipxe.usb bin-x86_64-pcbios/ipxe.pxe \ + bin-x86_64-pcbios/undionly.kpxe \ bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \ bin-i386-efi/ipxe.efirom \ bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \ -- cgit v1.2.3-55-g7522