From 3bdc5bccdd111af1b3fe59ecf17304b73bda4ce9 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 28 Mar 2022 21:22:10 -0400 Subject: [PATCH] Pass page table address range to HULK on boot --- src/hello/hello.d | 3 +++ src/hulk/bootinfo.d | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/hello/hello.d b/src/hello/hello.d index 3e46c1d..2db45c0 100644 --- a/src/hello/hello.d +++ b/src/hello/hello.d @@ -414,6 +414,8 @@ extern (C) EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * st) console.writeln("Welcome to HELLO, HOS EFI Lightweight LOader, v0.1.0"); console.writeln("Firmware vendor: '%S', version: 0x%x", st.FirmwareVendor, st.FirmwareVendor); + bootinfo().pt_phys = cast(ulong)scratch.current(); + if (!set_graphics_mode()) { console.wait_key(); @@ -447,6 +449,7 @@ extern (C) EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * st) bootinfo().hulk_phys = hulk_bin_phys(); bootinfo().bss_phys = bss_phys; bootinfo().stack_phys = stack_phys; + bootinfo().pt_size = cast(ulong)scratch.current() - bootinfo().pt_phys; jump_to_hulk(); diff --git a/src/hulk/bootinfo.d b/src/hulk/bootinfo.d index bf3c237..f6c415f 100644 --- a/src/hulk/bootinfo.d +++ b/src/hulk/bootinfo.d @@ -67,4 +67,10 @@ struct BootInfo /* Physical address of stack while jumping to HULK. */ ulong stack_phys; + + /* Physical address of page tables while jumping to HULK. */ + ulong pt_phys; + + /* Size of page tables while jumping to HULK. */ + ulong pt_size; }