Module mm

Module mm 

Source
Expand description

memory management unit

Modules§

pma 🔒
(deprecated) a simple stack based 4K physical frame allocator.
vmm
a very simple virtual memory manager

Structs§

KSTACK_ALLOCATOR
KStackAllocator
wrapper around the global allocator with caching

Constants§

LAYOUT_4K_ALIGNED 🔒

Statics§

ALLOCATOR 🔒

Functions§

allocate_4k
allocate 4k aligned memory. TODO create a buffer (like in KStackAllocator) for performance.
allocate_4k_zeroed
drop_init_mapping
drop the low memory mapping from the current pagetable by removing the first entry from pml4 table (which mapps to 0~512G). The PDP table is unchanged, wasting 4K of memory but there is nothing we can do now since the heap allocator doesn’t manage this address.
flush_tlb
flush the whole tlb
init
half measure: simply initialize the linkedlist allocator
invlpg
invalidate a single page mapping in tlb