[haiku-commits] BRANCH jessicah-github.efi.master [066cdfaf31c8] headers/private/kernel/boot/platform/efi src/system/boot/platform/efi headers/private/kernel/boot/platform/efi/arch/x86_64 headers/private/kernel/boot/platform/efi/arch/x86 headers/private/kernel/boot/platform/efi/protocol

  • From: jessicah-github.efi.master <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 25 Apr 2015 04:01:52 +0200 (CEST)

added 73 changesets to branch 'refs/remotes/jessicah-github/efi.master'
old head: 0000000000000000000000000000000000000000
new head: 066cdfaf31c8d8294f92ac3434816fb728226af1
overview: https://github.com/jessicah/haiku/compare/066cdfaf31c8

----------------------------------------------------------------------------

6457c1278e59: Add EFI linker script for x86_64 from GNU-EFI project.

Original file is gnuefi/elf_x86_64.lds in GNU-EFI.
From GNU-EFI commit 8f5ba0e4fd398d49c0004164d18e50fb6acd36ca

http://sourceforge.net/p/gnu-efi/code/ci/8f5ba0e4fd398d49c0004164d18e50fb6acd36ca/

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

d601232ff905: Add x86_64 EFI relocation function from GNU-EFI project.

Original file is gnuefi/reloc_x86_64.c in GNU-EFI.

From GNU-EFI commit 8f5ba0e

http://sourceforge.net/p/gnu-efi/code/ci/8f5ba0e4fd398d49c0004164d18e50fb6acd36ca/

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

31d5bc970d93: Renamed to relocation_func.cpp.

Use a generic filename for relocation function. The directory tells
what arch the function is for so we can use simpler logic in the
Jamfile.
Switch to .cpp ending as our boot/elf header uses C++ features.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

6b09504aacdb: Remove efilib header, use extern "C" block.

Removed #include <efilib.h> as we're stripping down GNU-EFI.
Added extern "C" block around _relocate function to avoid name mangling.
Whitespace cleanup.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

a32456377e54: Add x86_64 EFI start function from GNU-EFI project.

Original file is gnuefi/crt0-efi-x86_64.S in GNU-EFI.

From GNU-EFI commit 8f5ba0e

http://sourceforge.net/p/gnu-efi/code/ci/8f5ba0e4fd398d49c0004164d18e50fb6acd36ca/

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

ce9f57ff91f7: Rename to start_func.S

Use a generic filename for start function. The directory tells what arch
the function is for so we can use simpler logic in the Jamfile.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

24d9b0e63917: Working EFI application ('Hello World') and Jamfile.

First version of an EFI Application that actually runs.
The Jamfile is a still a bit of a hack, but builds with updated buildtools.

I currently build by adding
SubInclude HAIKU_TOP src system boot platform efi ;
to src/system/boot/Jamfile and running jam haiku.efi but that is just a
temporary hack.
There are still things to clean up in Jamfile, for instance haiku.efi is put
in the haiku directory atm. This is however first working version. To set up
QEMU to test haiku.efi see my docs in https://github.com/tqh/efi-example

Now it is 'just' the work of writing a bootloader left.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

6c5d6330ab74: As I understand MakeLocateDebug should be used on haiku.efi

This causes haiku.efi to be built in the right directory.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

0ec57d020318: Use boot_loader_$(TARGET_BOOT_PLATFORM).ld naming for linker
script.

As dictated in system/boot/Jamfile.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

a5586cdc695e: Added simple calloc implementation.

Needed for HashMap.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

2c70980fd68a: Don't use partition pointer as id, as it only works on 32bit
platforms.

Use a counter to generate the partition id, and store the id to partition
lookup in a hashmap instead.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

c4a8493a50a9: Fix, static variables get an 's' prefix.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

c74d2d4522c9: Use memset in calloc, return NULL on size or numElements == 0.

Posix states 'If either numElements or size is 0, then either a null pointer
or a
unique pointer value that can be successfully passed to free() shall be
returned.'

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

283314e2cad6: Only use 32 bit functions in boot on x86_64 if we are bios_ia32.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

cc7186c3e1f6: Only set bios_ia32 flags for x86_64 if boot platform is bios_ia32.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

424c5705d529: UEFI: platform headers

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

0e22daaaa003: Add TARGET_BOOT_LINKFLAGS to LINKFLAGS in BootLD.

Consulted with Ingo on adding TARGET_BOOT_LINKFLAGS, and
this is 'probably' ok as x86_64 builds still build and runs.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

102b2d1a59ba: Use variables correclyin the if, and use renamed variables in
build.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

e5e3a5a237a4: Make 32 bit ELF relocation compile on 64 bit boot platforms.

boot_arch_elf_relocate_rel tries to call boot_elf_resolve_symbol
with an *addr_t so we make sure it is always *Elf32_Addr.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

bc0196581e8a: Cleaning up EFI platform Jamfile a bit.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

d8a6e7b33f1a: Use x86_64 functions for x86_64 non bios platforms.

This logic is handled in libroot Jamfiles, but we only
use parts of that in boot.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

5be42f86fb82: Add compile flags for EFI platform.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

34d15962ec3b: Forgot indentation.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

f34260ef7bba: Introduce new build flag for bootld and add EFI boot targets.

EFI needs BootLd to use -BSymbolic and others to link.
Also moved BoardSetup to use that flag instead of Jamfile magic.
BoardSetup was called and added to XX_CC_FLAGS before
XX_CC_FLAGS was set so moved BoardSetup to after it, which also
made sense for this change.

This allow building a runnable(!) EFI app with
jam -sHAIKU_BOOT_PLATFORM=efi haiku_loader.efi
Atm it only prints a message and waits for a key.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

602a669aa6e0: Rename flag to XX_BOOT_LDFLAGS.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

591d67b15cef: Fix missing paranthesis on variable mistake.

This makes building x86_64 bios build and run again.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

fb95dcd9d369: Add EFI platform header for files using EFI.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

ef267c7f911f: Implement console code.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

4135450a6ddf: Init console.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

c98d986afe13: Remove old start.c.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

15b5ce49a138: Update Jamfile to build console, remove old rules.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

f95b840daac8: Remove old EFI string writing test code.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

1ed1013545af: Make sure bootloader builds to the right directory.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

50189f2af421: loader: Drop the HashMap for partition lookup by id

The HashMap constructor was called before the heap is initialized,
ending up calling malloc from the OpenHashMap constructor.

Oddly it was still working on x86 but broke other platforms.

Instead we add a Lookup() static method to Partition,
which by default walks gPartitions for the id,
and recursively calls itself on the children lists.

This means we must add a partition even temporarily to gPartitions
before Scan()ing it though.

Signed-off-by: François Revol <revol@xxxxxxx>

[ François Revol <revol@xxxxxxx> ]

784cbe949aa8: GNU-EFI has removed the -S (strip-all) option, so do we.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

91134e11fae1: Implement EFI keyboard functions. Mostly done.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

de956bdc736b: Implemented EFI serial code. Seems to work.

Not sure we can pass EFI drivers to kernel so probably
should remove commented kernel args section later.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

8a7a15c60f0b: Loop on EFI_NOT_READY when checking for keypress.

Not sure

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

220ad0f208c3: Partial implementation of EFI debug functions.

Lacks implementation of debug_init_post_mmu and debug_cleanup

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

2d6c219d4250: Update Jamfile and work in progress on start.cpp

Enable serial and early debug functions.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

47240a85e747: Remove leftovers from bios code.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

8ecb96b1a3e9: Adding ctor_list in linking, and _bss_start.

Clearing bss seems to hang at the moment.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

c33e4e5b21e3: Don't include mmu.h for now.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

6d3ed1d3fb78: Don't clear BSS, it is already zeroed.

EFI doesn't seem to like a .bss section according to GNU-EFI.
Therefore it is put and expanded inside .data. It is already zeroed
there. It makes the EFI app bigger so maybe there is a better
way?

The reason clearBSS() made the application hang was because
kSystemTable that we set before clearBSS() was part of .bss which
meant it was erased on clearing.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

ab2e3e54335d: Missed to remove clearBSS() function in previous commit.

[ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

8525fa8cd01d: EFI: fix kprintf; didn't copy variable arguments like it should

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

6f8abbedd32d: EFI: temporarily disable treating warnings as errors

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

98c0e0458048: EFI: add simple accessors for boot & runtime services

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

bcef6a780068: EFI: implement basic memory allocation & heap

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

4b657ba04d25: EFI: add basic text-mode menu support

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

8c9979b45415: EFI: implement EFI block io devices, stub out video code.

* The EFI block io devices are read-only, and it will scan
all block devices reported by EFI; in theory, one can
forego even scanning for a partitioning system
* May want to later change the EFI block io code to only return
disks rather than individual partitions, and rely on the
system partitioning code
* Also forced the boot menu to show for now (start.cpp)
* With these changes, it's now possible to get to the Haiku
boot menu on a 64-bit EFI system (at least without any
actual Haiku installations present)

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

0bec2504b5aa: Whitespace cleanup; no functional changes

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

759f9130c5bc: EFI: acpi init

* Not used yet; depends on functions in bios_ia32/acpi.cpp which
will be put into a shared location for the various x86 boot
loaders to use

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

1c7703cd3fff: EFI: use the best text mode available to us

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

11069d9a363d: EFI: fixes boot on a macbook air; seems memory isn't zeroed

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

71b68cd180cc: EFI: chooses the best resolution and throws up the splash screen

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

9e78ab305c2d: EFI: make switching between text & graphics modes work

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

402b7bf6cae5: Preliminary EFI support in the bootloader.

Enough to let the kernel to print hello, but not much beyond that.
I think this also breaks non-EFI x86-64 support, code cleanups required.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

2de1d0c93d74: Fix initial kernel stack address.

Leaving stack_address uninitialized caused platform_allocate_region to
allocate a random virtual address to the stack.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

4e5c44df7a26: Bootloader: Populate gKernelArgs with plausible values.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

b167598ff931: bootloader: Bug fix, PML4 must not overlap physical map.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

9aaeccbe90f2: bootloader: Initialize/load the GDT.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

4dfa0cc1c01e: Try harder to allocate early physical pages.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

8df1c3bde217: bootloader: Translate kernel args before adding them to
kernel_args_range.

Chunks may be physically contiguous, but virtually disjoint. Adding
physical addresses may cause ranges to be merged incorrectly.

[ Henry Harrington <henry.harrington@xxxxxxxxx> ]

cb66d50b95de: EFI boot loader hacking

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

670bf612b800: UEFI: add missing include

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

65b305197a8e: UEFI: pass ACPI root pointer to the kernel

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

babcf8a2db24: boot_loader: pass ACPI root to kernel, kernel to ACPI driver

* This allows ACPI to work with the UEFI bootloader, as the
ACPICA's probe for the ACPI root only works with the BIOS

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

fe8d8073bbbd: Fix permissions

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

e05615e6ce7f: EFI kernel support hacking

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

8840e0c1f9f8: Allow configuring for a given boot platform.

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

5870e13bcdfb: Move handling of pic/non-pic to ArchitectureRules Add ACPI root
pointer to platform args for bios_ia32 Fix changes from UEFI code for elf.cpp &
kernel_args.cpp Correct BOOTLD_FLAGS to BOOT_LDFLAGS where missed

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

066cdfaf31c8: UEFI: doesn't yet work with the reimplemented memset functions

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

107 files changed, 13693 insertions(+), 98 deletions(-)
build/jam/ArchitectureRules | 44 +-
build/jam/BootRules | 2 +-
build/jam/BuildSetup | 2 +-
configure | 6 +
headers/private/kernel/boot/partitions.h | 2 +
headers/private/kernel/boot/platform.h | 2 +
.../platform/bios_ia32/platform_kernel_args.h | 2 +
.../kernel/boot/platform/efi/arch/x86/efibind.h | 284 +++
.../kernel/boot/platform/efi/arch/x86/pe.h | 595 ++++++
.../boot/platform/efi/arch/x86_64/efibind.h | 380 ++++
.../kernel/boot/platform/efi/arch/x86_64/pe.h | 595 ++++++
headers/private/kernel/boot/platform/efi/efi.h | 53 +
.../private/kernel/boot/platform/efi/efi_nii.h | 74 +
.../private/kernel/boot/platform/efi/efi_pxe.h | 1743 ++++++++++++++++++
.../private/kernel/boot/platform/efi/efiapi.h | 890 +++++++++
.../private/kernel/boot/platform/efi/eficon.h | 302 +++
.../private/kernel/boot/platform/efi/efidef.h | 209 +++
.../private/kernel/boot/platform/efi/efidevp.h | 402 ++++
.../private/kernel/boot/platform/efi/efierr.h | 67 +
headers/private/kernel/boot/platform/efi/efifs.h | 116 ++
.../private/kernel/boot/platform/efi/efigpt.h | 68 +
headers/private/kernel/boot/platform/efi/efiip.h | 459 +++++
.../private/kernel/boot/platform/efi/efilink.h | 177 ++
.../private/kernel/boot/platform/efi/efinet.h | 340 ++++
.../private/kernel/boot/platform/efi/efipart.h | 61 +
.../private/kernel/boot/platform/efi/efipciio.h | 219 +++
.../private/kernel/boot/platform/efi/efiprot.h | 757 ++++++++
.../private/kernel/boot/platform/efi/efipxebc.h | 464 +++++
.../private/kernel/boot/platform/efi/efiser.h | 132 ++
.../private/kernel/boot/platform/efi/efistdarg.h | 33 +
.../private/kernel/boot/platform/efi/efitcp.h | 391 ++++
.../private/kernel/boot/platform/efi/efiudp.h | 272 +++
headers/private/kernel/boot/platform/efi/efiui.h | 54 +
.../private/kernel/boot/platform/efi/libsmbios.h | 132 ++
headers/private/kernel/boot/platform/efi/pci22.h | 193 ++
.../boot/platform/efi/platform_kernel_args.h | 42 +
.../boot/platform/efi/platform_stage2_args.h | 14 +
.../boot/platform/efi/protocol/adapterdebug.h | 32 +
.../boot/platform/efi/protocol/eficonsplit.h | 32 +
.../kernel/boot/platform/efi/protocol/efidbg.h | 210 +++
.../kernel/boot/platform/efi/protocol/efivar.h | 133 ++
.../boot/platform/efi/protocol/ia64/eficontext.h | 208 +++
.../kernel/boot/platform/efi/protocol/intload.h | 27 +
.../boot/platform/efi/protocol/legacyboot.h | 119 ++
.../boot/platform/efi/protocol/piflash64.h | 121 ++
.../kernel/boot/platform/efi/protocol/vgaclass.h | 95 +
.../private/kernel/boot/platform/efi/romload.h | 41 +
src/system/boot/Jamfile | 34 +-
src/system/boot/arch/arm/Jamfile | 2 +-
src/system/boot/arch/m68k/Jamfile | 8 +-
src/system/boot/arch/x86/Jamfile | 22 +-
src/system/boot/loader/Jamfile | 4 +-
src/system/boot/loader/elf.cpp | 34 +-
.../boot/loader/file_systems/amiga_ffs/Jamfile | 1 -
src/system/boot/loader/file_systems/bfs/Jamfile | 1 -
src/system/boot/loader/file_systems/fat/Jamfile | 1 -
.../boot/loader/file_systems/hfs_plus/Jamfile | 1 -
.../boot/loader/file_systems/packagefs/Jamfile | 2 -
.../boot/loader/file_systems/tarfs/Jamfile | 2 -
src/system/boot/loader/heap.cpp | 15 +
src/system/boot/loader/kernel_args.cpp | 14 +
src/system/boot/loader/net/Jamfile | 2 -
src/system/boot/loader/partitions.cpp | 68 +-
src/system/boot/platform/bios_ia32/Jamfile | 2 +-
src/system/boot/platform/efi/Jamfile | 40 +
src/system/boot/platform/efi/acpi.cpp | 265 +++
src/system/boot/platform/efi/acpi.h | 22 +
.../platform/efi/arch/x86_64/relocation_func.cpp | 99 +
.../boot/platform/efi/arch/x86_64/start_func.S | 76 +
src/system/boot/platform/efi/console.cpp | 219 +++
src/system/boot/platform/efi/console.h | 14 +
src/system/boot/platform/efi/debug.cpp | 219 +++
src/system/boot/platform/efi/debug.h | 26 +
src/system/boot/platform/efi/devices.cpp | 425 +++++
src/system/boot/platform/efi/efi_platform.h | 23 +
src/system/boot/platform/efi/entry.S | 69 +
src/system/boot/platform/efi/heap.cpp | 38 +
src/system/boot/platform/efi/keyboard.cpp | 75 +
src/system/boot/platform/efi/keyboard.h | 30 +
src/system/boot/platform/efi/menu.cpp | 49 +
src/system/boot/platform/efi/mmu.cpp | 309 ++++
src/system/boot/platform/efi/mmu.h | 44 +
src/system/boot/platform/efi/serial.cpp | 116 ++
src/system/boot/platform/efi/serial.h | 29 +
src/system/boot/platform/efi/start.cpp | 366 ++++
src/system/boot/platform/efi/video.cpp | 70 +
src/system/boot/platform/generic/Jamfile | 3 +-
src/system/boot/platform/pxe_ia32/Jamfile | 2 +-
src/system/boot/platform/raspberrypi_arm/Jamfile | 2 +-
src/system/boot/platform/u-boot/arch/arm/Jamfile | 3 +-
src/system/boot/platform/u-boot/arch/ppc/Jamfile | 6 +-
src/system/kernel/arch/x86/64/cpuid.S | 47 +
src/system/kernel/arch/x86/arch_elf.cpp | 2 +-
src/system/kernel/arch/x86/arch_platform.cpp | 6 +
src/system/kernel/arch/x86/arch_vm.cpp | 2 +-
.../kernel/arch/x86/arch_vm_translation_map.cpp | 2 +-
.../x86/paging/64bit/X86PagingMethod64Bit.cpp | 2 +-
.../kernel/device_manager/legacy_drivers.cpp | 8 +-
src/system/kernel/fs/vfs_boot.cpp | 38 +-
[ *** stats truncated: 8 lines dropped *** ]

############################################################################

Commit: 6457c1278e59b9c58d8956865fd915c0f396166d
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Aug 7 09:18:47 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:14:14 2015 UTC

Add EFI linker script for x86_64 from GNU-EFI project.

Original file is gnuefi/elf_x86_64.lds in GNU-EFI.
From GNU-EFI commit 8f5ba0e4fd398d49c0004164d18e50fb6acd36ca
http://sourceforge.net/p/gnu-efi/code/ci/8f5ba0e4fd398d49c0004164d18e50fb6acd36ca/

----------------------------------------------------------------------------

diff --git a/src/system/ldscripts/x86_64/efi.ld
b/src/system/ldscripts/x86_64/efi.ld
new file mode 100644
index 0000000..c4df0a5
--- /dev/null
+++ b/src/system/ldscripts/x86_64/efi.ld
@@ -0,0 +1,65 @@
+/* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN
SYNC */
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
+ENTRY(_start)
+SECTIONS
+{
+ . = 0;
+ ImageBase = .;
+ .hash : { *(.hash) } /* this MUST come first! */
+ . = ALIGN(4096);
+ .eh_frame :
+ {
+ *(.eh_frame)
+ }
+ . = ALIGN(4096);
+ .text :
+ {
+ *(.text)
+ *(.text.*)
+ *(.gnu.linkonce.t.*)
+ }
+ . = ALIGN(4096);
+ .reloc :
+ {
+ *(.reloc)
+ }
+ . = ALIGN(4096);
+ .data :
+ {
+ *(.rodata*)
+ *(.got.plt)
+ *(.got)
+ *(.data*)
+ *(.sdata)
+ /* the EFI loader doesn't seem to like a .bss section, so we stick
+ it all into .data: */
+ *(.sbss)
+ *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ *(.rel.local)
+ }
+ . = ALIGN(4096);
+ .dynamic : { *(.dynamic) }
+ . = ALIGN(4096);
+ .rela :
+ {
+ *(.rela.data*)
+ *(.rela.got)
+ *(.rela.stab)
+ }
+ . = ALIGN(4096);
+ .dynsym : { *(.dynsym) }
+ . = ALIGN(4096);
+ .dynstr : { *(.dynstr) }
+ . = ALIGN(4096);
+ .ignored.reloc :
+ {
+ *(.rela.reloc)
+ *(.eh_frame)
+ *(.note.GNU-stack)
+ }
+ .comment 0 : { *(.comment) }
+}

############################################################################

Commit: d601232ff905d9ff40f03d411544726a38edc5f4
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Aug 28 20:07:51 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:14:41 2015 UTC

Add x86_64 EFI relocation function from GNU-EFI project.

Original file is gnuefi/reloc_x86_64.c in GNU-EFI.

From GNU-EFI commit 8f5ba0e
http://sourceforge.net/p/gnu-efi/code/ci/8f5ba0e4fd398d49c0004164d18e50fb6acd36ca/

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/arch/x86_64/reloc_x86_64.c
b/src/system/boot/platform/efi/arch/x86_64/reloc_x86_64.c
new file mode 100644
index 0000000..04b4ddb
--- /dev/null
+++ b/src/system/boot/platform/efi/arch/x86_64/reloc_x86_64.c
@@ -0,0 +1,96 @@
+/* reloc_x86_64.c - position independent x86_64 ELF shared object relocator
+ Copyright (C) 1999 Hewlett-Packard Co.
+ Contributed by David Mosberger <davidm@xxxxxxxxxx>.
+ Copyright (C) 2005 Intel Co.
+ Contributed by Fenghua Yu <fenghua.yu@xxxxxxxxx>.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+ * Neither the name of Hewlett-Packard Co. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+*/
+
+#include <efi.h>
+#include <efilib.h>
+
+#include <elf.h>
+
+EFI_STATUS _relocate (long ldbase, Elf64_Dyn *dyn, EFI_HANDLE image,
EFI_SYSTEM_TABLE *systab)
+{
+ long relsz = 0, relent = 0;
+ Elf64_Rel *rel = 0;
+ unsigned long *addr;
+ int i;
+
+ for (i = 0; dyn[i].d_tag != DT_NULL; ++i) {
+ switch (dyn[i].d_tag) {
+ case DT_RELA:
+ rel = (Elf64_Rel*)
+ ((unsigned long)dyn[i].d_un.d_ptr
+ + ldbase);
+ break;
+
+ case DT_RELASZ:
+ relsz = dyn[i].d_un.d_val;
+ break;
+
+ case DT_RELAENT:
+ relent = dyn[i].d_un.d_val;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (!rel && relent == 0)
+ return EFI_SUCCESS;
+
+ if (!rel || relent == 0)
+ return EFI_LOAD_ERROR;
+
+ while (relsz > 0) {
+ /* apply the relocs */
+ switch (ELF64_R_TYPE (rel->r_info)) {
+ case R_X86_64_NONE:
+ break;
+
+ case R_X86_64_RELATIVE:
+ addr = (unsigned long *)
+ (ldbase + rel->r_offset);
+ *addr += ldbase;
+ break;
+
+ default:
+ break;
+ }
+ rel = (Elf64_Rel*) ((char *) rel + relent);
+ relsz -= relent;
+ }
+ return EFI_SUCCESS;
+}

############################################################################

Commit: 31d5bc970d934888b7074ed45c5315a5618fcdc7
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Aug 28 20:59:33 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:14:51 2015 UTC

Renamed to relocation_func.cpp.

Use a generic filename for relocation function. The directory tells
what arch the function is for so we can use simpler logic in the
Jamfile.
Switch to .cpp ending as our boot/elf header uses C++ features.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/arch/x86_64/reloc_x86_64.c
b/src/system/boot/platform/efi/arch/x86_64/relocation_func.cpp
similarity index 100%
rename from src/system/boot/platform/efi/arch/x86_64/reloc_x86_64.c
rename to src/system/boot/platform/efi/arch/x86_64/relocation_func.cpp

############################################################################

Commit: 6b09504aacdbeffaef0979ad8b763d04d05d3baf
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Aug 28 21:05:07 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:15:04 2015 UTC

Remove efilib header, use extern "C" block.

Removed #include <efilib.h> as we're stripping down GNU-EFI.
Added extern "C" block around _relocate function to avoid name mangling.
Whitespace cleanup.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/arch/x86_64/relocation_func.cpp
b/src/system/boot/platform/efi/arch/x86_64/relocation_func.cpp
index 04b4ddb..015e4e9 100644
--- a/src/system/boot/platform/efi/arch/x86_64/relocation_func.cpp
+++ b/src/system/boot/platform/efi/arch/x86_64/relocation_func.cpp
@@ -36,10 +36,11 @@
*/

#include <efi.h>
-#include <efilib.h>
-
#include <elf.h>

+
+extern "C" {
+
EFI_STATUS _relocate (long ldbase, Elf64_Dyn *dyn, EFI_HANDLE image,
EFI_SYSTEM_TABLE *systab)
{
long relsz = 0, relent = 0;
@@ -68,11 +69,11 @@ EFI_STATUS _relocate (long ldbase, Elf64_Dyn *dyn,
EFI_HANDLE image, EFI_SYSTEM_
}
}

- if (!rel && relent == 0)
- return EFI_SUCCESS;
+ if (!rel && relent == 0)
+ return EFI_SUCCESS;

- if (!rel || relent == 0)
- return EFI_LOAD_ERROR;
+ if (!rel || relent == 0)
+ return EFI_LOAD_ERROR;

while (relsz > 0) {
/* apply the relocs */
@@ -94,3 +95,5 @@ EFI_STATUS _relocate (long ldbase, Elf64_Dyn *dyn, EFI_HANDLE
image, EFI_SYSTEM_
}
return EFI_SUCCESS;
}
+
+}

############################################################################

Commit: a32456377e544b065221243b5bcfb66e3da16f00
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Thu Aug 29 17:51:08 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:15:09 2015 UTC

Add x86_64 EFI start function from GNU-EFI project.

Original file is gnuefi/crt0-efi-x86_64.S in GNU-EFI.

From GNU-EFI commit 8f5ba0e
http://sourceforge.net/p/gnu-efi/code/ci/8f5ba0e4fd398d49c0004164d18e50fb6acd36ca/

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/arch/x86_64/crt0-efi-x86_64.S
b/src/system/boot/platform/efi/arch/x86_64/crt0-efi-x86_64.S
new file mode 100644
index 0000000..670e88e
--- /dev/null
+++ b/src/system/boot/platform/efi/arch/x86_64/crt0-efi-x86_64.S
@@ -0,0 +1,76 @@
+/* crt0-efi-x86_64.S - x86_64 EFI startup code.
+ Copyright (C) 1999 Hewlett-Packard Co.
+ Contributed by David Mosberger <davidm@xxxxxxxxxx>.
+ Copyright (C) 2005 Intel Co.
+ Contributed by Fenghua Yu <fenghua.yu@xxxxxxxxx>.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+ * Neither the name of Hewlett-Packard Co. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+*/
+ .text
+ .align 4
+
+ .globl _start
+_start:
+ subq $8, %rsp
+ pushq %rcx
+ pushq %rdx
+
+0:
+ lea ImageBase(%rip), %rdi
+ lea _DYNAMIC(%rip), %rsi
+
+ popq %rcx
+ popq %rdx
+ pushq %rcx
+ pushq %rdx
+ call _relocate
+
+ popq %rdi
+ popq %rsi
+
+ call efi_main
+ addq $8, %rsp
+
+.exit:
+ ret
+
+ // hand-craft a dummy .reloc section so EFI knows it's a relocatable
executable:
+
+ .data
+dummy: .long 0
+
+#define IMAGE_REL_ABSOLUTE 0
+ .section .reloc, "a"
+label1:
+ .long dummy-label1 // Page RVA
+ .long 10 // Block Size (2*4+2)
+ .word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy
+

############################################################################

Commit: ce9f57ff91f7e5e1f01186873b33c03d5d77033e
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Thu Aug 29 17:53:18 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:15:14 2015 UTC

Rename to start_func.S

Use a generic filename for start function. The directory tells what arch
the function is for so we can use simpler logic in the Jamfile.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/arch/x86_64/crt0-efi-x86_64.S
b/src/system/boot/platform/efi/arch/x86_64/start_func.S
similarity index 100%
rename from src/system/boot/platform/efi/arch/x86_64/crt0-efi-x86_64.S
rename to src/system/boot/platform/efi/arch/x86_64/start_func.S

############################################################################

Commit: 24d9b0e6391741f2ca704aa2193d22c2af56ea6e
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Thu Aug 29 17:59:23 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:15:20 2015 UTC

Working EFI application ('Hello World') and Jamfile.

First version of an EFI Application that actually runs.
The Jamfile is a still a bit of a hack, but builds with updated buildtools.

I currently build by adding
SubInclude HAIKU_TOP src system boot platform efi ;
to src/system/boot/Jamfile and running jam haiku.efi but that is just a
temporary hack.
There are still things to clean up in Jamfile, for instance haiku.efi is put
in the haiku directory atm. This is however first working version. To set up
QEMU to test haiku.efi see my docs in https://github.com/tqh/efi-example

Now it is 'just' the work of writing a bootloader left.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/Jamfile
b/src/system/boot/platform/efi/Jamfile
new file mode 100644
index 0000000..e199e58
--- /dev/null
+++ b/src/system/boot/platform/efi/Jamfile
@@ -0,0 +1,60 @@
+SubDir HAIKU_TOP src system boot platform efi ;
+
+UsePrivateHeaders [ FDirName kernel boot ] ;
+UsePrivateHeaders [ FDirName kernel boot platform efi ] ;
+UsePrivateHeaders [ FDirName kernel boot platform efi protocol ] ;
+UsePrivateHeaders [ FDirName kernel boot platform efi arch $(TARGET_ARCH) ] ;
+
+{
+ local defines = _BOOT_MODE GNU_EFI_USE_MS_ABI $(TARGET_ARCH)
B_HAIKU_64_BIT ;
+ defines = [ FDefines $(defines) ] ;
+ SubDirCcFlags $(defines) ;
+ SubDirC++Flags $(defines) -fno-rtti ;
+}
+
+local TARGET_BOOT_CCFLAGS = ;
+local TARGET_BOOT_C++FLAGS = ;
+local TARGET_BOOT_LINKFLAGS = ;
+
+local efi_glue_src =
+ relocation_func.cpp
+ start_func.S
+ ;
+
+BootMergeObject boot_platform_efi.o :
+ start.c
+ $(efi_glue_src)
+ :
+ -fPIC
+ -fshort-wchar
+ -ffreestanding
+ -fno-stack-protector
+ -m64
+ -mno-red-zone
+ -maccumulate-outgoing-args
+ ;
+
+BootLd haiku_efi_bootloader.so
+ : boot_platform_efi.o
+ : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/efi.ld
+ : -Bsymbolic -shared -nostdlib -znocombreloc ;
+
+
+rule EFIApplication {
+ local efiApplication = $(1) ;
+ local elfLibrary = $(2) ;
+
+ Depends $(efiApplication) : $(elfLibrary) ;
+}
+
+actions EFIApplication {
+ rm -f $(1)
+ $(TARGET_OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j
.rel \
+ -j .rela -j .reloc -S --target=efi-app-x86-64 $(2) $(1)
+}
+
+EFIApplication haiku.efi : haiku_efi_bootloader.so ;
+
+#SEARCH on [ FGristFiles $(efi_boot_src) ] = [ FDirName $(HAIKU_TOP) src
system boot platform efi ] ;
+SEARCH on [ FGristFiles $(efi_glue_src) ] = [ FDirName $(HAIKU_TOP) src
system boot platform efi arch $(TARGET_ARCH) ] ;
+SEARCH on [ FGristFiles $(genericPlatformSources) ] = [ FDirName $(HAIKU_TOP)
src system boot platform generic ] ;
diff --git a/src/system/boot/platform/efi/start.c
b/src/system/boot/platform/efi/start.c
new file mode 100644
index 0000000..11ab239
--- /dev/null
+++ b/src/system/boot/platform/efi/start.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2011, Intel Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "efibind.h"
+#include "efidef.h"
+#include "efidevp.h"
+#include "eficon.h"
+#include "efiapi.h"
+#include "efierr.h"
+
+
+static CHAR16 *exampleText = L"Example EFI Application. Press any key!";
+
+/**
+ * efi_main - The entry point for the EFI application
+ * @image: firmware-allocated handle that identifies the image
+ * @SystemTable: EFI system table
+ */
+EFI_STATUS
+efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systemTable)
+{
+ UINTN index;
+ EFI_EVENT event = systemTable->ConIn->WaitForKey;
+
+// SIMPLE_INPUT_INTERFACE *conIn = systemTable->ConIn;
+ SIMPLE_TEXT_OUTPUT_INTERFACE *conOut = systemTable->ConOut;
+ conOut->OutputString(conOut, exampleText);
+
+ systemTable->BootServices->WaitForEvent(1, &event, &index);
+
+ return EFI_SUCCESS;
+}

############################################################################

Commit: 6c5d6330ab7424d63fc064926b6e2487e2fdb10d
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Thu Aug 29 19:50:18 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:15:26 2015 UTC

As I understand MakeLocateDebug should be used on haiku.efi

This causes haiku.efi to be built in the right directory.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/Jamfile
b/src/system/boot/platform/efi/Jamfile
index e199e58..15dcfb0 100644
--- a/src/system/boot/platform/efi/Jamfile
+++ b/src/system/boot/platform/efi/Jamfile
@@ -45,6 +45,7 @@ rule EFIApplication {
local elfLibrary = $(2) ;

Depends $(efiApplication) : $(elfLibrary) ;
+ MakeLocateDebug $(efiApplication) ;
}

actions EFIApplication {

############################################################################

Commit: 0ec57d0203185a2b58a2ec31d57504a9ba3c2ce1
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Sep 7 12:48:04 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:18:17 2015 UTC

Use boot_loader_$(TARGET_BOOT_PLATFORM).ld naming for linker script.

As dictated in system/boot/Jamfile.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/Jamfile
b/src/system/boot/platform/efi/Jamfile
index 15dcfb0..1c6f3db 100644
--- a/src/system/boot/platform/efi/Jamfile
+++ b/src/system/boot/platform/efi/Jamfile
@@ -36,7 +36,7 @@ BootMergeObject boot_platform_efi.o :

BootLd haiku_efi_bootloader.so
: boot_platform_efi.o
- : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/efi.ld
+ : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_efi.ld
: -Bsymbolic -shared -nostdlib -znocombreloc ;


@@ -56,6 +56,4 @@ actions EFIApplication {

EFIApplication haiku.efi : haiku_efi_bootloader.so ;

-#SEARCH on [ FGristFiles $(efi_boot_src) ] = [ FDirName $(HAIKU_TOP) src
system boot platform efi ] ;
SEARCH on [ FGristFiles $(efi_glue_src) ] = [ FDirName $(HAIKU_TOP) src
system boot platform efi arch $(TARGET_ARCH) ] ;
-SEARCH on [ FGristFiles $(genericPlatformSources) ] = [ FDirName $(HAIKU_TOP)
src system boot platform generic ] ;
diff --git a/src/system/ldscripts/x86_64/efi.ld
b/src/system/ldscripts/x86_64/boot_loader_efi.ld
similarity index 100%
rename from src/system/ldscripts/x86_64/efi.ld
rename to src/system/ldscripts/x86_64/boot_loader_efi.ld

############################################################################

Commit: a5586cdc695eab6aff9712cfb428688f6590126c
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sun Sep 8 11:10:50 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:18:23 2015 UTC

Added simple calloc implementation.

Needed for HashMap.

----------------------------------------------------------------------------

diff --git a/src/system/boot/loader/heap.cpp b/src/system/boot/loader/heap.cpp
index dcf3269..35af269 100644
--- a/src/system/boot/loader/heap.cpp
+++ b/src/system/boot/loader/heap.cpp
@@ -500,6 +500,24 @@ malloc(size_t size)


void*
+calloc(size_t numElements, size_t size)
+{
+ size_t numBytes = numElements * size;
+ if (numBytes == 0)
+ numBytes = 1;
+
+ void* allocated = malloc(numBytes);
+ if (allocated == NULL)
+ return NULL;
+
+ for (size_t i = 0; i < numBytes; i++)
+ ((uint8*) allocated)[i] = 0;
+
+ return allocated;
+}
+
+
+void*
realloc(void* oldBuffer, size_t newSize)
{
if (newSize == 0) {

############################################################################

Commit: 2c70980fd68a99084e1e921505c4abf9a3f6d75b
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sun Sep 8 11:22:29 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:18:29 2015 UTC

Don't use partition pointer as id, as it only works on 32bit platforms.

Use a counter to generate the partition id, and store the id to partition
lookup in a hashmap instead.

----------------------------------------------------------------------------

diff --git a/src/system/boot/loader/partitions.cpp
b/src/system/boot/loader/partitions.cpp
index f70bc8a..8221fdd 100644
--- a/src/system/boot/loader/partitions.cpp
+++ b/src/system/boot/loader/partitions.cpp
@@ -16,6 +16,7 @@
#include <boot/stdio.h>
#include <boot/vfs.h>
#include <ddm_modules.h>
+#include <HashMap.h>

#include "RootFileSystem.h"

@@ -99,6 +100,10 @@ private:
};


+static vint32 idCounter = 0;
+static HashMap<HashKey32<int32>, Partition*> idPartitionMap;
+
+
// #pragma mark -


@@ -111,7 +116,9 @@ Partition::Partition(int fd)
TRACE(("%p Partition::Partition\n", this));

memset((partition_data *)this, 0, sizeof(partition_data));
- id = (partition_id)this;
+
+ id = atomic_add(&idCounter, 1);
+ idPartitionMap.Put(id, this);

// it's safe to close the file
fFD = dup(fd);
@@ -132,6 +139,7 @@ Partition::~Partition()
child->SetParent(NULL);
}

+ idPartitionMap.Remove(id);
close(fFD);
}

@@ -469,8 +477,13 @@ partition_data *
create_child_partition(partition_id id, int32 index, off_t offset, off_t size,
partition_id childID)
{
- Partition &partition = *(Partition *)id;
- Partition *child = partition.AddChild();
+ Partition *partition = idPartitionMap.Get(id);
+ if (partition == NULL) {
+ dprintf("creating partition failed: could not find
partition.\n");
+ return NULL;
+ }
+
+ Partition *child = partition->AddChild();
if (child == NULL) {
dprintf("creating partition failed: no memory\n");
return NULL;
@@ -490,8 +503,6 @@ create_child_partition(partition_id id, int32 index, off_t
offset, off_t size,
partition_data *
get_child_partition(partition_id id, int32 index)
{
- //Partition &partition = *(Partition *)id;
-
// TODO: do we really have to implement this?
// The intel partition module doesn't really need this for our
mission...
TRACE(("get_child_partition(id = %lu, index = %ld)\n", id, index));
@@ -503,8 +514,11 @@ get_child_partition(partition_id id, int32 index)
partition_data *
get_parent_partition(partition_id id)
{
- Partition &partition = *(Partition *)id;
-
- return partition.Parent();
+ Partition *partition = idPartitionMap.Get(id);
+ if (partition == NULL) {
+ dprintf("could not find parent partition.\n");
+ return NULL;
+ }
+ return partition->Parent();
}


############################################################################

Commit: c4a8493a50a9f06565237edb588c6faa98f9aca4
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Mon Sep 9 09:52:55 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:18:35 2015 UTC

Fix, static variables get an 's' prefix.

----------------------------------------------------------------------------

diff --git a/src/system/boot/loader/partitions.cpp
b/src/system/boot/loader/partitions.cpp
index 8221fdd..9a5e3a0 100644
--- a/src/system/boot/loader/partitions.cpp
+++ b/src/system/boot/loader/partitions.cpp
@@ -100,8 +100,8 @@ private:
};


-static vint32 idCounter = 0;
-static HashMap<HashKey32<int32>, Partition*> idPartitionMap;
+static vint32 sIdCounter = 0;
+static HashMap<HashKey32<int32>, Partition*> sIdPartitionMap;


// #pragma mark -
@@ -117,8 +117,8 @@ Partition::Partition(int fd)

memset((partition_data *)this, 0, sizeof(partition_data));

- id = atomic_add(&idCounter, 1);
- idPartitionMap.Put(id, this);
+ id = atomic_add(&sIdCounter, 1);
+ sIdPartitionMap.Put(id, this);

// it's safe to close the file
fFD = dup(fd);
@@ -139,7 +139,7 @@ Partition::~Partition()
child->SetParent(NULL);
}

- idPartitionMap.Remove(id);
+ sIdPartitionMap.Remove(id);
close(fFD);
}

@@ -477,7 +477,7 @@ partition_data *
create_child_partition(partition_id id, int32 index, off_t offset, off_t size,
partition_id childID)
{
- Partition *partition = idPartitionMap.Get(id);
+ Partition *partition = sIdPartitionMap.Get(id);
if (partition == NULL) {
dprintf("creating partition failed: could not find
partition.\n");
return NULL;
@@ -514,7 +514,7 @@ get_child_partition(partition_id id, int32 index)
partition_data *
get_parent_partition(partition_id id)
{
- Partition *partition = idPartitionMap.Get(id);
+ Partition *partition = sIdPartitionMap.Get(id);
if (partition == NULL) {
dprintf("could not find parent partition.\n");
return NULL;

############################################################################

Commit: c74d2d4522c934cad236d7ebc8a3115e07a41f1c
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Mon Sep 9 09:53:46 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:18:40 2015 UTC

Use memset in calloc, return NULL on size or numElements == 0.

Posix states 'If either numElements or size is 0, then either a null pointer or
a
unique pointer value that can be successfully passed to free() shall be
returned.'

----------------------------------------------------------------------------

diff --git a/src/system/boot/loader/heap.cpp b/src/system/boot/loader/heap.cpp
index 35af269..8973ee6 100644
--- a/src/system/boot/loader/heap.cpp
+++ b/src/system/boot/loader/heap.cpp
@@ -504,16 +504,13 @@ calloc(size_t numElements, size_t size)
{
size_t numBytes = numElements * size;
if (numBytes == 0)
- numBytes = 1;
+ return NULL;

void* allocated = malloc(numBytes);
if (allocated == NULL)
return NULL;

- for (size_t i = 0; i < numBytes; i++)
- ((uint8*) allocated)[i] = 0;
-
- return allocated;
+ return memset(allocated, 0, numBytes);
}



############################################################################

Commit: 283314e2cad6dc0446f67c0d4e80c52ff15130b3
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Sep 14 11:09:37 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:23:16 2015 UTC

Only use 32 bit functions in boot on x86_64 if we are bios_ia32.

----------------------------------------------------------------------------

diff --git a/src/system/boot/arch/x86/Jamfile b/src/system/boot/arch/x86/Jamfile
index 0fd15d0..512128c 100644
--- a/src/system/boot/arch/x86/Jamfile
+++ b/src/system/boot/arch/x86/Jamfile
@@ -6,11 +6,11 @@ local kernelArchSources =
arch_elf.cpp
;

-local kernelArch32Sources =
+local kernelArchSpecificSources =
cpuid.S
;

-local kernelLibArchSources =
+local kernelLibArchSpecificSources =
arch_string.S
;

@@ -28,9 +28,18 @@ BootMergeObject boot_arch_$(TARGET_KERNEL_ARCH).o :

SEARCH on [ FGristFiles $(kernelArchSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch x86 ] ;
-SEARCH on [ FGristFiles $(kernelArch32Sources) ]
+
+if $(TARGET_ARCH) = x86_64 && TARGET_BOOT_PLATFORM != bios_ia32 {
+SEARCH on [ FGristFiles $(kernelArchSpecificSources) ]
+ = [ FDirName $(HAIKU_TOP) src system kernel arch x86 64 ] ;
+SEARCH on [ FGristFiles $(kernelLibArchSpecificSources) ]
+ = [ FDirName $(HAIKU_TOP) src system kernel lib arch x86_64 ] ;
+} else {
+SEARCH on [ FGristFiles $(kernelArchSpecificSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch x86 32 ] ;
-SEARCH on [ FGristFiles $(kernelLibArchSources) ]
+SEARCH on [ FGristFiles $(kernelLibArchSpecificSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel lib arch x86 ] ;
+}
+
SEARCH on [ FGristFiles $(librootOsArchSources) ]
= [ FDirName $(HAIKU_TOP) src system libroot os arch x86 ] ;

############################################################################

Commit: cc7186c3e1f6fa3699db85db95bf0ad0b7629bdc
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Fri Apr 24 09:24:51 2015 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:24:51 2015 UTC

Only set bios_ia32 flags for x86_64 if boot platform is bios_ia32.

----------------------------------------------------------------------------

diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules
index 81d137a..a9cdd96 100644
--- a/build/jam/ArchitectureRules
+++ b/build/jam/ArchitectureRules
@@ -274,7 +274,7 @@ rule KernelArchitectureSetup architecture
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB -
unused yet

case x86 :
- HAIKU_BOOT_PLATFORM = bios_ia32 ;
+ HAIKU_BOOT_PLATFORM ?= bios_ia32 ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
# offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
@@ -286,7 +286,7 @@ rule KernelArchitectureSetup architecture

case x86_64 :
# x86_64 completely shares the x86 bootloader.
- HAIKU_BOOT_PLATFORM = bios_ia32 ;
+ HAIKU_BOOT_PLATFORM ?= bios_ia32 ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
# offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
@@ -396,10 +396,12 @@ rule KernelArchitectureSetup architecture
HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
HAIKU_KERNEL_ADDON_LINKFLAGS += -z max-page-size=0x1000
;

- # Bootloader is 32-bit.
- HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
- HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
- HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
+ # BIOS Bootloader is 32-bit.
+ if $HAIKU_BOOT_PLATFORM = bios_ia32 {
+ HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
+ HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
+ HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
+ }
}

# warning flags

############################################################################

Commit: 424c5705d529c6d8282ace0ee2b7486e17185550
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Fri Apr 24 09:25:48 2015 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:25:48 2015 UTC

UEFI: platform headers

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/boot/platform/efi/arch/x86/efibind.h
b/headers/private/kernel/boot/platform/efi/arch/x86/efibind.h
new file mode 100644
index 0000000..7138716
--- /dev/null
+++ b/headers/private/kernel/boot/platform/efi/arch/x86/efibind.h
@@ -0,0 +1,284 @@
+/*++
+
+Copyright (c) 1998 Intel Corporation
+
+Module Name:
+
+ efefind.h
+
+Abstract:
+
+ EFI to compile bindings
+
+
+
+
+Revision History
+
+--*/
+
+#ifndef __GNUC__
+#pragma pack()
+#endif
+
+//
+// Basic int types of various widths
+//
+
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
+
+ // No ANSI C 1999/2000 stdint.h integer width declarations
+
+ #if defined(_MSC_EXTENSIONS)
+
+ // Use Microsoft C compiler integer width declarations
+
+ typedef unsigned __int64 uint64_t;
+ typedef __int64 int64_t;
+ typedef unsigned __int32 uint32_t;
+ typedef __int32 int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef char int8_t;
+ #elif defined(__GNUC__)
+ typedef int __attribute__((__mode__(__DI__))) int64_t;
+ typedef unsigned int __attribute__((__mode__(__DI__))) uint64_t;
+ typedef unsigned int uint32_t;
+ typedef int int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef signed char int8_t;
+ #elif defined(UNIX_LP64)
+
+ /* Use LP64 programming model from C_FLAGS for integer width
declarations */
+
+ typedef unsigned long uint64_t;
+ typedef long int64_t;
+ typedef unsigned int uint32_t;
+ typedef int int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef char int8_t;
+ #else
+
+ /* Assume P64 programming model from C_FLAGS for integer width
declarations */
+
+ typedef unsigned long long uint64_t __attribute__((aligned (8)));
+ typedef long long int64_t __attribute__((aligned (8)));
+ typedef unsigned int uint32_t;
+ typedef int int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef char int8_t;
+ #endif
+#elif defined(__GNUC__)
+ #include <stdint.h>
+#endif
+
+//
+// Basic EFI types of various widths
+//
+
+#ifndef __WCHAR_TYPE__
+# define __WCHAR_TYPE__ short
+#endif
+
+typedef uint64_t UINT64;
+typedef int64_t INT64;
+
+#ifndef _BASETSD_H_
+ typedef uint32_t UINT32;
+ typedef int32_t INT32;
+#endif
+
+typedef uint16_t UINT16;
+typedef int16_t INT16;
+typedef uint8_t UINT8;
+typedef int8_t INT8;
+typedef __WCHAR_TYPE__ WCHAR;
+
+#undef VOID
+#define VOID void
+
+
+typedef int32_t INTN;
+typedef uint32_t UINTN;
+
+#ifdef EFI_NT_EMULATOR
+ #define POST_CODE(_Data)
+#else
+ #ifdef EFI_DEBUG
+#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
+ #else
+ #define POST_CODE(_Data)
+ #endif
+#endif
+
+#define EFIERR(a) (0x80000000 | a)
+#define EFI_ERROR_MASK 0x80000000
+#define EFIERR_OEM(a) (0xc0000000 | a)
+
+
+#define BAD_POINTER 0xFBFBFBFB
+#define MAX_ADDRESS 0xFFFFFFFF
+
+#ifdef EFI_NT_EMULATOR
+ #define BREAKPOINT() __asm { int 3 }
+#else
+ #define BREAKPOINT() while (TRUE); // Make it hang on Bios[Dbg]32
+#endif
+
+//
+// Pointers must be aligned to these address to function
+//
+
+#define MIN_ALIGNMENT_SIZE 4
+
+#define ALIGN_VARIABLE(Value ,Adjustment) \
+ (UINTN)Adjustment = 0; \
+ if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
+ (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value %
MIN_ALIGNMENT_SIZE); \
+ Value = (UINTN)Value + (UINTN)Adjustment
+
+
+//
+// Define macros to build data structure signatures from characters.
+//
+
+#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
+#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) |
(EFI_SIGNATURE_16(C,D) << 16))
+#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) |
((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
+//
+// To export & import functions in the EFI emulator environment
+//
+
+#ifdef EFI_NT_EMULATOR
+ #define EXPORTAPI __declspec( dllexport )
+#else
+ #define EXPORTAPI
+#endif
+
+
+//
+// EFIAPI - prototype calling convention for EFI function pointers
+// BOOTSERVICE - prototype for implementation of a boot service interface
+// RUNTIMESERVICE - prototype for implementation of a runtime service interface
+// RUNTIMEFUNCTION - prototype for implementation of a runtime function that
is not a service
+// RUNTIME_CODE - pragma macro for declaring runtime code
+//
+
+#ifndef EFIAPI // Forces EFI calling conventions reguardless
of compiler options
+ #ifdef _MSC_EXTENSIONS
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C
compiler
+ #else
+ #define EFIAPI // Substitute expresion to force C calling
convention
+ #endif
+#endif
+
+#define BOOTSERVICE
+//#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a
+//#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a
+#define RUNTIMESERVICE
+#define RUNTIMEFUNCTION
+
+
+#define RUNTIME_CODE(a) alloc_text("rtcode", a)
+#define BEGIN_RUNTIME_DATA() data_seg("rtdata")
+#define END_RUNTIME_DATA() data_seg("")
+
+#define VOLATILE volatile
+
+#define MEMORY_FENCE()
+
+#ifdef EFI_NT_EMULATOR
+
+//
+// To help ensure proper coding of integrated drivers, they are
+// compiled as DLLs. In NT they require a dll init entry pointer.
+// The macro puts a stub entry point into the DLL so it will load.
+//
+
+#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
+ UINTN \
+ __stdcall \
+ _DllMainCRTStartup ( \
+ UINTN Inst, \
+ UINTN reason_for_call, \
+ VOID *rserved \
+ ) \
+ { \
+ return 1; \
+ } \
+ \
+ int \
+ EXPORTAPI \
+ __cdecl \
+ InitializeDriver ( \
+ void *ImageHandle, \
+ void *SystemTable \
+ ) \
+ { \
+ return InitFunction(ImageHandle, SystemTable); \
+ }
+
+
+ #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
+ (_if)->LoadInternal(type, name, NULL)
+
+#else // EFI_NT_EMULATOR
+
+//
+// When build similiar to FW, then link everything together as
+// one big module.
+//
+
+ #define EFI_DRIVER_ENTRY_POINT(InitFunction) \
+ UINTN \
+ InitializeDriver ( \
+ VOID *ImageHandle, \
+ VOID *SystemTable \
+ ) \
+ { \
+ return InitFunction(ImageHandle, \
+ SystemTable); \
+ } \
+ \
+ EFI_STATUS efi_main( \
+ EFI_HANDLE image, \
+ EFI_SYSTEM_TABLE *systab \
+ ) __attribute__((weak, \
+ alias ("InitializeDriver")));
+
+ #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
+ (_if)->LoadInternal(type, name, entry)
+
+#endif // EFI_FW_NT
+
+//
+// Some compilers don't support the forward reference construct:
+// typedef struct XXXXX
+//
+// The following macro provide a workaround for such cases.
+//
+#ifdef NO_INTERFACE_DECL
+#define INTERFACE_DECL(x)
+#else
+#ifdef __GNUC__
+#define INTERFACE_DECL(x) struct x
+#else
+#define INTERFACE_DECL(x) typedef struct x
+#endif
+#endif
+
+/* No efi call wrapper for IA32 architecture */
+#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
+#define EFI_FUNCTION
+
+#ifdef _MSC_EXTENSIONS
+#pragma warning ( disable : 4731 ) // Suppress warnings about modification of
EBP
+#endif
+
diff --git a/headers/private/kernel/boot/platform/efi/arch/x86/pe.h
b/headers/private/kernel/boot/platform/efi/arch/x86/pe.h
new file mode 100644
index 0000000..624fa09
--- /dev/null
+++ b/headers/private/kernel/boot/platform/efi/arch/x86/pe.h
@@ -0,0 +1,595 @@
+/*
+ PE32+ header file
+ */
+#ifndef _PE_H
+#define _PE_H
+
+#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
+#define IMAGE_OS2_SIGNATURE 0x454E // NE
+#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
+#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
+#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
+
+
+typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header
+ UINT16 e_magic; // Magic number
+ UINT16 e_cblp; // Bytes on last page of file
+ UINT16 e_cp; // Pages in file
+ UINT16 e_crlc; // Relocations
+ UINT16 e_cparhdr; // Size of header in paragraphs
+ UINT16 e_minalloc; // Minimum extra paragraphs needed
+ UINT16 e_maxalloc; // Maximum extra paragraphs needed
+ UINT16 e_ss; // Initial (relative) SS value
+ UINT16 e_sp; // Initial SP value
+ UINT16 e_csum; // Checksum
+ UINT16 e_ip; // Initial IP value
+ UINT16 e_cs; // Initial (relative) CS value
+ UINT16 e_lfarlc; // File address of relocation table
+ UINT16 e_ovno; // Overlay number
+ UINT16 e_res[4]; // Reserved words
+ UINT16 e_oemid; // OEM identifier (for e_oeminfo)
+ UINT16 e_oeminfo; // OEM information; e_oemid specific
+ UINT16 e_res2[10]; // Reserved words
+ UINT32 e_lfanew; // File address of new exe header
+ } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
+
+typedef struct _IMAGE_OS2_HEADER { // OS/2 .EXE header
+ UINT16 ne_magic; // Magic number
+ UINT8 ne_ver; // Version number
+ UINT8 ne_rev; // Revision number
+ UINT16 ne_enttab; // Offset of Entry Table
+ UINT16 ne_cbenttab; // Number of bytes in Entry Table
+ UINT32 ne_crc; // Checksum of whole file
+ UINT16 ne_flags; // Flag UINT16
+ UINT16 ne_autodata; // Automatic data segment number
+ UINT16 ne_heap; // Initial heap allocation
+ UINT16 ne_stack; // Initial stack allocation
+ UINT32 ne_csip; // Initial CS:IP setting
+ UINT32 ne_sssp; // Initial SS:SP setting
+ UINT16 ne_cseg; // Count of file segments
+ UINT16 ne_cmod; // Entries in Module Reference Table
+ UINT16 ne_cbnrestab; // Size of non-resident name table
+ UINT16 ne_segtab; // Offset of Segment Table
+ UINT16 ne_rsrctab; // Offset of Resource Table
+ UINT16 ne_restab; // Offset of resident name table
+ UINT16 ne_modtab; // Offset of Module Reference Table
+ UINT16 ne_imptab; // Offset of Imported Names Table
+ UINT32 ne_nrestab; // Offset of Non-resident Names Table
+ UINT16 ne_cmovent; // Count of movable entries
+ UINT16 ne_align; // Segment alignment shift count
+ UINT16 ne_cres; // Count of resource segments
+ UINT8 ne_exetyp; // Target Operating system
+ UINT8 ne_flagsothers; // Other .EXE flags
+ UINT16 ne_pretthunks; // offset to return thunks
+ UINT16 ne_psegrefbytes; // offset to segment ref. bytes
+ UINT16 ne_swaparea; // Minimum code swap area size
+ UINT16 ne_expver; // Expected Windows version number
+ } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER;
+
+//
+// File header format.
+//
+
+typedef struct _IMAGE_FILE_HEADER {
+ UINT16 Machine;
+ UINT16 NumberOfSections;
+ UINT32 TimeDateStamp;
+ UINT32 PointerToSymbolTable;
+ UINT32 NumberOfSymbols;
+ UINT16 SizeOfOptionalHeader;
+ UINT16 Characteristics;
+} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
+
+#define IMAGE_SIZEOF_FILE_HEADER 20
+
+#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info
stripped from file.
+#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable
(i.e. no unresolved externel references).
+#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped
from file.
+#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped
from file.
+#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word
are reversed.
+#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
+#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info
stripped from file in .DBG file
+#define IMAGE_FILE_SYSTEM 0x1000 // System File.
+#define IMAGE_FILE_DLL 0x2000 // File is a DLL.
+#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word
are reversed.
+
+#define IMAGE_FILE_MACHINE_UNKNOWN 0
+#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
+#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian,
0540 big-endian
+#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian
+#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP
+#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x1c2 // Arm/Thumb
+#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC
Little-Endian
+#define IMAGE_FILE_MACHINE_IA64 0x200 // IA-64
+#define IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
+#define IMAGE_FILE_MACHINE_EBC 0xebc // EFI Byte Code
+#define IMAGE_FILE_MACHINE_X64 0x8664 // x86_64
+//
+// Directory format.
+//
+
+typedef struct _IMAGE_DATA_DIRECTORY {
+ UINT32 VirtualAddress;
+ UINT32 Size;
+} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
+
+#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
+
+//
+// Optional header format.
+//
+
+typedef struct _IMAGE_OPTIONAL_HEADER {
+ //
+ // Standard fields.
+ //
+
+ UINT16 Magic;
+ UINT8 MajorLinkerVersion;
+ UINT8 MinorLinkerVersion;
+ UINT32 SizeOfCode;
+ UINT32 SizeOfInitializedData;
+ UINT32 SizeOfUninitializedData;
+ UINT32 AddressOfEntryPoint;
+ UINT32 BaseOfCode;
+ UINT32 BaseOfData;
+
+ //
+ // NT additional fields.
+ //
+
+ UINT32 ImageBase;
+ UINT32 SectionAlignment;
+ UINT32 FileAlignment;
+ UINT16 MajorOperatingSystemVersion;
+ UINT16 MinorOperatingSystemVersion;
+ UINT16 MajorImageVersion;
+ UINT16 MinorImageVersion;
+ UINT16 MajorSubsystemVersion;
+ UINT16 MinorSubsystemVersion;
+ UINT32 Reserved1;
+ UINT32 SizeOfImage;
+ UINT32 SizeOfHeaders;
+ UINT32 CheckSum;
+ UINT16 Subsystem;
+ UINT16 DllCharacteristics;
+ UINT32 SizeOfStackReserve;
+ UINT32 SizeOfStackCommit;
+ UINT32 SizeOfHeapReserve;
+ UINT32 SizeOfHeapCommit;
+ UINT32 LoaderFlags;
+ UINT32 NumberOfRvaAndSizes;
+ IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
+} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
+
+typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
+ UINT16 Magic;
+ UINT8 MajorLinkerVersion;
+ UINT8 MinorLinkerVersion;
+ UINT32 SizeOfCode;
+ UINT32 SizeOfInitializedData;
+ UINT32 SizeOfUninitializedData;
+ UINT32 AddressOfEntryPoint;
+ UINT32 BaseOfCode;
+ UINT32 BaseOfData;
+ UINT32 BaseOfBss;
+ UINT32 GprMask;
+ UINT32 CprMask[4];
+ UINT32 GpValue;
+} IMAGE_ROM_OPTIONAL_HEADER, *PIMAGE_ROM_OPTIONAL_HEADER;
+
+#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
+#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
+#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
+
+#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
+#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
+
+typedef struct _IMAGE_NT_HEADERS {
+ UINT32 Signature;
+ IMAGE_FILE_HEADER FileHeader;
+ IMAGE_OPTIONAL_HEADER OptionalHeader;
+} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
+
+typedef struct _IMAGE_ROM_HEADERS {
+ IMAGE_FILE_HEADER FileHeader;
+ IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
+} IMAGE_ROM_HEADERS, *PIMAGE_ROM_HEADERS;
+
+#define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \
+ ((UINT32)ntheader + \
+ FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \
+ ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader \
+ ))
+
+
+// Subsystem Values
+
+#define IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem.
+#define IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a
subsystem.
+#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows
GUI subsystem.
+#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows
character subsystem.
+#define IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2
character subsystem.
+#define IMAGE_SUBSYSTEM_POSIX_CUI 7 // image run in the Posix
character subsystem.
+
+
+// Directory Entries
+
+#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
+#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
+#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
+#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory
+#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory
+#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table
+#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory
+#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String
+#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP)
+#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory
+#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration
Directory
+
+//
+// Section header format.
+//
+
+#define IMAGE_SIZEOF_SHORT_NAME 8
+
+typedef struct _IMAGE_SECTION_HEADER {
+ UINT8 Name[IMAGE_SIZEOF_SHORT_NAME];
+ union {
+ UINT32 PhysicalAddress;
+ UINT32 VirtualSize;
+ } Misc;
+ UINT32 VirtualAddress;
+ UINT32 SizeOfRawData;
+ UINT32 PointerToRawData;
+ UINT32 PointerToRelocations;
+ UINT32 PointerToLinenumbers;
+ UINT16 NumberOfRelocations;
+ UINT16 NumberOfLinenumbers;
+ UINT32 Characteristics;
+} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
+
+#define IMAGE_SIZEOF_SECTION_HEADER 40
+
+#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
+
+#define IMAGE_SCN_CNT_CODE 0x00000020 // Section contains
code.
+#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains
initialized data.
+#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains
uninitialized data.
+
+#define IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
+#define IMAGE_SCN_LNK_INFO 0x00000200 // Section contains
comments or some other type of information.
+#define IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents
will not become part of image.
+#define IMAGE_SCN_LNK_COMDAT 0x00001000 // Section contents
comdat.
+
+#define IMAGE_SCN_ALIGN_1BYTES 0x00100000 //
+#define IMAGE_SCN_ALIGN_2BYTES 0x00200000 //
+#define IMAGE_SCN_ALIGN_4BYTES 0x00300000 //
+#define IMAGE_SCN_ALIGN_8BYTES 0x00400000 //
+#define IMAGE_SCN_ALIGN_16BYTES 0x00500000 // Default alignment
if no others are specified.
+#define IMAGE_SCN_ALIGN_32BYTES 0x00600000 //
+#define IMAGE_SCN_ALIGN_64BYTES 0x00700000 //
+
+#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 // Section can be
discarded.
+#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 // Section is not
cachable.
+#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 // Section is not
pageable.
+#define IMAGE_SCN_MEM_SHARED 0x10000000 // Section is
shareable.
+#define IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is
executable.
+#define IMAGE_SCN_MEM_READ 0x40000000 // Section is
readable.
+#define IMAGE_SCN_MEM_WRITE 0x80000000 // Section is
writeable.
+
+//
+// Symbol format.
+//
+
+
+#define IMAGE_SIZEOF_SYMBOL 18
+
+//
+// Section values.
+//
+// Symbols have a section number of the section in which they are
+// defined. Otherwise, section numbers have the following meanings:
+//
+
+#define IMAGE_SYM_UNDEFINED (UINT16)0 // Symbol is
undefined or is common.
+#define IMAGE_SYM_ABSOLUTE (UINT16)-1 // Symbol is an
absolute value.
+#define IMAGE_SYM_DEBUG (UINT16)-2 // Symbol is a
special debug item.
+
+//
+// Type (fundamental) values.
+//
+
+#define IMAGE_SYM_TYPE_NULL 0 // no type.
+#define IMAGE_SYM_TYPE_VOID 1 //
+#define IMAGE_SYM_TYPE_CHAR 2 // type character.
+#define IMAGE_SYM_TYPE_SHORT 3 // type short integer.
+#define IMAGE_SYM_TYPE_INT 4 //
+#define IMAGE_SYM_TYPE_LONG 5 //
+#define IMAGE_SYM_TYPE_FLOAT 6 //
+#define IMAGE_SYM_TYPE_DOUBLE 7 //
+#define IMAGE_SYM_TYPE_STRUCT 8 //
+#define IMAGE_SYM_TYPE_UNION 9 //
+#define IMAGE_SYM_TYPE_ENUM 10 // enumeration.
+#define IMAGE_SYM_TYPE_MOE 11 // member of
enumeration.
+#define IMAGE_SYM_TYPE_BYTE 12 //
+#define IMAGE_SYM_TYPE_WORD 13 //
+#define IMAGE_SYM_TYPE_UINT 14 //
+#define IMAGE_SYM_TYPE_DWORD 15 //
+
+//
+// Type (derived) values.
+//
+
+#define IMAGE_SYM_DTYPE_NULL 0 // no derived type.
+#define IMAGE_SYM_DTYPE_POINTER 1 // pointer.
+#define IMAGE_SYM_DTYPE_FUNCTION 2 // function.
+#define IMAGE_SYM_DTYPE_ARRAY 3 // array.
+
+//
+// Storage classes.
+//
+
+#define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
+#define IMAGE_SYM_CLASS_NULL 0
+#define IMAGE_SYM_CLASS_AUTOMATIC 1
+#define IMAGE_SYM_CLASS_EXTERNAL 2
+#define IMAGE_SYM_CLASS_STATIC 3
+#define IMAGE_SYM_CLASS_REGISTER 4
+#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
+#define IMAGE_SYM_CLASS_LABEL 6
+#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
+#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
+#define IMAGE_SYM_CLASS_ARGUMENT 9
+#define IMAGE_SYM_CLASS_STRUCT_TAG 10
+#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
+#define IMAGE_SYM_CLASS_UNION_TAG 12
+#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
+#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
+#define IMAGE_SYM_CLASS_ENUM_TAG 15
+#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
+#define IMAGE_SYM_CLASS_REGISTER_PARAM 17
+#define IMAGE_SYM_CLASS_BIT_FIELD 18
+#define IMAGE_SYM_CLASS_BLOCK 100
+#define IMAGE_SYM_CLASS_FUNCTION 101
+#define IMAGE_SYM_CLASS_END_OF_STRUCT 102
+#define IMAGE_SYM_CLASS_FILE 103
+// new
+#define IMAGE_SYM_CLASS_SECTION 104
+#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
+
+// type packing constants
+
+#define N_BTMASK 017
+#define N_TMASK 060
+#define N_TMASK1 0300
+#define N_TMASK2 0360
+#define N_BTSHFT 4
+#define N_TSHIFT 2
+
+// MACROS
+
+//
+// Communal selection types.
+//
+
+#define IMAGE_COMDAT_SELECT_NODUPLICATES 1
+#define IMAGE_COMDAT_SELECT_ANY 2
+#define IMAGE_COMDAT_SELECT_SAME_SIZE 3
+#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
+#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
+
+#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
+#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
+#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
+
+
+//
+// Relocation format.
+//
+
+typedef struct _IMAGE_RELOCATION {
+ UINT32 VirtualAddress;
+ UINT32 SymbolTableIndex;
+ UINT16 Type;
+} IMAGE_RELOCATION;
+
+#define IMAGE_SIZEOF_RELOCATION 10
+
+//
+// I386 relocation types.
+//
+
+#define IMAGE_REL_I386_ABSOLUTE 0 // Reference is
absolute, no relocation is necessary
+#define IMAGE_REL_I386_DIR16 01 // Direct 16-bit
reference to the symbols virtual address
+#define IMAGE_REL_I386_REL16 02 // PC-relative 16-bit
reference to the symbols virtual address
+#define IMAGE_REL_I386_DIR32 06 // Direct 32-bit
reference to the symbols virtual address
+#define IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit
reference to the symbols virtual address, base not included
+#define IMAGE_REL_I386_SEG12 011 // Direct 16-bit
reference to the segment-selector bits of a 32-bit virtual address
+#define IMAGE_REL_I386_SECTION 012
+#define IMAGE_REL_I386_SECREL 013
+#define IMAGE_REL_I386_REL32 024 // PC-relative 32-bit
reference to the symbols virtual address
+
+//
+// MIPS relocation types.
+//
+
+#define IMAGE_REL_MIPS_ABSOLUTE 0 // Reference is
absolute, no relocation is necessary
+#define IMAGE_REL_MIPS_REFHALF 01
+#define IMAGE_REL_MIPS_REFWORD 02
+#define IMAGE_REL_MIPS_JMPADDR 03
+#define IMAGE_REL_MIPS_REFHI 04
+#define IMAGE_REL_MIPS_REFLO 05
+#define IMAGE_REL_MIPS_GPREL 06
+#define IMAGE_REL_MIPS_LITERAL 07
+#define IMAGE_REL_MIPS_SECTION 012
+#define IMAGE_REL_MIPS_SECREL 013
+#define IMAGE_REL_MIPS_REFWORDNB 042
+#define IMAGE_REL_MIPS_PAIR 045
+
+//
+// Alpha Relocation types.
+//
+
+#define IMAGE_REL_ALPHA_ABSOLUTE 0x0
+#define IMAGE_REL_ALPHA_REFLONG 0x1
+#define IMAGE_REL_ALPHA_REFQUAD 0x2
+#define IMAGE_REL_ALPHA_GPREL32 0x3
+#define IMAGE_REL_ALPHA_LITERAL 0x4
+#define IMAGE_REL_ALPHA_LITUSE 0x5
+#define IMAGE_REL_ALPHA_GPDISP 0x6
+#define IMAGE_REL_ALPHA_BRADDR 0x7
+#define IMAGE_REL_ALPHA_HINT 0x8
+#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x9
+#define IMAGE_REL_ALPHA_REFHI 0xA
+#define IMAGE_REL_ALPHA_REFLO 0xB
+#define IMAGE_REL_ALPHA_PAIR 0xC
+#define IMAGE_REL_ALPHA_MATCH 0xD
+#define IMAGE_REL_ALPHA_SECTION 0xE
+#define IMAGE_REL_ALPHA_SECREL 0xF
+#define IMAGE_REL_ALPHA_REFLONGNB 0x10
+
+//
+// IBM PowerPC relocation types.
+//
+
+#define IMAGE_REL_PPC_ABSOLUTE 0x0000 // NOP
+#define IMAGE_REL_PPC_ADDR64 0x0001 // 64-bit address
+#define IMAGE_REL_PPC_ADDR32 0x0002 // 32-bit address
+#define IMAGE_REL_PPC_ADDR24 0x0003 // 26-bit address, shifted left 2
(branch absolute)
+#define IMAGE_REL_PPC_ADDR16 0x0004 // 16-bit address
+#define IMAGE_REL_PPC_ADDR14 0x0005 // 16-bit address, shifted left 2 (load
doubleword)
+#define IMAGE_REL_PPC_REL24 0x0006 // 26-bit PC-relative offset, shifted
left 2 (branch relative)
+#define IMAGE_REL_PPC_REL14 0x0007 // 16-bit PC-relative offset, shifted
left 2 (br cond relative)
+#define IMAGE_REL_PPC_TOCREL16 0x0008 // 16-bit offset from TOC base
+#define IMAGE_REL_PPC_TOCREL14 0x0009 // 16-bit offset from TOC base, shifted
left 2 (load doubleword)
+
+#define IMAGE_REL_PPC_ADDR32NB 0x000A // 32-bit addr w/o image base
+#define IMAGE_REL_PPC_SECREL 0x000B // va of containing section (as in an
image sectionhdr)
+#define IMAGE_REL_PPC_SECTION 0x000C // sectionheader number
+#define IMAGE_REL_PPC_IFGLUE 0x000D // substitute TOC restore instruction
iff symbol is glue code
+#define IMAGE_REL_PPC_IMGLUE 0x000E // symbol is glue code; virtual address
is TOC restore instruction
+
+#define IMAGE_REL_PPC_TYPEMASK 0x00FF // mask to isolate above values in
IMAGE_RELOCATION.Type
+
+// Flag bits in IMAGE_RELOCATION.TYPE
+
+#define IMAGE_REL_PPC_NEG 0x0100 // subtract reloc value rather than
adding it
+#define IMAGE_REL_PPC_BRTAKEN 0x0200 // fix branch prediction bit to predict
branch taken
+#define IMAGE_REL_PPC_BRNTAKEN 0x0400 // fix branch prediction bit to predict
branch not taken
+#define IMAGE_REL_PPC_TOCDEFN 0x0800 // toc slot defined in file (or, data
in toc)
+
+//
+// Based relocation format.
+//
+
+typedef struct _IMAGE_BASE_RELOCATION {
+ UINT32 VirtualAddress;
+ UINT32 SizeOfBlock;
+// UINT16 TypeOffset[1];
+} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION;
+
+#define IMAGE_SIZEOF_BASE_RELOCATION 8
+
+//
+// Based relocation types.
+//
+
+#define IMAGE_REL_BASED_ABSOLUTE 0
+#define IMAGE_REL_BASED_HIGH 1
+#define IMAGE_REL_BASED_LOW 2
+#define IMAGE_REL_BASED_HIGHLOW 3
+#define IMAGE_REL_BASED_HIGHADJ 4
+#define IMAGE_REL_BASED_MIPS_JMPADDR 5
+#define IMAGE_REL_BASED_IA64_IMM64 9
+#define IMAGE_REL_BASED_DIR64 10
+
+//
+// Line number format.
+//
+
+typedef struct _IMAGE_LINENUMBER {
+ union {
+ UINT32 SymbolTableIndex; // Symbol table index of
function name if Linenumber is 0.
+ UINT32 VirtualAddress; // Virtual address of line
number.
+ } Type;
+ UINT16 Linenumber; // Line number.
+} IMAGE_LINENUMBER;
+
+#define IMAGE_SIZEOF_LINENUMBER 6
+
+//
+// Archive format.
+//
+
+#define IMAGE_ARCHIVE_START_SIZE 8
+#define IMAGE_ARCHIVE_START "!<arch>\n"
+#define IMAGE_ARCHIVE_END "`\n"
+#define IMAGE_ARCHIVE_PAD "\n"
+#define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
+#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
+
+typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER {
+ UINT8 Name[16]; // File member name - `/'
terminated.
+ UINT8 Date[12]; // File member date - decimal.
+ UINT8 UserID[6]; // File member user id -
decimal.
+ UINT8 GroupID[6]; // File member group id -
decimal.
+ UINT8 Mode[8]; // File member mode - octal.
+ UINT8 Size[10]; // File member size - decimal.
+ UINT8 EndHeader[2]; // String to end header.
+} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;
+
+#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
+
+//
+// DLL support.
+//
+
+//
+// Export Format
+//
+
+typedef struct _IMAGE_EXPORT_DIRECTORY {
+ UINT32 Characteristics;
+ UINT32 TimeDateStamp;
+ UINT16 MajorVersion;
+ UINT16 MinorVersion;
+ UINT32 Name;
+ UINT32 Base;
+ UINT32 NumberOfFunctions;
+ UINT32 NumberOfNames;
+ UINT32 *AddressOfFunctions;
+ UINT32 *AddressOfNames;
+ UINT32 *AddressOfNameOrdinals;
+} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY;
+
+//
+// Import Format
+//
+
+typedef struct _IMAGE_IMPORT_BY_NAME {
+ UINT16 Hint;
+ UINT8 Name[1];
+} IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME;
+
+typedef struct _IMAGE_THUNK_DATA {
+ union {
+ UINT32 Function;
+ UINT32 Ordinal;
+ PIMAGE_IMPORT_BY_NAME AddressOfData;
+ } u1;
+} IMAGE_THUNK_DATA, *PIMAGE_THUNK_DATA;
+
+#define IMAGE_ORDINAL_FLAG 0x80000000
+#define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
+#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
+
+typedef struct _IMAGE_IMPORT_DESCRIPTOR {
+ UINT32 Characteristics;
+ UINT32 TimeDateStamp;
+ UINT32 ForwarderChain;
+ UINT32 Name;
+ PIMAGE_THUNK_DATA FirstThunk;
+} IMAGE_IMPORT_DESCRIPTOR, *PIMAGE_IMPORT_DESCRIPTOR;
+
+#endif
diff --git a/headers/private/kernel/boot/platform/efi/arch/x86_64/efibind.h
b/headers/private/kernel/boot/platform/efi/arch/x86_64/efibind.h
new file mode 100644
index 0000000..e258534
--- /dev/null
+++ b/headers/private/kernel/boot/platform/efi/arch/x86_64/efibind.h
@@ -0,0 +1,380 @@
+/*++
+
+Copyright (c) 1998 Intel Corporation
+
+Module Name:
+
+ efefind.h
+
+Abstract:
+
+ EFI to compile bindings
+
+
+
+
+Revision History
+
+--*/
+#ifndef X86_64_EFI_BIND
+#define X86_64_EFI_BIND
+#ifndef __GNUC__
+#pragma pack()
+#endif
+
+#if defined(GNU_EFI_USE_MS_ABI)
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__

= 7))
+ #define HAVE_USE_MS_ABI 1
+ #else
+ #error Compiler is too old for GNU_EFI_USE_MS_ABI
+ #endif
+#endif
+
+//
+// Basic int types of various widths
+//
+
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
+
+ // No ANSI C 1999/2000 stdint.h integer width declarations
+
+ #if defined(_MSC_EXTENSIONS)
+
+ // Use Microsoft C compiler integer width declarations
+
+ typedef unsigned __int64 uint64_t;
+ typedef __int64 int64_t;
+ typedef unsigned __int32 uint32_t;
+ typedef __int32 int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef char int8_t;
+ #elif defined(__GNUC__)
+ typedef int __attribute__((__mode__(__DI__))) int64_t;
+ typedef unsigned int __attribute__((__mode__(__DI__))) uint64_t;
+ typedef unsigned int uint32_t;
+ typedef int int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef signed char int8_t;
+ #elif defined(UNIX_LP64)
+
+ /* Use LP64 programming model from C_FLAGS for integer width
declarations */
+
+ typedef unsigned long uint64_t;
+ typedef long int64_t;
+ typedef unsigned int uint32_t;
+ typedef int int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef char int8_t;
+ #else
+
+ /* Assume P64 programming model from C_FLAGS for integer width
declarations */
+
+ typedef unsigned long long uint64_t __attribute__((aligned (8)));
+ typedef long long int64_t __attribute__((aligned (8)));
+ typedef unsigned int uint32_t;
+ typedef int int32_t;
+ typedef unsigned short uint16_t;
+ typedef short int16_t;
+ typedef unsigned char uint8_t;
+ typedef char int8_t;
+ #endif
+#elif defined(__GNUC__)
+ #include <stdint.h>
+#endif
+
+//
+// Basic EFI types of various widths
+//
+
+#ifndef __WCHAR_TYPE__
+# define __WCHAR_TYPE__ short
+#endif
+
+typedef uint64_t UINT64;
+typedef int64_t INT64;
+
+#ifndef _BASETSD_H_
+ typedef uint32_t UINT32;
+ typedef int32_t INT32;
+#endif
+
+typedef uint16_t UINT16;
+typedef int16_t INT16;
+typedef uint8_t UINT8;
+typedef int8_t INT8;
+typedef __WCHAR_TYPE__ WCHAR;
+
+#undef VOID
+#define VOID void
+
+
+typedef int64_t INTN;
+typedef uint64_t UINTN;
+
+#ifdef EFI_NT_EMULATOR
+ #define POST_CODE(_Data)
+#else
+ #ifdef EFI_DEBUG
+#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
+ #else
+ #define POST_CODE(_Data)
+ #endif
+#endif
+
+#define EFIERR(a) (0x8000000000000000 | a)
+#define EFI_ERROR_MASK 0x8000000000000000
+#define EFIERR_OEM(a) (0xc000000000000000 | a)
+
+
+#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
+#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
+
+#ifdef EFI_NT_EMULATOR
+ #define BREAKPOINT() __asm { int 3 }
+#else
+ #define BREAKPOINT() while (TRUE); // Make it hang on Bios[Dbg]32
+#endif
+
+//
+// Pointers must be aligned to these address to function
+//
+
+#define MIN_ALIGNMENT_SIZE 4
+
+#define ALIGN_VARIABLE(Value ,Adjustment) \
+ (UINTN)Adjustment = 0; \
+ if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
+ (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value %
MIN_ALIGNMENT_SIZE); \
+ Value = (UINTN)Value + (UINTN)Adjustment
+
+
+//
+// Define macros to build data structure signatures from characters.
+//
+
+#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
+#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) |
(EFI_SIGNATURE_16(C,D) << 16))
+#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) |
((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
+//
+// To export & import functions in the EFI emulator environment
+//
+
+#ifdef EFI_NT_EMULATOR
+ #define EXPORTAPI __declspec( dllexport )
+#else
+ #define EXPORTAPI
+#endif
+
+
+//
+// EFIAPI - prototype calling convention for EFI function pointers
+// BOOTSERVICE - prototype for implementation of a boot service interface
+// RUNTIMESERVICE - prototype for implementation of a runtime service interface
+// RUNTIMEFUNCTION - prototype for implementation of a runtime function that
is not a service
+// RUNTIME_CODE - pragma macro for declaring runtime code
+//
+
+#ifndef EFIAPI // Forces EFI calling conventions reguardless
of compiler options
+ #ifdef _MSC_EXTENSIONS
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C
compiler
+ #elif defined(HAVE_USE_MS_ABI)
+ // Force amd64/ms calling conventions.
+ #define EFIAPI __attribute__((ms_abi))
+ #else
+ #define EFIAPI // Substitute expresion to force C calling
convention
+ #endif
+#endif
+
+#define BOOTSERVICE
+//#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a
+//#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a
+#define RUNTIMESERVICE
+#define RUNTIMEFUNCTION
+
+
+#define RUNTIME_CODE(a) alloc_text("rtcode", a)
+#define BEGIN_RUNTIME_DATA() data_seg("rtdata")
+#define END_RUNTIME_DATA() data_seg("")
+
+#define VOLATILE volatile
+
+#define MEMORY_FENCE()
+
+#ifdef EFI_NT_EMULATOR
+
+//
+// To help ensure proper coding of integrated drivers, they are
+// compiled as DLLs. In NT they require a dll init entry pointer.
+// The macro puts a stub entry point into the DLL so it will load.
+//
+
+#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
+ UINTN \
+ __stdcall \
+ _DllMainCRTStartup ( \
+ UINTN Inst, \
+ UINTN reason_for_call, \
+ VOID *rserved \
+ ) \
+ { \
+ return 1; \
+ } \
+ \
+ int \
+ EXPORTAPI \
+ __cdecl \
+ InitializeDriver ( \
+ void *ImageHandle, \
+ void *SystemTable \
+ ) \
+ { \
+ return InitFunction(ImageHandle, SystemTable); \
+ }
+
+
+ #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
+ (_if)->LoadInternal(type, name, NULL)
+
+#else // EFI_NT_EMULATOR
+
+//
+// When build similiar to FW, then link everything together as
+// one big module.
+//
+
+ #define EFI_DRIVER_ENTRY_POINT(InitFunction) \
+ UINTN \
+ InitializeDriver ( \
+ VOID *ImageHandle, \
+ VOID *SystemTable \
+ ) \
+ { \
+ return InitFunction(ImageHandle, \
+ SystemTable); \
+ } \
+ \
+ EFI_STATUS efi_main( \
+ EFI_HANDLE image, \
+ EFI_SYSTEM_TABLE *systab \
+ ) __attribute__((weak, \
+ alias ("InitializeDriver")));
+
+ #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
+ (_if)->LoadInternal(type, name, entry)
+
+#endif // EFI_FW_NT
+
+//
+// Some compilers don't support the forward reference construct:
+// typedef struct XXXXX
+//
+// The following macro provide a workaround for such cases.
+//
+#ifdef NO_INTERFACE_DECL
+#define INTERFACE_DECL(x)
+#else
+#ifdef __GNUC__
+#define INTERFACE_DECL(x) struct x
+#else
+#define INTERFACE_DECL(x) typedef struct x
+#endif
+#endif
+
+/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */
+#if defined(HAVE_USE_MS_ABI)
+#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
+#else
+/*
+ Credits for macro-magic:
+ https://groups.google.com/forum/?fromgroups#!topic/comp.std.c/d-6Mj5Lko_s
+ http://efesx.com/2010/08/31/overloading-macros/
+*/
+#define __VA_NARG__(...) \
+ __VA_NARG_(_0, ## __VA_ARGS__, __RSEQ_N())
+#define __VA_NARG_(...) \
+ __VA_ARG_N(__VA_ARGS__)
+#define __VA_ARG_N( \
+ _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,N,...) N
+#define __RSEQ_N() \
+ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+
+#define __VA_ARG_NSUFFIX__(prefix,...) \
+ __VA_ARG_NSUFFIX_N(prefix, __VA_NARG__(__VA_ARGS__))
+#define __VA_ARG_NSUFFIX_N(prefix,nargs) \
+ __VA_ARG_NSUFFIX_N_(prefix, nargs)
+#define __VA_ARG_NSUFFIX_N_(prefix,nargs) \
+ prefix ## nargs
+
+/* Prototypes of EFI cdecl -> stdcall trampolines */
+UINT64 efi_call0(void *func);
+UINT64 efi_call1(void *func, UINT64 arg1);
+UINT64 efi_call2(void *func, UINT64 arg1, UINT64 arg2);
+UINT64 efi_call3(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3);
+UINT64 efi_call4(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4);
+UINT64 efi_call5(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4, UINT64 arg5);
+UINT64 efi_call6(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4, UINT64 arg5, UINT64 arg6);
+UINT64 efi_call7(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7);
+UINT64 efi_call8(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
+ UINT64 arg8);
+UINT64 efi_call9(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
+ UINT64 arg8, UINT64 arg9);
+UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+ UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
+ UINT64 arg8, UINT64 arg9, UINT64 arg10);
+
+/* Front-ends to efi_callX to avoid compiler warnings */
+#define _cast64_efi_call0(f) \
+ efi_call0(f)
+#define _cast64_efi_call1(f,a1) \
+ efi_call1(f, (UINT64)(a1))
+#define _cast64_efi_call2(f,a1,a2) \
+ efi_call2(f, (UINT64)(a1), (UINT64)(a2))
+#define _cast64_efi_call3(f,a1,a2,a3) \
+ efi_call3(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3))
+#define _cast64_efi_call4(f,a1,a2,a3,a4) \
+ efi_call4(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4))
+#define _cast64_efi_call5(f,a1,a2,a3,a4,a5) \
+ efi_call5(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+ (UINT64)(a5))
+#define _cast64_efi_call6(f,a1,a2,a3,a4,a5,a6) \
+ efi_call6(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+ (UINT64)(a5), (UINT64)(a6))
+#define _cast64_efi_call7(f,a1,a2,a3,a4,a5,a6,a7) \
+ efi_call7(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+ (UINT64)(a5), (UINT64)(a6), (UINT64)(a7))
+#define _cast64_efi_call8(f,a1,a2,a3,a4,a5,a6,a7,a8) \
+ efi_call8(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+ (UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8))
+#define _cast64_efi_call9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
+ efi_call9(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+ (UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
+ (UINT64)(a9))
+#define _cast64_efi_call10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
+ efi_call10(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+ (UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
+ (UINT64)(a9), (UINT64)(a10))
+
+/* main wrapper (va_num ignored) */
+#define uefi_call_wrapper(func,va_num,...) \
+ __VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__)
+
+#endif
+#define EFI_FUNCTION __attribute__((ms_abi))
+
+#ifdef _MSC_EXTENSIONS
+#pragma warning ( disable : 4731 ) // Suppress warnings about modification of
EBP
+#endif
+
+#endif
diff --git a/headers/private/kernel/boot/platform/efi/arch/x86_64/pe.h
b/headers/private/kernel/boot/platform/efi/arch/x86_64/pe.h
new file mode 100644
index 0000000..624fa09
--- /dev/null
+++ b/headers/private/kernel/boot/platform/efi/arch/x86_64/pe.h
@@ -0,0 +1,595 @@
+/*
+ PE32+ header file
+ */
+#ifndef _PE_H
+#define _PE_H
+
+#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
+#define IMAGE_OS2_SIGNATURE 0x454E // NE
+#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
+#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
+#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
+
+
+typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header
+ UINT16 e_magic; // Magic number
+ UINT16 e_cblp; // Bytes on last page of file
+ UINT16 e_cp; // Pages in file
+ UINT16 e_crlc; // Relocations
+ UINT16 e_cparhdr; // Size of header in paragraphs
+ UINT16 e_minalloc; // Minimum extra paragraphs needed
+ UINT16 e_maxalloc; // Maximum extra paragraphs needed
+ UINT16 e_ss; // Initial (relative) SS value
+ UINT16 e_sp; // Initial SP value
+ UINT16 e_csum; // Checksum
+ UINT16 e_ip; // Initial IP value
+ UINT16 e_cs; // Initial (relative) CS value
+ UINT16 e_lfarlc; // File address of relocation table
+ UINT16 e_ovno; // Overlay number
+ UINT16 e_res[4]; // Reserved words
+ UINT16 e_oemid; // OEM identifier (for e_oeminfo)
+ UINT16 e_oeminfo; // OEM information; e_oemid specific
+ UINT16 e_res2[10]; // Reserved words
+ UINT32 e_lfanew; // File address of new exe header
+ } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
+
+typedef struct _IMAGE_OS2_HEADER { // OS/2 .EXE header
+ UINT16 ne_magic; // Magic number
+ UINT8 ne_ver; // Version number
+ UINT8 ne_rev; // Revision number
+ UINT16 ne_enttab; // Offset of Entry Table
+ UINT16 ne_cbenttab; // Number of bytes in Entry Table
+ UINT32 ne_crc; // Checksum of whole file
+ UINT16 ne_flags; // Flag UINT16
+ UINT16 ne_autodata; // Automatic data segment number
+ UINT16 ne_heap; // Initial heap allocation
+ UINT16 ne_stack; // Initial stack allocation
+ UINT32 ne_csip; // Initial CS:IP setting
+ UINT32 ne_sssp; // Initial SS:SP setting
+ UINT16 ne_cseg; // Count of file segments
+ UINT16 ne_cmod; // Entries in Module Reference Table
+ UINT16 ne_cbnrestab; // Size of non-resident name table
+ UINT16 ne_segtab; // Offset of Segment Table
+ UINT16 ne_rsrctab; // Offset of Resource Table
+ UINT16 ne_restab; // Offset of resident name table
+ UINT16 ne_modtab; // Offset of Module Reference Table
+ UINT16 ne_imptab; // Offset of Imported Names Table
+ UINT32 ne_nrestab; // Offset of Non-resident Names Table
+ UINT16 ne_cmovent; // Count of movable entries
+ UINT16 ne_align; // Segment alignment shift count
+ UINT16 ne_cres; // Count of resource segments
+ UINT8 ne_exetyp; // Target Operating system
+ UINT8 ne_flagsothers; // Other .EXE flags
+ UINT16 ne_pretthunks; // offset to return thunks
+ UINT16 ne_psegrefbytes; // offset to segment ref. bytes
+ UINT16 ne_swaparea; // Minimum code swap area size
+ UINT16 ne_expver; // Expected Windows version number
+ } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER;
+
+//
+// File header format.
+//
+
+typedef struct _IMAGE_FILE_HEADER {
+ UINT16 Machine;
+ UINT16 NumberOfSections;
+ UINT32 TimeDateStamp;
+ UINT32 PointerToSymbolTable;
+ UINT32 NumberOfSymbols;
+ UINT16 SizeOfOptionalHeader;
+ UINT16 Characteristics;
+} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
+
+#define IMAGE_SIZEOF_FILE_HEADER 20
+
+#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info
stripped from file.
+#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable
(i.e. no unresolved externel references).
+#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped
from file.
+#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped
from file.
+#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word
are reversed.
+#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
+#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info
stripped from file in .DBG file
+#define IMAGE_FILE_SYSTEM 0x1000 // System File.
+#define IMAGE_FILE_DLL 0x2000 // File is a DLL.
+#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word
are reversed.
+
+#define IMAGE_FILE_MACHINE_UNKNOWN 0
+#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
+#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian,
0540 big-endian
+#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian
+#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP
+#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x1c2 // Arm/Thumb
+#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC
Little-Endian
+#define IMAGE_FILE_MACHINE_IA64 0x200 // IA-64
+#define IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
+#define IMAGE_FILE_MACHINE_EBC 0xebc // EFI Byte Code
+#define IMAGE_FILE_MACHINE_X64 0x8664 // x86_64
+//
+// Directory format.
+//
+
+typedef struct _IMAGE_DATA_DIRECTORY {
+ UINT32 VirtualAddress;
+ UINT32 Size;
+} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
+
+#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
+
+//
+// Optional header format.
+//
+
+typedef struct _IMAGE_OPTIONAL_HEADER {
+ //
+ // Standard fields.
+ //
+
+ UINT16 Magic;
+ UINT8 MajorLinkerVersion;
+ UINT8 MinorLinkerVersion;
+ UINT32 SizeOfCode;
+ UINT32 SizeOfInitializedData;
+ UINT32 SizeOfUninitializedData;
+ UINT32 AddressOfEntryPoint;
+ UINT32 BaseOfCode;
+ UINT32 BaseOfData;
+
+ //
+ // NT additional fields.
+ //
+
+ UINT32 ImageBase;
+ UINT32 SectionAlignment;
+ UINT32 FileAlignment;
+ UINT16 MajorOperatingSystemVersion;
+ UINT16 MinorOperatingSystemVersion;
+ UINT16 MajorImageVersion;
+ UINT16 MinorImageVersion;
+ UINT16 MajorSubsystemVersion;
+ UINT16 MinorSubsystemVersion;
+ UINT32 Reserved1;
+ UINT32 SizeOfImage;
+ UINT32 SizeOfHeaders;
+ UINT32 CheckSum;
+ UINT16 Subsystem;
+ UINT16 DllCharacteristics;
+ UINT32 SizeOfStackReserve;
+ UINT32 SizeOfStackCommit;
+ UINT32 SizeOfHeapReserve;
+ UINT32 SizeOfHeapCommit;
+ UINT32 LoaderFlags;
+ UINT32 NumberOfRvaAndSizes;
+ IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
+} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
+
+typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
+ UINT16 Magic;
+ UINT8 MajorLinkerVersion;
+ UINT8 MinorLinkerVersion;
+ UINT32 SizeOfCode;
+ UINT32 SizeOfInitializedData;
+ UINT32 SizeOfUninitializedData;
+ UINT32 AddressOfEntryPoint;
+ UINT32 BaseOfCode;
+ UINT32 BaseOfData;
+ UINT32 BaseOfBss;
+ UINT32 GprMask;
+ UINT32 CprMask[4];
+ UINT32 GpValue;
+} IMAGE_ROM_OPTIONAL_HEADER, *PIMAGE_ROM_OPTIONAL_HEADER;
+
+#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
+#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
+#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
+
+#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
+#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
+
+typedef struct _IMAGE_NT_HEADERS {
+ UINT32 Signature;
+ IMAGE_FILE_HEADER FileHeader;
+ IMAGE_OPTIONAL_HEADER OptionalHeader;
+} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
+
+typedef struct _IMAGE_ROM_HEADERS {
+ IMAGE_FILE_HEADER FileHeader;
+ IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
+} IMAGE_ROM_HEADERS, *PIMAGE_ROM_HEADERS;
+
+#define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \
+ ((UINT32)ntheader + \
+ FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \
+ ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader \
+ ))
+
+
+// Subsystem Values
+
+#define IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem.
+#define IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a
subsystem.
+#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows
GUI subsystem.
+#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows
character subsystem.
+#define IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2
character subsystem.
+#define IMAGE_SUBSYSTEM_POSIX_CUI 7 // image run in the Posix
character subsystem.
+
+
+// Directory Entries
+
+#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
+#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
+#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
+#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory
+#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory
+#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table
+#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory
+#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String
+#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP)
+#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory
+#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration
Directory
+
+//
+// Section header format.
+//
+
+#define IMAGE_SIZEOF_SHORT_NAME 8
+
+typedef struct _IMAGE_SECTION_HEADER {
+ UINT8 Name[IMAGE_SIZEOF_SHORT_NAME];
+ union {
+ UINT32 PhysicalAddress;
+ UINT32 VirtualSize;
+ } Misc;
+ UINT32 VirtualAddress;
+ UINT32 SizeOfRawData;
+ UINT32 PointerToRawData;
+ UINT32 PointerToRelocations;
+ UINT32 PointerToLinenumbers;
+ UINT16 NumberOfRelocations;
+ UINT16 NumberOfLinenumbers;
+ UINT32 Characteristics;
+} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
+
+#define IMAGE_SIZEOF_SECTION_HEADER 40
+
+#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
+
+#define IMAGE_SCN_CNT_CODE 0x00000020 // Section contains
code.
+#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains
initialized data.
+#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains
uninitialized data.
+
+#define IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
+#define IMAGE_SCN_LNK_INFO 0x00000200 // Section contains
comments or some other type of information.
+#define IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents
will not become part of image.
+#define IMAGE_SCN_LNK_COMDAT 0x00001000 // Section contents
comdat.
+
+#define IMAGE_SCN_ALIGN_1BYTES 0x00100000 //
+#define IMAGE_SCN_ALIGN_2BYTES 0x00200000 //
+#define IMAGE_SCN_ALIGN_4BYTES 0x00300000 //
+#define IMAGE_SCN_ALIGN_8BYTES 0x00400000 //
+#define IMAGE_SCN_ALIGN_16BYTES 0x00500000 // Default alignment
if no others are specified.
+#define IMAGE_SCN_ALIGN_32BYTES 0x00600000 //
+#define IMAGE_SCN_ALIGN_64BYTES 0x00700000 //
+
+#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 // Section can be
discarded.
+#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 // Section is not
cachable.
+#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 // Section is not
pageable.
+#define IMAGE_SCN_MEM_SHARED 0x10000000 // Section is
shareable.
+#define IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is
executable.
+#define IMAGE_SCN_MEM_READ 0x40000000 // Section is
readable.
+#define IMAGE_SCN_MEM_WRITE 0x80000000 // Section is
writeable.
+
+//
+// Symbol format.
+//
+
+
+#define IMAGE_SIZEOF_SYMBOL 18
+
+//
+// Section values.
+//
+// Symbols have a section number of the section in which they are
+// defined. Otherwise, section numbers have the following meanings:
+//
+
+#define IMAGE_SYM_UNDEFINED (UINT16)0 // Symbol is
undefined or is common.
+#define IMAGE_SYM_ABSOLUTE (UINT16)-1 // Symbol is an
absolute value.
+#define IMAGE_SYM_DEBUG (UINT16)-2 // Symbol is a
special debug item.
+
+//
+// Type (fundamental) values.
+//
+
+#define IMAGE_SYM_TYPE_NULL 0 // no type.
+#define IMAGE_SYM_TYPE_VOID 1 //
+#define IMAGE_SYM_TYPE_CHAR 2 // type character.
+#define IMAGE_SYM_TYPE_SHORT 3 // type short integer.
+#define IMAGE_SYM_TYPE_INT 4 //
+#define IMAGE_SYM_TYPE_LONG 5 //
+#define IMAGE_SYM_TYPE_FLOAT 6 //
+#define IMAGE_SYM_TYPE_DOUBLE 7 //
+#define IMAGE_SYM_TYPE_STRUCT 8 //
+#define IMAGE_SYM_TYPE_UNION 9 //
+#define IMAGE_SYM_TYPE_ENUM 10 // enumeration.
+#define IMAGE_SYM_TYPE_MOE 11 // member of
enumeration.
+#define IMAGE_SYM_TYPE_BYTE 12 //
+#define IMAGE_SYM_TYPE_WORD 13 //
+#define IMAGE_SYM_TYPE_UINT 14 //
+#define IMAGE_SYM_TYPE_DWORD 15 //
+
+//
+// Type (derived) values.
+//
+
+#define IMAGE_SYM_DTYPE_NULL 0 // no derived type.
+#define IMAGE_SYM_DTYPE_POINTER 1 // pointer.
+#define IMAGE_SYM_DTYPE_FUNCTION 2 // function.
+#define IMAGE_SYM_DTYPE_ARRAY 3 // array.
+
+//
+// Storage classes.
+//
+
+#define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
+#define IMAGE_SYM_CLASS_NULL 0
+#define IMAGE_SYM_CLASS_AUTOMATIC 1
+#define IMAGE_SYM_CLASS_EXTERNAL 2
+#define IMAGE_SYM_CLASS_STATIC 3
+#define IMAGE_SYM_CLASS_REGISTER 4
+#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
+#define IMAGE_SYM_CLASS_LABEL 6
+#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
+#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
+#define IMAGE_SYM_CLASS_ARGUMENT 9
+#define IMAGE_SYM_CLASS_STRUCT_TAG 10
+#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
+#define IMAGE_SYM_CLASS_UNION_TAG 12
+#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
+#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
+#define IMAGE_SYM_CLASS_ENUM_TAG 15
+#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
+#define IMAGE_SYM_CLASS_REGISTER_PARAM 17
+#define IMAGE_SYM_CLASS_BIT_FIELD 18
+#define IMAGE_SYM_CLASS_BLOCK 100
+#define IMAGE_SYM_CLASS_FUNCTION 101
+#define IMAGE_SYM_CLASS_END_OF_STRUCT 102
+#define IMAGE_SYM_CLASS_FILE 103
+// new
+#define IMAGE_SYM_CLASS_SECTION 104
+#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
+
+// type packing constants
+
+#define N_BTMASK 017
+#define N_TMASK 060
+#define N_TMASK1 0300
+#define N_TMASK2 0360
+#define N_BTSHFT 4
+#define N_TSHIFT 2
+
+// MACROS
+
+//
+// Communal selection types.
+//
+
+#define IMAGE_COMDAT_SELECT_NODUPLICATES 1
+#define IMAGE_COMDAT_SELECT_ANY 2
+#define IMAGE_COMDAT_SELECT_SAME_SIZE 3
+#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
+#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
+
+#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
+#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
+#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
+
+
+//
+// Relocation format.
+//
+
+typedef struct _IMAGE_RELOCATION {
+ UINT32 VirtualAddress;
+ UINT32 SymbolTableIndex;
+ UINT16 Type;
+} IMAGE_RELOCATION;
+
+#define IMAGE_SIZEOF_RELOCATION 10
+
+//
+// I386 relocation types.
+//
+
+#define IMAGE_REL_I386_ABSOLUTE 0 // Reference is
absolute, no relocation is necessary
+#define IMAGE_REL_I386_DIR16 01 // Direct 16-bit
reference to the symbols virtual address
+#define IMAGE_REL_I386_REL16 02 // PC-relative 16-bit
reference to the symbols virtual address
+#define IMAGE_REL_I386_DIR32 06 // Direct 32-bit
reference to the symbols virtual address
+#define IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit
reference to the symbols virtual address, base not included
+#define IMAGE_REL_I386_SEG12 011 // Direct 16-bit
reference to the segment-selector bits of a 32-bit virtual address
+#define IMAGE_REL_I386_SECTION 012
+#define IMAGE_REL_I386_SECREL 013
+#define IMAGE_REL_I386_REL32 024 // PC-relative 32-bit
reference to the symbols virtual address
+
+//
+// MIPS relocation types.
+//
+
+#define IMAGE_REL_MIPS_ABSOLUTE 0 // Reference is
absolute, no relocation is necessary
+#define IMAGE_REL_MIPS_REFHALF 01
+#define IMAGE_REL_MIPS_REFWORD 02
+#define IMAGE_REL_MIPS_JMPADDR 03
+#define IMAGE_REL_MIPS_REFHI 04
+#define IMAGE_REL_MIPS_REFLO 05
+#define IMAGE_REL_MIPS_GPREL 06
+#define IMAGE_REL_MIPS_LITERAL 07
+#define IMAGE_REL_MIPS_SECTION 012
+#define IMAGE_REL_MIPS_SECREL 013
+#define IMAGE_REL_MIPS_REFWORDNB 042
+#define IMAGE_REL_MIPS_PAIR 045
+
+//
+// Alpha Relocation types.
+//
+
+#define IMAGE_REL_ALPHA_ABSOLUTE 0x0
+#define IMAGE_REL_ALPHA_REFLONG 0x1
+#define IMAGE_REL_ALPHA_REFQUAD 0x2
+#define IMAGE_REL_ALPHA_GPREL32 0x3
+#define IMAGE_REL_ALPHA_LITERAL 0x4
+#define IMAGE_REL_ALPHA_LITUSE 0x5
+#define IMAGE_REL_ALPHA_GPDISP 0x6
+#define IMAGE_REL_ALPHA_BRADDR 0x7
+#define IMAGE_REL_ALPHA_HINT 0x8
+#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x9
+#define IMAGE_REL_ALPHA_REFHI 0xA
+#define IMAGE_REL_ALPHA_REFLO 0xB
+#define IMAGE_REL_ALPHA_PAIR 0xC
+#define IMAGE_REL_ALPHA_MATCH 0xD
+#define IMAGE_REL_ALPHA_SECTION 0xE
+#define IMAGE_REL_ALPHA_SECREL 0xF
+#define IMAGE_REL_ALPHA_REFLONGNB 0x10
+
+//
+// IBM PowerPC relocation types.
+//
+
+#define IMAGE_REL_PPC_ABSOLUTE 0x0000 // NOP
+#define IMAGE_REL_PPC_ADDR64 0x0001 // 64-bit address
+#define IMAGE_REL_PPC_ADDR32 0x0002 // 32-bit address
+#define IMAGE_REL_PPC_ADDR24 0x0003 // 26-bit address, shifted left 2
(branch absolute)
+#define IMAGE_REL_PPC_ADDR16 0x0004 // 16-bit address
+#define IMAGE_REL_PPC_ADDR14 0x0005 // 16-bit address, shifted left 2 (load
doubleword)
+#define IMAGE_REL_PPC_REL24 0x0006 // 26-bit PC-relative offset, shifted
left 2 (branch relative)
+#define IMAGE_REL_PPC_REL14 0x0007 // 16-bit PC-relative offset, shifted
left 2 (br cond relative)
+#define IMAGE_REL_PPC_TOCREL16 0x0008 // 16-bit offset from TOC base
+#define IMAGE_REL_PPC_TOCREL14 0x0009 // 16-bit offset from TOC base, shifted
left 2 (load doubleword)
+
+#define IMAGE_REL_PPC_ADDR32NB 0x000A // 32-bit addr w/o image base
+#define IMAGE_REL_PPC_SECREL 0x000B // va of containing section (as in an
image sectionhdr)
+#define IMAGE_REL_PPC_SECTION 0x000C // sectionheader number
+#define IMAGE_REL_PPC_IFGLUE 0x000D // substitute TOC restore instruction
iff symbol is glue code
+#define IMAGE_REL_PPC_IMGLUE 0x000E // symbol is glue code; virtual address
is TOC restore instruction
+
+#define IMAGE_REL_PPC_TYPEMASK 0x00FF // mask to isolate above values in
IMAGE_RELOCATION.Type
+
+// Flag bits in IMAGE_RELOCATION.TYPE
+
+#define IMAGE_REL_PPC_NEG 0x0100 // subtract reloc value rather than
adding it
+#define IMAGE_REL_PPC_BRTAKEN 0x0200 // fix branch prediction bit to predict
branch taken
+#define IMAGE_REL_PPC_BRNTAKEN 0x0400 // fix branch prediction bit to predict
branch not taken
+#define IMAGE_REL_PPC_TOCDEFN 0x0800 // toc slot defined in file (or, data
in toc)
+
+//
+// Based relocation format.

