diff options
Diffstat (limited to 'boot/efi/start.c')
| -rw-r--r-- | boot/efi/start.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/boot/efi/start.c b/boot/efi/start.c index 8ef8cbe..f1f4ec7 100644 --- a/boot/efi/start.c +++ b/boot/efi/start.c @@ -4,6 +4,9 @@ #include <efi/tables.h> #include "../kjarna.h" +#include "../config.h" + +#include <libc/stdio.h> #include "kjarna_efi.h" struct efi_context const *efi_context; @@ -21,12 +24,25 @@ EFI_STATUS _start(EFI_HANDLE handle, EFI_SYSTEM_TABLE *system_table) system_table->ConOut->ClearScreen(system_table->ConOut); +#ifdef DEBUG_WAIT + EFI_GUID lip_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID; + EFI_LOADED_IMAGE_PROTOCOL *lip = efi_get_protocol(efi_context->handle, &lip_guid); + + printf("DEBUG: EFI_LOADED_IMAGE_PROTOCOL { .ImageBase = %p }\n", lip->ImageBase); + __asm__ volatile ("movq %0, %%rax" :: "r"(lip->ImageBase) : "rax"); + bool wait = true; + + while(wait) + { + __asm__ ("hlt"); + } +#endif + if (main(0, nullptr) != 0) { efi_errno = EFI_ABORTED; } - return _exit(efi_errno); } |
