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:
parent
cdf59c86ac
commit
a62732ee2f
3 changed files with 17 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue