Splitting out UEFI bootloader code from kernel

Now the bootloader should be responsible for all initial setup,
loading the kernel, and then handing off to the kernel with
proper data in place.
This commit is contained in:
Justin C. Miller
2017-07-26 01:41:46 -07:00
parent 9ae583b1ec
commit d02e1d97d9
14 changed files with 242 additions and 53 deletions

20
src/boot/utility.h Normal file
View File

@@ -0,0 +1,20 @@
#include <efi.h>
#include <efilib.h>
#include "console.h"
#define UNUSED __attribute__((unused))
const CHAR16 *util_error_message(EFI_STATUS status);
#define CHECK_EFI_STATUS_OR_RETURN(s, msg, ...) \
if (EFI_ERROR((s))) { \
Print(L"EFI_ERROR: " msg L": %s\n", ## __VA_ARGS__, util_error_message(s)); \
return (s); \
}
#define CHECK_EFI_STATUS_OR_FAIL(s) \
if (EFI_ERROR((s))) { \
con_status_fail(util_error_message(s)); \
while (1) __asm__("hlt"); \
}