diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-19 16:36:51 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-19 16:37:54 -0400 |
commit | 472ec944d2ed81d0304cc6cac80946a6a44776be (patch) | |
tree | f6cae641c143a0b45bb289d9d9fc6145706025b0 /kernel/efi/efi.c | |
parent | set mmap limit (diff) | |
download | comus-472ec944d2ed81d0304cc6cac80946a6a44776be.tar.gz comus-472ec944d2ed81d0304cc6cac80946a6a44776be.tar.bz2 comus-472ec944d2ed81d0304cc6cac80946a6a44776be.zip |
UEFI and republicans
Diffstat (limited to 'kernel/efi/efi.c')
-rw-r--r-- | kernel/efi/efi.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 <lib.h> +#include <comus/efi.h> +#include <comus/mboot.h> +#include <comus/memory.h> +#include <efi.h> + +#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); +} |