[ *** diff truncated: 9010 lines dropped *** ]


############################################################################

Commit: 0e22daaaa00392a21a0a48f6003b01b5930dacf1
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Sep 14 14:40:14 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:26:57 2015 UTC

Add TARGET_BOOT_LINKFLAGS to LINKFLAGS in BootLD.

Consulted with Ingo on adding TARGET_BOOT_LINKFLAGS, and
this is 'probably' ok as x86_64 builds still build and runs.

----------------------------------------------------------------------------

############################################################################

Commit: 102b2d1a59ba57095cd41f3560a7d17c5e31b8a6
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Sep 14 15:08:24 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:27:02 2015 UTC

Use variables correclyin the if, and use renamed variables in build.

----------------------------------------------------------------------------

############################################################################

Commit: e5e3a5a237a406d3fa6347cba0c171c0db64b1ca
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Thu Oct 31 20:58:55 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:28:11 2015 UTC

Make 32 bit ELF relocation compile on 64 bit boot platforms.

boot_arch_elf_relocate_rel tries to call boot_elf_resolve_symbol
with an *addr_t so we make sure it is always *Elf32_Addr.

----------------------------------------------------------------------------

############################################################################

Commit: bc0196581e8a3c2dc281092211b88ca4a5905515
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Nov 6 20:10:09 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:28:15 2015 UTC

Cleaning up EFI platform Jamfile a bit.

----------------------------------------------------------------------------

############################################################################

Commit: d8a6e7b33f1ae9340f162caff227eab029a1e7c1
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Nov 6 20:10:46 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:28:20 2015 UTC

Use x86_64 functions for x86_64 non bios platforms.

This logic is handled in libroot Jamfiles, but we only
use parts of that in boot.

----------------------------------------------------------------------------

############################################################################

Commit: 5be42f86fb8294dd8e009e54a4e7726ac8b4cb18
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Nov 6 20:12:36 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:28:26 2015 UTC

Add compile flags for EFI platform.

----------------------------------------------------------------------------

############################################################################

Commit: 34d15962ec3b841bdd38163024311fb5cfeb7036
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Nov 6 20:28:34 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:28:30 2015 UTC

Forgot indentation.

----------------------------------------------------------------------------

############################################################################

Commit: f34260ef7bbaedf684b13bd3450cef93b362d7f6
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Nov 13 21:58:01 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:43:24 2015 UTC

Introduce new build flag for bootld and add EFI boot targets.

EFI needs BootLd to use -BSymbolic and others to link.
Also moved BoardSetup to use that flag instead of Jamfile magic.
BoardSetup was called and added to XX_CC_FLAGS before
XX_CC_FLAGS was set so moved BoardSetup to after it, which also
made sense for this change.

