1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 10:14:58 +00:00

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.
This commit is contained in:
Idan Horowitz 2022-03-22 13:40:21 +02:00 committed by Andreas Kling
parent d850e483f7
commit e18632660f
5 changed files with 11 additions and 3 deletions

View file

@ -116,6 +116,7 @@ READONLY_AFTER_INIT PhysicalAddress start_of_prekernel_image;
READONLY_AFTER_INIT PhysicalAddress end_of_prekernel_image;
READONLY_AFTER_INIT size_t physical_to_virtual_offset;
READONLY_AFTER_INIT FlatPtr kernel_mapping_base;
READONLY_AFTER_INIT FlatPtr default_kernel_load_base;
READONLY_AFTER_INIT FlatPtr kernel_load_base;
#if ARCH(X86_64)
READONLY_AFTER_INIT PhysicalAddress boot_pml4t;
@ -148,6 +149,7 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init(BootInfo const& boot_info)
end_of_prekernel_image = PhysicalAddress { boot_info.end_of_prekernel_image };
physical_to_virtual_offset = boot_info.physical_to_virtual_offset;
kernel_mapping_base = boot_info.kernel_mapping_base;
default_kernel_load_base = boot_info.default_kernel_load_base;
kernel_load_base = boot_info.kernel_load_base;
#if ARCH(X86_64)
gdt64ptr = boot_info.gdt64ptr;