setos

拙OS
Log | Files | Refs | LICENSE

commit 927519f884f6e2dfc0caa41e1c98b6644f37ae01
parent c1b98d4f44547fb85418110fe68a2b7dbf11c384
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Fri, 29 Mar 2024 12:09:06 +0900

exit boot services

Diffstat:
Mloader.c | 22++++++++++++++--------
Muefi.h | 2++
2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/loader.c b/loader.c @@ -90,18 +90,24 @@ EfiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *systab) return stat; } + mmsize = 8196; + stat = SystemTable->BootServices->GetMemoryMap(&mmsize, mmap, &mkey, &dsize, &dver); + if (stat != EFI_SUCCESS) { + efi_printf("get memory map: %d\n", stat); + for (;;) {} + return stat; + } + stat = SystemTable->BootServices->ExitBootServices(ImageHandle, mkey); + if (stat != EFI_SUCCESS) { + efi_printf("exit boot services: %d\n", stat); + for (;;) {} + return stat; + } + EFI_PHYSICAL_ADDRESS kernel_base = 0x100000; typedef void (* Kernel) (void); ((Kernel) kernel_base)(); - EFI_INPUT_KEY Key; - CHAR16 str[2] = {' ', '\0'}; - while(1) { - SystemTable->ConIn->ReadKeyStroke(SystemTable->ConIn, &Key); - str[0] = Key.UnicodeChar; - SystemTable->ConOut->OutputString(SystemTable->ConOut, str); - } - return EFI_SUCCESS; } diff --git a/uefi.h b/uefi.h @@ -249,6 +249,8 @@ EFI_STATUS (EFIAPI *EFI_GET_MEMORY_MAP)( typedef EFI_STATUS (EFIAPI *EFI_EXIT_BOOT_SERVICES)( + IN EFI_HANDLE ImageHandle, + IN UINTN MapKey ); typedef