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

Give each task its own page directory.

This isn't finished but I'll commit as I go. We need to get to where context
switching only needs to change CR3 and everything's ready to go.

My basic idea is:
- The first 4 kB is off-limits. This catches null dereferences.
- Up to the 4 MB mark is identity-mapped and kernel-only.
- The rest is available to everyone!

While the first 4 MB is only available to the kernel, it's still mapped in
every process, for convenience when entering the kernel.
This commit is contained in:
Andreas Kling 2018-11-01 09:01:51 +01:00
parent cddd2f37e9
commit 1da0a7c949
7 changed files with 47 additions and 15 deletions

View file

@ -65,6 +65,8 @@ public:
void registerZone(Zone&);
void unregisterZone(Zone&);
void populatePageDirectory(Task&);
private:
MemoryManager();
~MemoryManager();
@ -158,7 +160,7 @@ private:
dword* m_pte;
};
PageTableEntry ensurePTE(LinearAddress);
PageTableEntry ensurePTE(dword* pageDirectory, LinearAddress);
dword* m_pageDirectory;
dword* m_pageTableZero;