Skip to main content

Module address_space

Module address_space 

Source
Expand description

Per-process address spaces for Strat9-OS.

Each task owns an AddressSpace backed by a PML4 page table. Kernel tasks share a single kernel address space. User tasks get a fresh PML4 with the kernel half (entries 256..512) cloned from the kernel’s table.

PML4 is the Page Map Level 4, the top-level page table in x86_64’s 4-level paging scheme. It contains 512 entries, each covering a 512 GiB region of the virtual address space. By cloning the kernel half of the PML4, each user address space automatically shares the kernel mappings without needing to duplicate them. Source : https://wiki.osdev.org/Memory_Management

x86_64 virtual address space layout:

  • PML4[0..256] => user space (per-process, zeroed for new AS)
  • PML4[256..512] => kernel space (shared, cloned from kernel L4)

Structs§

AddressSpace
A per-process address space backed by a PML4 page table.
EffectiveMapping
An effective mapping currently installed in the page tables.
VirtualMemoryRegion
A tracked virtual memory region within an address space.
VmaFlags
Flags describing permissions for a virtual memory region.

Enums§

VmaPageSize
Supported page sizes for VMAs.
VmaType
Type/purpose of a virtual memory region.

Functions§

init_kernel_address_space
Initialize the kernel address space singleton.
kernel_address_space
Get a reference to the kernel address space.