This allow building a runnable(!) EFI app with
jam -sHAIKU_BOOT_PLATFORM=efi haiku_loader.efi
Atm it only prints a message and waits for a key.

----------------------------------------------------------------------------

############################################################################

Commit: 602a669aa6e01537c15c67b2d0c675c1e3d74362
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Wed Nov 13 22:40:23 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:07 2015 UTC

Rename flag to XX_BOOT_LDFLAGS.

----------------------------------------------------------------------------

############################################################################

Commit: 591d67b15cef2a293a1c88b997eacc85d111b40b
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Thu Nov 14 20:12:00 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:17 2015 UTC

Fix missing paranthesis on variable mistake.

This makes building x86_64 bios build and run again.

----------------------------------------------------------------------------

############################################################################

Commit: fb95dcd9d3690ebfab3db1199152f4f5fce7268b
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Nov 30 20:33:02 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:23 2015 UTC

Add EFI platform header for files using EFI.

----------------------------------------------------------------------------

############################################################################

Commit: ef267c7f911f24d7dcae093adea1088b446b24f6
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Nov 30 20:35:06 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:29 2015 UTC

Implement console code.

----------------------------------------------------------------------------

############################################################################

Commit: 4135450a6ddf33873abe54420f1369e8fee6781b
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Nov 30 20:35:38 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:34 2015 UTC

