Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Memory Management

This document describes the memory management subsystem of the Kyronix kernel. It is the child of Kernel and parent of memory management component documents.

Architecture

The memory management subsystem consists of four layers:

  • LL-Free (llfree.c) – Lock-free physical frame allocator
  • PMM (pmm.c) – Physical page allocation
  • VMM / VMA (vmm.c, vma.c) – Virtual memory and area tracking
  • Heap / SHM (heap.c, shm.c) – Kernel heap and shared memory

Components

ComponentSourceDescription
PMMmm/pmm.cPhysical page allocation via LL-Free
VMMmm/vmm.c4-level page table management
VMAmm/vma.cVirtual Memory Area tracking
Heapmm/heap.cKernel heap (first-fit linked list)
SHMmm/shm.cSysV shared memory (up to 64 segments)
LL-Freemm/llfree.cLock-free physical frame allocator
KmemLeakmm/kmemleak.cKernel memory leak detector

Key Constants

ConstantValueDescription
PAGE_SIZE4096Page frame size
PAGE_SHIFT12Bit shift for page-to-byte conversion
HEAP_START0xffff910000000000Heap virtual address base
HEAP_MAX0xffff920000000000Maximum heap address (4 GiB)
USER_LIMIT0x800000000000Top of user half (128 TiB)
VMM_MAX_SPACES256Maximum concurrent address spaces
VMM_VMA_MAX2048Maximum VMAs per address space

Last reviewed: 2026-07-22