Processes use separate four-level x86-64 page tables and share the kernel’s upper-half mappings. Threads within a process share its user address space. Pages are 4 KiB.

Address layout

Region Current layout

User heap

Begins after the loaded image; its break is bounded by 0xA0000000.

User virtual ranges

[0xA0000000, 0xC0000000), used for mappings, stacks and TLS.

Physical direct map

Physical address plus 0xffff800000000000.

Kernel virtual ranges

[0xffffff8090000000, 0xffffff89ffc00000).

Kernel heap

Starts at 0xffffff8a00000000.

Kernel image

Linked at 0xffffffff80000000.

Constants are in kernel/memory/constants.hpp. An address-range reservation is separate from its page mappings and physical-frame ownership.

Stacks and mappings

User stacks reserve ten pages, including an unmapped guard page. One page is initially committed; missing-page faults grow the stack within its reservation. Kernel and interrupt stacks reserve nine pages each, with eight committed pages and a guard. Kernel stacks cannot depend on fault-time growth.

Fresh user pages are cleared before publication. Removing a mapping completes remote TLB invalidation before its frame can be reused. RAM aliases retain frame references; device mappings are non-owning and never return MMIO frames to the RAM allocator. Internal stack/TLS reservations are released by task teardown, not public g_unmap.

The bitmap allocator manages physical pages; virtual range pools manage address reservations. The kernel heap uses size-class buckets and coalesced larger sections. Fallible page allocation retains a recovery reserve, but critical kernel metadata exhaustion can still be fatal.