Init console.

----------------------------------------------------------------------------

############################################################################

Commit: c98d986afe1313b35695dfda4274e919882eb041
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Nov 30 20:36:14 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:38 2015 UTC

Remove old start.c.

----------------------------------------------------------------------------

############################################################################

Commit: 15b5ce49a138707d892a51341672baa35f8dc6c5
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Nov 30 20:36:36 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:42 2015 UTC

Update Jamfile to build console, remove old rules.

----------------------------------------------------------------------------

############################################################################

Commit: f95b840daac8d0ecaad8b562ef13fb51bf467dec
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Nov 30 20:44:03 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:47 2015 UTC

Remove old EFI string writing test code.

----------------------------------------------------------------------------

############################################################################

Commit: 1ed1013545afc8a97e43effed70586312a1d484c
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Mon Dec 2 19:54:33 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:51 2015 UTC

Make sure bootloader builds to the right directory.

----------------------------------------------------------------------------

############################################################################

Commit: 50189f2af421241ad319ebf1d5714a7f1e60767c
Author: François Revol <revol@xxxxxxx>
Date: Sat Dec 7 06:47:19 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:45:56 2015 UTC

loader: Drop the HashMap for partition lookup by id

The HashMap constructor was called before the heap is initialized,
ending up calling malloc from the OpenHashMap constructor.

