mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +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:
parent
cddd2f37e9
commit
1da0a7c949
7 changed files with 47 additions and 15 deletions
|
@ -172,9 +172,9 @@ ByteBuffer procfs$mounts()
|
|||
ByteBuffer procfs$kmalloc()
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
auto buffer = ByteBuffer::createUninitialized(128);
|
||||
auto buffer = ByteBuffer::createUninitialized(256);
|
||||
char* ptr = (char*)buffer.pointer();
|
||||
ptr += ksprintf(ptr, "eternal: %u\nallocated: %u\nfree: %u\n", kmalloc_sum_eternal, sum_alloc, sum_free);
|
||||
ptr += ksprintf(ptr, "eternal: %u\npage-aligned: %u\nallocated: %u\nfree: %u\n", kmalloc_sum_eternal, sum_alloc, sum_free);
|
||||
buffer.trim(ptr - (char*)buffer.pointer());
|
||||
return buffer;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue