1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-03 05:32:13 +00:00

Kernel/aarch64: Only identity map kernel image, instead of all of RAM

For the initial page tables we only need to identity map the kernel
image, the rest of the memory will be managed by the MemoryManager. The
linker script is updated to get the kernel image start and end
addresses.
This commit is contained in:
Timon Kruiper 2022-09-21 16:16:39 +02:00 committed by Andreas Kling
parent cdf59c86ac
commit a62732ee2f
3 changed files with 17 additions and 3 deletions

View file

@ -72,8 +72,14 @@ bool MemoryManager::is_initialized()
static UNMAP_AFTER_INIT VirtualRange kernel_virtual_range()
{
#if ARCH(AARCH64)
// NOTE: We currently identity map the kernel image for aarch64, so the kernel virtual range
// is the complete memory range.
return VirtualRange { VirtualAddress((FlatPtr)0), 0x3F000000 };
#else
size_t kernel_range_start = kernel_mapping_base + 2 * MiB; // The first 2 MiB are used for mapping the pre-kernel
return VirtualRange { VirtualAddress(kernel_range_start), KERNEL_PD_END - kernel_range_start };
#endif
}
MemoryManager::GlobalData::GlobalData()