diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-03-22 13:40:21 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-22 16:46:51 +0100 |
commit | e18632660f29ba9e69dfaed18465af95edcc32b9 (patch) | |
tree | 139787387d56c4e2c62c8af6900c2e73a7f73e1e /Kernel/Prekernel | |
parent | d850e483f7b23b848ed6f04befc3fa9f3da98893 (diff) | |
download | serenity-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.h | 1 | ||||
-rw-r--r-- | Kernel/Prekernel/init.cpp | 1 |
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; |