Oddly it was still working on x86 but broke other platforms.

Instead we add a Lookup() static method to Partition,
which by default walks gPartitions for the id,
and recursively calls itself on the children lists.

This means we must add a partition even temporarily to gPartitions
before Scan()ing it though.

Signed-off-by: François Revol <revol@xxxxxxx>

----------------------------------------------------------------------------

############################################################################

Commit: 784cbe949aa8b099c68cb5a61132b0d16b57a4cb
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Dec 14 23:04:33 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:00 2015 UTC

GNU-EFI has removed the -S (strip-all) option, so do we.

----------------------------------------------------------------------------

############################################################################

Commit: 91134e11fae10f3854596d04cb2c3b9061263dab
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Dec 14 23:30:12 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:05 2015 UTC

Implement EFI keyboard functions. Mostly done.

----------------------------------------------------------------------------

############################################################################

Commit: de956bdc736b4f445df46d26861ab3af638beb3f
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Dec 14 23:37:18 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:13 2015 UTC

Implemented EFI serial code. Seems to work.

Not sure we can pass EFI drivers to kernel so probably
should remove commented kernel args section later.

----------------------------------------------------------------------------

############################################################################

Commit: 8a7a15c60f0beeff2813b6c9ccd1ab757ebfed52
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Dec 14 23:39:44 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:17 2015 UTC

