Simon Zeni: 2
init_mmu: remove G bit on PML4E and PDPE
move call to init_mmu function after call to ExitBootServices
2 files changed, 8 insertions(+), 8 deletions(-)
For a reason that is yet to be found, calling the `init_mmu` function
before ExitBootServices causes a GP fault on kernel entry on Intel.
Moving the function call past ExitBootServices fixes the issue on Intel,
and doesn't change anything on AMD.
---
src/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
index 164df5d..3e132bc 100644
--- a/src/main.c+++ b/src/main.c
@@ -55,11 +55,11 @@ efi_main(efi_handle image, efi_system_table *systab)
close(kernel);
- init_mmu();- bprintfln("Exit boot services");
systab->BootServices->ExitBootServices(image, map_key);
+ init_mmu();+ entry();
return EFI_LOAD_ERROR; // Unreachable
--
2.41.0