commit 93f9bd60bdca298977c9d5799245aca48dfd881f
parent ccb76c2a8da8ee339c38fa41a443fb92568360d7
Author: Matsuda Kenji <info@mtkn.jp>
Date: Tue, 26 Mar 2024 08:09:53 +0900
read 10 bytes from kernel.elf
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/loader.c b/loader.c
@@ -56,6 +56,13 @@ EfiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *systab)
return stat;
}
+ EFI_PHYSICAL_ADDRESS kernel_base = 0x100000;
+ stat = kernel->Read(kernel, 10, (VOID *)kernel_base);
+ if (stat != EFI_SUCCESS) {
+ efi_printf("read file \"kernel.elf\": %d\n", stat);
+ return stat;
+ }
+
stat = kernel->Close(kernel);
if (stat != EFI_SUCCESS) {
efi_printf("close file: %d\n", stat);