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
 

Detailed Description

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:

  • Ordered by address to easily retrieve the area to which an address belongs.
  • Ordered by size to retrieve the first fitting area when allocating
Note
The tree ordered by size does not keep track of used areas, since we never need to search for un-free area by size. This avoid modifying the trees more than we need to, since it can be costly.

Member Function Documentation

◆ BITMAP()

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?

Field Documentation

◆ end

vaddr_t vmm::end

The end of the VMM's assigned range (excluded)

◆ lock

spinlock_t vmm::lock

Used restrict access to the VMM when modifying it

◆ start

vaddr_t vmm::start

The start of the VMM's assigned range


The documentation for this struct was generated from the following file: