|
My Kernel v0.1.0
|
Virtual Memory Manager. More...
#include <vmm.h>
Data Structures | |
| struct | vmm_vma_roots |
| Roots of the AVL trees containing the VMAs. More... | |
Public Member Functions | |
| BITMAP (reserved, VMM_RESERVED_SIZE/VMA_SIZE) | |
| Bitmap of the available virtual addreses inside the reserved area. More... | |
Data Fields | |
| vaddr_t | start |
| vaddr_t | end |
| spinlock_t | lock |
A VMM is responsible for managing the allocated virtual addresses within a process.
The VMM splits the address space into distinct regions called Virtual Memory Areas, and keeps track of them individually using AVL trees.
A VMM does not necessarily manage the full 32bits address space, instead it is assigned a start and end addresses, and only keeps track of the regions inside this range.
The VMM uses two different AVL trees to keep track of the VMAs:
| vmm::BITMAP | ( | reserved | , |
| VMM_RESERVED_SIZE/ | VMA_SIZE | ||
| ) |
TODO: Using a bitmap for this takes 2KiB of memory per VMM (so per process)! Is there a less expensive way to keep track of them?
| vaddr_t vmm::end |
The end of the VMM's assigned range (excluded)
| spinlock_t vmm::lock |
Used restrict access to the VMM when modifying it
| vaddr_t vmm::start |
The start of the VMM's assigned range