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

Kernel: Let PageDirectory own the associated RangeAllocator.

Since we transition to a new PageDirectory on exec(), we need a matching
RangeAllocator to go with the new directory. Instead of juggling this in
Process and MemoryManager, simply attach the RangeAllocator to the
PageDirectory instead.

Fixes #61.
This commit is contained in:
Andreas Kling 2019-05-20 04:46:29 +02:00
parent d65114afd7
commit bcc6ddfb6b
6 changed files with 16 additions and 16 deletions

View file

@ -3,12 +3,17 @@
#include <Kernel/Process.h>
#include <Kernel/Thread.h>
static const dword userspace_range_base = 0x01000000;
static const dword kernelspace_range_base = 0xc0000000;
PageDirectory::PageDirectory(PhysicalAddress paddr)
: m_range_allocator(LinearAddress(0xc0000000), 0x3f000000)
{
m_directory_page = PhysicalPage::create_eternal(paddr, true);
}
PageDirectory::PageDirectory()
: m_range_allocator(LinearAddress(userspace_range_base), kernelspace_range_base - userspace_range_base)
{
MM.populate_page_directory(*this);
}