summaryrefslogtreecommitdiff
path: root/Kernel/Prekernel
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-03-22 13:40:21 +0200
committerAndreas Kling <kling@serenityos.org>2022-03-22 16:46:51 +0100
commite18632660f29ba9e69dfaed18465af95edcc32b9 (patch)
tree139787387d56c4e2c62c8af6900c2e73a7f73e1e /Kernel/Prekernel
parentd850e483f7b23b848ed6f04befc3fa9f3da98893 (diff)
downloadserenity-e18632660f29ba9e69dfaed18465af95edcc32b9.zip
Kernel: Use the pre-image kernel memory range introduced by KASLR
This ensures we don't just waste the memory range between the default base load address and the actual load address that was shifted by the KASLR offset.
Diffstat (limited to 'Kernel/Prekernel')
-rw-r--r--Kernel/Prekernel/Prekernel.h1
-rw-r--r--Kernel/Prekernel/init.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Prekernel/Prekernel.h b/Kernel/Prekernel/Prekernel.h
index 92d1239a71..b01f5eeb66 100644
--- a/Kernel/Prekernel/Prekernel.h
+++ b/Kernel/Prekernel/Prekernel.h
@@ -22,6 +22,7 @@ struct [[gnu::packed]] BootInfo {
u32 end_of_prekernel_image;
u64 physical_to_virtual_offset;
u64 kernel_mapping_base;
+ u64 default_kernel_load_base;
u64 kernel_load_base;
# if ARCH(X86_64)
u32 gdt64ptr;
diff --git a/Kernel/Prekernel/init.cpp b/Kernel/Prekernel/init.cpp
index 9fced041a2..3692998cfc 100644
--- a/Kernel/Prekernel/init.cpp
+++ b/Kernel/Prekernel/init.cpp
@@ -184,6 +184,7 @@ extern "C" [[noreturn]] void init()
info.end_of_prekernel_image = (PhysicalPtr)end_of_prekernel_image;
info.physical_to_virtual_offset = kernel_load_base - kernel_physical_base;
info.kernel_mapping_base = kernel_mapping_base;
+ info.default_kernel_load_base = default_kernel_load_base;
info.kernel_load_base = kernel_load_base;
#if ARCH(X86_64)
info.gdt64ptr = (PhysicalPtr)gdt64ptr;