From 472ec944d2ed81d0304cc6cac80946a6a44776be Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 19 Apr 2025 16:36:51 -0400 Subject: UEFI and republicans --- kernel/efi/efi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 kernel/efi/efi.c (limited to 'kernel/efi/efi.c') diff --git a/kernel/efi/efi.c b/kernel/efi/efi.c new file mode 100644 index 0000000..4f253a7 --- /dev/null +++ b/kernel/efi/efi.c @@ -0,0 +1,28 @@ +#include "lib/klib.h" +#include +#include +#include +#include +#include + +#include "efi.h" + +void efi_init(EFI_HANDLE IH, EFI_SYSTEM_TABLE *ST) +{ + EFI_STATUS status; + + if (IH == NULL || ST == NULL) + return; + + status = efi_load_mmap(ST); + if (EFI_ERROR(status)) + panic("Failed to load efi memory map, EFI_STATUS = %lu\n", status); + + status = efi_load_gop(ST); + if (EFI_ERROR(status)) + panic( + "Failed to locate graphics output protocol (GOP), EFI_STATUS = %lu\n", + status); + + ST->BootServices->ExitBootServices(IH, 0); +} -- cgit v1.2.3-freya