From 0d2ddecc9aeb232746b76b4eebdb1381053a8951 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Mon, 27 Jan 2025 02:05:07 +0000 Subject: checkpoint. we can fake syscall with the dummy gdt --- boot/efi/start.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'boot/efi/start.c') diff --git a/boot/efi/start.c b/boot/efi/start.c index f1f4ec7..fc44377 100644 --- a/boot/efi/start.c +++ b/boot/efi/start.c @@ -28,8 +28,18 @@ EFI_STATUS _start(EFI_HANDLE handle, EFI_SYSTEM_TABLE *system_table) EFI_GUID lip_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID; EFI_LOADED_IMAGE_PROTOCOL *lip = efi_get_protocol(efi_context->handle, &lip_guid); + uint64_t text_base; + uint64_t data_base; + printf("DEBUG: EFI_LOADED_IMAGE_PROTOCOL { .ImageBase = %p }\n", lip->ImageBase); __asm__ volatile ("movq %0, %%rax" :: "r"(lip->ImageBase) : "rax"); + __asm__ volatile ( + "lea .text, %0\n" + "lea .data, %1\n" + : "=r"(text_base), "=r"(data_base) + : + ); + printf("DEBUG: .text %p .data %p\n", text_base, data_base); bool wait = true; while(wait) -- cgit v1.3.1-1-g115d