1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +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

@ -3,6 +3,7 @@
void kmalloc_init();
void *kmalloc(DWORD size) __attribute__ ((malloc));
void* kmalloc_eternal(size_t) __attribute__ ((malloc));
void* kmalloc_page_aligned(size_t) __attribute__ ((malloc));
void kfree(void*);
bool is_kmalloc_address(void*);
@ -10,6 +11,7 @@ bool is_kmalloc_address(void*);
extern volatile DWORD sum_alloc;
extern volatile DWORD sum_free;
extern volatile dword kmalloc_sum_eternal;
extern volatile dword kmalloc_sum_page_aligned;
inline void* operator new(size_t, void* p) { return p; }
inline void* operator new[](size_t, void* p) { return p; }