1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +00:00

Kernel: Make and use KERNEL_BASE

This is to make the 0xc0000000 less a magic number, and will make it
easier in the future to move the Kernel around
This commit is contained in:
Hendiadyoin1 2021-06-28 18:43:18 +02:00 committed by Andreas Kling
parent 8b44aa7885
commit 65566d6868
7 changed files with 12 additions and 9 deletions

View file

@ -37,7 +37,7 @@ extern "C" PageDirectoryEntry boot_pd3[1024];
UNMAP_AFTER_INIT PageDirectory::PageDirectory()
{
m_range_allocator.initialize_with_range(VirtualAddress(0xc2000000), 0x2f000000);
m_range_allocator.initialize_with_range(VirtualAddress(KERNEL_BASE + 0x02000000), 0x2f000000);
m_identity_range_allocator.initialize_with_range(VirtualAddress(FlatPtr(0x00000000)), 0x00200000);
// Adopt the page tables already set up by boot.S
@ -89,7 +89,7 @@ PageDirectory::PageDirectory(const RangeAllocator* parent_range_allocator)
m_directory_pages[2] = MM.allocate_user_physical_page();
if (!m_directory_pages[2])
return;
// Share the top 1 GiB of kernel-only mappings (>=3GiB or >=0xc0000000)
// Share the top 1 GiB of kernel-only mappings (>=3GiB or >=KERNEL_BASE)
m_directory_pages[3] = MM.kernel_page_directory().m_directory_pages[3];
#if ARCH(X86_64)