-
-
Notifications
You must be signed in to change notification settings - Fork 5
Memory Management
kazah-png edited this page Jul 6, 2026
·
7 revisions
NyxOS uses a layered memory strategy: bitmap physical allocator, 4-level paging, kernel heap, and slab caches.
See also: Architecture, Boot Process, Process Management, Security
Bitmap tracking each 4 KB page, up to 512 MB max RAM. alloc_page() / free_page().
PML4 → PDPT → PD → PT → 4 KB page. Higher-half kernel at PML4[511]. Identity-mapped first 64 MB.
-
Demand paging: PTE bit 9 (
PTE_DEMAND) — allocate zeroed page on first touch via #PF handler -
Copy-on-write: PTE bit 10 (
PTE_COW) — private copy on write fault via #PF handler (used byfork(), see Process Management) - NX bit: Non-executable user stack/data pages
- CR0.WP: Supervisor writes to read-only pages fault (required for COW)
16 MB heap with free-list, header/footer metadata, coalescing. kmalloc/kfree with slab fallback.
Fixed-size caches: 8, 16, 32, 64, 128, 256, 512, 1024 bytes.
NyxOS v6.4.363 · GPL v2 · GitHub · uselessalter on Discord · nyxos@inbox.lv
NyxOS Wiki
Getting started
Kernel
Storage & network
Graphics & apps
Userspace
HOWTO
- HOWTO-Add-a-system-call
- HOWTO-Write-a-userspace-program
- HOWTO-Add-a-shell-command
- HOWTO-Add-a-GUI-application
Reference
- Syscall-Reference
- Command-Reference
- Hardware-Reference
- Format-Reference
- Kernel-Data-Structures
- Source-Tree-Reference
Project