Loop on EFI_NOT_READY when checking for keypress.

Not sure

----------------------------------------------------------------------------

############################################################################

Commit: 220ad0f208c3807e01eefed50032745758ad2bd9
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Dec 14 23:48:10 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:22 2015 UTC

Partial implementation of EFI debug functions.

Lacks implementation of debug_init_post_mmu and debug_cleanup

----------------------------------------------------------------------------

############################################################################

Commit: 2d6c219d425064d2bf4450a77b71ea2fb0531cc1
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sat Dec 14 23:49:53 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:26 2015 UTC

Update Jamfile and work in progress on start.cpp

Enable serial and early debug functions.

----------------------------------------------------------------------------

############################################################################

Commit: 47240a85e7473c90385d3d2996d41a3ee5c820eb
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sun Dec 15 12:49:08 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:30 2015 UTC

Remove leftovers from bios code.

----------------------------------------------------------------------------

############################################################################

Commit: 8ecb96b1a3e9928882db414e2ad5b995ff07a874
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Mon Dec 16 20:41:33 2013 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:35 2015 UTC

Adding ctor_list in linking, and _bss_start.

Clearing bss seems to hang at the moment.

----------------------------------------------------------------------------

############################################################################

Commit: c33e4e5b21e39b1ee2b1ca0a0168d2dff96c332f
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sun Mar 16 14:59:27 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:46:38 2015 UTC

Don't include mmu.h for now.

----------------------------------------------------------------------------

############################################################################

Commit: 6d3ed1d3fb7888bedfbff37184b2ddd4e51b312f
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sun Mar 16 15:31:46 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:47:24 2015 UTC

Don't clear BSS, it is already zeroed.

EFI doesn't seem to like a .bss section according to GNU-EFI.
Therefore it is put and expanded inside .data. It is already zeroed
there. It makes the EFI app bigger so maybe there is a better
way?

The reason clearBSS() made the application hang was because
kSystemTable that we set before clearBSS() was part of .bss which
meant it was erased on clearing.

----------------------------------------------------------------------------

############################################################################

Commit: ab2e3e54335d6f5a38d891c7d2cd8381f45fac98
Author: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date: Sun Mar 16 18:30:04 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:47:28 2015 UTC

Missed to remove clearBSS() function in previous commit.

----------------------------------------------------------------------------

############################################################################

Commit: 8525fa8cd01dc294fc92635bc697a2e4f80c7d51
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 03:48:41 2014 UTC

EFI: fix kprintf; didn't copy variable arguments like it should

----------------------------------------------------------------------------

############################################################################

Commit: 6f8abbedd32df19774834ad843deb6eadfff1079
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 03:49:39 2014 UTC

EFI: temporarily disable treating warnings as errors

----------------------------------------------------------------------------

############################################################################

Commit: 98c0e045804806adc70644e11b3701f0c7ba1ea4
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 06:01:32 2014 UTC

EFI: add simple accessors for boot & runtime services

----------------------------------------------------------------------------

############################################################################

Commit: bcef6a7800686bf6d7d13cc6d3737c3fac00d108
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 06:10:56 2014 UTC

EFI: implement basic memory allocation & heap

----------------------------------------------------------------------------

############################################################################

Commit: 4b657ba04d2564f1fe7355a71a9e7f5bf39d7ad6
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 06:20:19 2014 UTC

EFI: add basic text-mode menu support

----------------------------------------------------------------------------

############################################################################

Commit: 8c9979b45415576b491158e6baa1b03dbc1774fd
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 10:44:00 2014 UTC

EFI: implement EFI block io devices, stub out video code.

* The EFI block io devices are read-only, and it will scan
all block devices reported by EFI; in theory, one can
forego even scanning for a partitioning system
* May want to later change the EFI block io code to only return
disks rather than individual partitions, and rely on the
system partitioning code
* Also forced the boot menu to show for now (start.cpp)
* With these changes, it's now possible to get to the Haiku
boot menu on a 64-bit EFI system (at least without any
actual Haiku installations present)

----------------------------------------------------------------------------

############################################################################

Commit: 0bec2504b5aafa151e63b0d1e4cfc03dbda8591f
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 11:10:08 2014 UTC

Whitespace cleanup; no functional changes

----------------------------------------------------------------------------

############################################################################

Commit: 759f9130c5bca574ea1d826704eabc16b14ce79e
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Apr 24 11:35:40 2014 UTC

EFI: acpi init

* Not used yet; depends on functions in bios_ia32/acpi.cpp which
will be put into a shared location for the various x86 boot
loaders to use

----------------------------------------------------------------------------

############################################################################

Commit: 1c7703cd3fffc17fe93d1a3e7aaf4423e198168a
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 25 01:07:35 2014 UTC

EFI: use the best text mode available to us

----------------------------------------------------------------------------

############################################################################

Commit: 11069d9a363dd9b63cfd40a3894c8acfea0354da
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 25 01:08:31 2014 UTC

EFI: fixes boot on a macbook air; seems memory isn't zeroed

----------------------------------------------------------------------------

############################################################################

Commit: 71b68cd180cc01dc11fdc63fa01f40ecbf64aefe
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 25 03:03:59 2014 UTC

EFI: chooses the best resolution and throws up the splash screen

----------------------------------------------------------------------------

############################################################################

Commit: 9e78ab305c2dfdbe00d7c53c800808eaa866d0fd
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 25 07:48:07 2014 UTC

EFI: make switching between text & graphics modes work

----------------------------------------------------------------------------

############################################################################

Commit: 402b7bf6cae54724fdb585d4a3d58db2824a164a
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Tue Oct 21 19:14:45 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:07 2015 UTC

Preliminary EFI support in the bootloader.

Enough to let the kernel to print hello, but not much beyond that.
I think this also breaks non-EFI x86-64 support, code cleanups required.

----------------------------------------------------------------------------

############################################################################

Commit: 2de1d0c93d74c99050a7eb95a00feceac99587d7
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Tue Oct 21 19:57:22 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:19 2015 UTC

Fix initial kernel stack address.

Leaving stack_address uninitialized caused platform_allocate_region to
allocate a random virtual address to the stack.

----------------------------------------------------------------------------

############################################################################

Commit: 4e5c44df7a26b29ec49a9838bc5d8f3329117cbb
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Wed Oct 22 00:52:20 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:26 2015 UTC

Bootloader: Populate gKernelArgs with plausible values.

----------------------------------------------------------------------------

############################################################################

Commit: b167598ff931f0eae4440919627575320b8d878c
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Wed Oct 22 00:53:12 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:30 2015 UTC

bootloader: Bug fix, PML4 must not overlap physical map.

----------------------------------------------------------------------------

############################################################################

Commit: 9aaeccbe90f2a386b89fced999ac4be29e77b5fe
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Wed Oct 22 01:13:45 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:35 2015 UTC

bootloader: Initialize/load the GDT.

----------------------------------------------------------------------------

############################################################################

Commit: 4dfa0cc1c01e5470a4a714ece7db0fae1c319abe
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Wed Oct 22 03:01:23 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:40 2015 UTC

Try harder to allocate early physical pages.

----------------------------------------------------------------------------

############################################################################

Commit: 8df1c3bde217f98672556a2e671502c9b7d85d5a
Author: Henry Harrington <henry.harrington@xxxxxxxxx>
Date: Wed Oct 22 17:25:05 2014 UTC
Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Fri Apr 24 09:59:43 2015 UTC

bootloader: Translate kernel args before adding them to kernel_args_range.

Chunks may be physically contiguous, but virtually disjoint. Adding
physical addresses may cause ranges to be merged incorrectly.

----------------------------------------------------------------------------

############################################################################

Commit: cb66d50b95de655afebcdecb35aa2c0a07c86809
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Wed Oct 22 10:55:01 2014 UTC

EFI boot loader hacking

----------------------------------------------------------------------------

############################################################################

Commit: 670bf612b8008c40e2bc61e224690178b8c8c7ff
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 09:07:37 2015 UTC

UEFI: add missing include

----------------------------------------------------------------------------

############################################################################

Commit: 65b305197a8efc9418fcd94244ea89d1d520c2fb
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 08:24:32 2015 UTC

UEFI: pass ACPI root pointer to the kernel

----------------------------------------------------------------------------

############################################################################

Commit: babcf8a2db247963ebd6b1fa2388ac680a308dc5
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 09:08:32 2015 UTC

boot_loader: pass ACPI root to kernel, kernel to ACPI driver

* This allows ACPI to work with the UEFI bootloader, as the
ACPICA's probe for the ACPI root only works with the BIOS

----------------------------------------------------------------------------

############################################################################

Commit: fe8d8073bbbdb058a671f65d47d9813e69dfcf3e
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 10:15:18 2015 UTC

Fix permissions

----------------------------------------------------------------------------

############################################################################

Commit: e05615e6ce7ffe55519a262589d4d98b5361ceb5
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Wed Oct 22 10:56:04 2014 UTC

EFI kernel support hacking

----------------------------------------------------------------------------

############################################################################

Commit: 8840e0c1f9f82db7f2db6bd78cd51a92bb84e3aa
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 10:20:18 2015 UTC

Allow configuring for a given boot platform.

----------------------------------------------------------------------------

############################################################################

Commit: 5870e13bcdfba87180836a49a1c998d7a55390a9
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 12:25:37 2015 UTC

Move handling of pic/non-pic to ArchitectureRules Add ACPI root pointer to
platform args for bios_ia32 Fix changes from UEFI code for elf.cpp &
kernel_args.cpp Correct BOOTLD_FLAGS to BOOT_LDFLAGS where missed

----------------------------------------------------------------------------

############################################################################

Commit: 066cdfaf31c8d8294f92ac3434816fb728226af1
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Fri Apr 24 22:39:57 2015 UTC

UEFI: doesn't yet work with the reimplemented memset functions

----------------------------------------------------------------------------


Other related posts:

  • » [haiku-commits] BRANCH jessicah-github.efi.master [066cdfaf31c8] headers/private/kernel/boot/platform/efi src/system/boot/platform/efi headers/private/kernel/boot/platform/efi/arch/x86_64 headers/private/kernel/boot/platform/efi/arch/x86 headers/private/kernel/boot/platform/efi/protocol - jessicah-github . efi . master