diff options
| author | Ada Christine <adachristine18@gmail.com> | 2025-01-23 00:24:57 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2025-01-23 00:24:57 +0000 |
| commit | d855c0a219a180497c2e50f9bc19bfce69b937a6 (patch) | |
| tree | 1ff8523d41b222fb356fb3404d2a53c26a7d6a3d /boot/efi/start.c | |
| parent | edd52bd1464ee9ae4f0cdf7ff90a20ca175580fe (diff) | |
it printfs with the efi interface
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); } |
