Repository navigation
Memory Management
kmalloc / kfree liballoc 1.1 on 2 MB pages mm/heap.hpp
AddressSpace 2 MB pages, recursive page tables mm/vmm.cpp
PhysicalMemoryManager 2 MB blocks + 4 KB frames mm/pmm.cpp
PhysicalMemoryManager keeps one bit per 2 MB block. Its bitmap is passed
in, so the capacity is the caller's choice (the kernel's covers 256 GB) and
the self tests can build small instances: the manager only does bookkeeping
and never touches the memory it describes. Page tables get 4 KB frames cut
from 2 MB blocks. Memory::populateFromMultiboot fills it from the
multiboot memory map and reserves the kernel image.
AddressSpace maps 2 MB pages above the kernel and reaches the page tables through a recursive mapping in PML4[510], so it never needs physical addresses to be mapped. It takes its physical memory from the PhysicalMemoryManager given to its constructor.
Heap: liballoc asks for pages through C hooks; kernelMain binds the
kernel address space to them once with Memory::setHeapAddressSpace.
More: docs/memory.md