EFI: Initial test EFI application

* Only set HAIKU_BOOT_PLATFORM to bios_ia32 if not defined
* Add gnuefi build feature
* Introduce BOOT_LDFLAGS, and move options for passing to linker
  into ArchitectureSetup
* x86_64 compile fixes for warnings in boot loader
* loader/elf.cpp: don't include ELF32 support when targeting EFI
* relocation_func.cpp: copy of the relocation code from gnuefi
  to make _relocate extern "C", and avoid including <efilib.h>
* boot_loader_efi.ld: copy of gnuefi's elf_x86_64_efi.lds,
  modified to include support for C++ constructors, etc. Keep in
  sync with the gnuefi package

Signed-off-by: Jessica Hamilton <[email protected]>
This commit is contained in:
Fredrik Holmqvist
2016-09-02 19:02:29 +12:00
committed by Jessica Hamilton
parent 20e11028aa
commit 211483cb51
27 changed files with 474 additions and 59 deletions
@@ -0,0 +1,46 @@
/*
* Copyright 2013-2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_BOOT_PLATFORM_EFI_KERNEL_ARGS_H
#define KERNEL_BOOT_PLATFORM_EFI_KERNEL_ARGS_H
#ifndef KERNEL_BOOT_KERNEL_ARGS_H
# error This file is included from <boot/kernel_args.h> only
#endif
// currently the EFI loader pretends to be the bios_ia32 platform.
// not quite right, as the kernel needs to be aware of efi runtime services
#include <arch/x86/apm.h>
#include <boot/disk_identifier.h>
#include <util/FixedWidthPointer.h>
#define SMP_MAX_CPUS 64
#define MAX_PHYSICAL_MEMORY_RANGE 32
#define MAX_PHYSICAL_ALLOCATED_RANGE 32
#define MAX_VIRTUAL_ALLOCATED_RANGE 32
#define MAX_SERIAL_PORTS 4
typedef struct bios_drive {
struct bios_drive *next;
uint16 drive_number;
disk_identifier identifier;
} bios_drive;
typedef struct {
uint16 serial_base_ports[MAX_SERIAL_PORTS];
FixedWidthPointer<bios_drive> drives;
// this does not contain the boot drive
// seems to be ignored entirely?
apm_info apm;
} _PACKED platform_kernel_args;
#endif /* KERNEL_BOOT_PLATFORM_BIOS_IA32_KERNEL_ARGS_H */
@@ -0,0 +1,17 @@
/*
* Copyright 2013-2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_BOOT_PLATFORM_EFI_STAGE2_ARGS_H
#define _KERNEL_BOOT_PLATFORM_EFI_STAGE2_ARGS_H
#ifndef KERNEL_BOOT_STAGE2_ARGS_H
# error This file is included from <boot/stage2_args.h> only
#endif
struct platform_stage2_args {
};
#endif /* _KERNEL_BOOT_PLATFORM_EFI_STAGE2_ARGS_H */