From d855c0a219a180497c2e50f9bc19bfce69b937a6 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Thu, 23 Jan 2025 00:24:57 +0000 Subject: it printfs with the efi interface --- boot/efi/start.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'boot/efi/start.c') 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 #include "../kjarna.h" +#include "../config.h" + +#include #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); } -- cgit v1.3.1-1-g115d