Page cover

Memory Map

Detailed memory layout of the NØNOS kernel.


Physical Memory Layout

The kernel is loaded at the standard x86 kernel location:

┌────────────────────────────────────────────────────────────────┐
│                    PHYSICAL MEMORY MAP                         │
├────────────────────────────────────────────────────────────────┤
│                                                                │
│  0x00000000 ─┬─ Real Mode IVT / BIOS Data                      │
│              │                                                 │
│  0x00100000 ─┼─ KERNEL LOAD ADDRESS (1 MB)                     │
│              │                                                 │
│              ├─ .multiboot    Bootloader handoff structure     │
│              │                                                 │
│  0x00101000 ─├─ .text         Executable code (R-X)            │
│              │                                                 │
│  0x00102000 ─├─ .rodata       Read-only data (R--)             │
│              │                                                 │
│  0x00103000 ─├─ .data         Initialized data (RW-)           │
│              │                                                 │
│  0x00104000 ─├─ .bss          Zero-initialized data (RW-)      │
│              │  __bss_start                                    │
│              │  __bss_end                                      │
│              │                                                 │
│  0x00105000 ─├─ .nonos.manifest   Kernel manifest (R--)        │
│              │  __nonos_manifest_start                         │
│              │  __nonos_manifest_end                           │
│              │                                                 │
│              ├─ .nonos.sig    Ed25519 signature (R--)          │
│              │  __nonos_signature_start                        │
│              │  __nonos_signature_end                          │
│              │  (aligned to 8 bytes)                           │
│              │                                                 │
│  0x001FF000 ─├─ __stack_bottom                                 │
│              │                                                 │
│              │  ┌────────────────────────┐                     │
│              │  │     KERNEL STACK       │                     │
│              │  │        64 KB           │                     │
│              │  │    (grows downward)    │                     │
│              │  └────────────────────────┘                     │
│              │                                                 │
│  0x0020F000 ─├─ __stack_top                                    │
│              │                                                 │
│              │  ... Heap / Dynamic Memory ...                  │
│              │                                                 │
└────────────────────────────────────────────────────────────────┘

Linker Script Symbols

The linker exports these symbols for runtime use:

Symbol
Description

__bss_start

Start of BSS section

__bss_end

End of BSS section

__nonos_manifest_start

Start of manifest section

__nonos_manifest_end

End of manifest section

__nonos_signature_start

Start of signature (64 bytes)

__nonos_signature_end

End of signature

__stack_bottom

Bottom of kernel stack

__stack_top

Top of kernel stack


Virtual Address Space

NØNOS uses higher-half kernel mapping:

Page Table Structure

NØNOS uses 4-level x86_64 paging:

Page Sizes

Size
Levels Used
Address Bits

4 KB

PML4 → PDPT → PD → PT

12

2 MB

PML4 → PDPT → PD (huge)

21

1 GB

PML4 → PDPT (huge)

30


Page Flags

Flag
Bit
Description

Present

0

Page is mapped

Writable

1

Write access allowed

User

2

User-mode accessible

Write-Through

3

Write-through caching

Cache Disable

4

Disable caching

Accessed

5

Page was accessed

Dirty

6

Page was written

Huge

7

2MB or 1GB page

Global

8

Don't flush from TLB

No-Execute

63

Disable code execution

W^X Enforcement

NØNOS enforces Write XOR Execute (W^X):

Section
Writable
Executable

.text

No

Yes

.rodata

No

No

.data

Yes

No

.bss

Yes

No

Heap

Yes

No

Stack

Yes

No

No page is ever both writable AND executable.


Stack Layout

Each task has its own stack with guard pages:


Heap Allocator

NØNOS uses a linked-list allocator:

Parameter
Value

Allocator Type

Linked-list

Thread Safety

Spinlock

Minimum Allocation

8 bytes

Page Allocation

≥4 KB direct

Growth

On demand


KASLR

Kernel Address Space Layout Randomization:

  • Kernel base randomized at boot

  • Stack locations randomized

  • Entropy source: RDRAND/RDSEED


Memory Regions from UEFI

The bootloader passes memory map from UEFI:

Type
Description
Usage

Conventional

Available RAM

Allocation

Reserved

Hardware reserved

Avoid

ACPI Reclaim

ACPI tables (reclaimable)

Parse then free

ACPI NVS

ACPI non-volatile

Preserve

Unusable

Defective memory

Avoid

Framebuffer

GPU memory

Display only

Last updated

Was this helpful?