# reliefosproject/reliefnt architecture

> Architecture diagram of the GitHub repository reliefosproject/reliefnt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reliefosproject/reliefnt
- Repository: https://github.com/reliefosproject/reliefnt

## Overview

ReliefNT is the kernel-side repository for ReliefOS: it contains the x86-64 boot loader, Ring-0 kernel, bootstrap drivers and storage stack, kernel debugger, and UAPI headers—not a userland or image-building product. The main runtime path is boot into the kernel, then kernel services and drivers provide process, memory, filesystem, and device operations. README and source excerpts support the broad subsystem map, but do not expose the full boot-to-kernel or syscall dispatch wiring; those relationships are therefore omitted or marked unverified.

Main entry points: [`kernel/reliefnt/kernel.c`](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/kernel.c) (Kernel Runtime), [`drivers/bootstrap/storage.c`](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage.c) (Storage Facade), [`kernel/reliefnt/driver_manager.c`](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/driver_manager.c) (Driver Manager), [`kernel/reliefnt/syscall.c`](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/syscall.c) (System Calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and Architecture"]
  node_loader["Boot Loader<br/>[main.c]"]
  node_arch["x86-64 Platform<br/>[arch.c]"]
  node_interrupts["Interrupt Setup<br/>[idt.c]"]
end

subgraph group_core["Kernel Core"]
  node_kernel["Kernel Runtime<br/>[kernel.c]"]
  node_scheduler["Task Scheduler<br/>[sched.c]"]
  node_memory["Memory Manager<br/>[mm.c]"]
  node_exec["Program Execution<br/>[userland.c]"]
  node_elf["ELF Loader<br/>[elf.c]"]
end

subgraph group_storage["Storage and Filesystems"]
  node_storage_facade["Storage Facade<br/>[storage.c]"]
  node_block_io["Block I/O<br/>[storage_block.c]"]
  node_disk_management["Disk Management<br/>[storage_disk.c]"]
  node_fs_vfs["Storage VFS<br/>[storage_vfs.c]"]
  node_exfat["exFAT Backend<br/>[storage_exfat.c]"]
  node_ext4["ext4 Backend"]
  node_fs_views["Proc and Sys Filesystems<br/>[procfs.c]"]
end

subgraph group_devices["Devices and I/O"]
  node_driver_manager["Driver Manager<br/>[driver_manager.c]"]
  node_network["Network Stack<br/>[net.c]"]
  node_graphics["SVGA Graphics<br/>[render.c]"]
  node_audio["AC97 Audio<br/>[ac97.c]"]
end

subgraph group_interfaces["Interfaces and Diagnostics"]
  node_syscalls["System Calls<br/>[syscall.c]"]
  node_debugger["Kernel Debugger<br/>[kerneldebug.c]"]
  node_uapi["Kernel UAPI<br/>[syscall_abi.h]"]
end

node_firmware(("Platform Firmware"))

node_firmware -.->|"starts"| node_loader
node_loader -.->|"hands off"| node_kernel
node_kernel -.->|"initializes"| node_arch
node_arch -.->|"configures"| node_interrupts
node_kernel -.->|"runs tasks"| node_scheduler
node_kernel -.->|"uses"| node_memory
node_exec -.->|"loads"| node_elf
node_syscalls -.->|"dispatches"| node_exec
node_syscalls -.->|"implements ABI"| node_uapi
node_storage_facade -->|"includes"| node_block_io
node_storage_facade -->|"includes"| node_exfat
node_storage_facade -->|"includes"| node_ext4
node_storage_facade -->|"includes"| node_fs_vfs
node_storage_facade -->|"includes"| node_disk_management
node_fs_vfs -->|"reads files"| node_exfat
node_driver_manager -.->|"manages lifecycle"| node_kernel
node_kernel -.->|"provides networking"| node_network
node_kernel -.->|"exposes system state"| node_fs_views
node_driver_manager -.->|"registers drivers"| node_graphics
node_driver_manager -.->|"registers drivers"| node_audio
node_debugger -.->|"debugs"| node_kernel

click node_loader "https://github.com/reliefosproject/reliefnt/blob/main/boot/loader/main.c"
click node_arch "https://github.com/reliefosproject/reliefnt/blob/main/arch/x86_64/arch.c"
click node_interrupts "https://github.com/reliefosproject/reliefnt/blob/main/arch/x86_64/idt.c"
click node_kernel "https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/kernel.c"
click node_scheduler "https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/sched/sched.c"
click node_memory "https://github.com/reliefosproject/reliefnt/blob/main/mm/mm.c"
click node_exec "https://github.com/reliefosproject/reliefnt/blob/main/kernel/exec/userland.c"
click node_elf "https://github.com/reliefosproject/reliefnt/blob/main/kernel/exec/elf.c"
click node_syscalls "https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/syscall.c"
click node_storage_facade "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage.c"
click node_block_io "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_block.c"
click node_disk_management "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_disk.c"
click node_fs_vfs "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_vfs.c"
click node_exfat "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_exfat.c"
click node_ext4 "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_ext4_mount.c"
click node_fs_views "https://github.com/reliefosproject/reliefnt/blob/main/fs/procfs.c"
click node_driver_manager "https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/driver_manager.c"
click node_network "https://github.com/reliefosproject/reliefnt/blob/main/net/net.c"
click node_graphics "https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/svga/render.c"
click node_audio "https://github.com/reliefosproject/reliefnt/blob/main/drivers/ac97/ac97.c"
click node_debugger "https://github.com/reliefosproject/reliefnt/blob/main/debug/kerneldebug.c"
click node_uapi "https://github.com/reliefosproject/reliefnt/blob/main/include/uapi/leonos/syscall_abi.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loader,node_arch,node_interrupts toneBlue
class node_kernel,node_scheduler,node_memory,node_exec,node_elf toneAmber
class node_storage_facade,node_block_io,node_disk_management,node_fs_vfs,node_exfat,node_ext4,node_fs_views toneMint
class node_driver_manager,node_network,node_graphics,node_audio toneRose
class node_syscalls,node_debugger,node_uapi,node_firmware toneIndigo
```

## Components

### Boot and Architecture

- [Boot Loader](https://github.com/reliefosproject/reliefnt/blob/main/boot/loader/main.c): `boot/loader/main.c`
- [x86-64 Platform](https://github.com/reliefosproject/reliefnt/blob/main/arch/x86_64/arch.c): `arch/x86_64/arch.c`
- [Interrupt Setup](https://github.com/reliefosproject/reliefnt/blob/main/arch/x86_64/idt.c): `arch/x86_64/idt.c`

### Kernel Core

- [Kernel Runtime](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/kernel.c): `kernel/reliefnt/kernel.c`
- [Task Scheduler](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/sched/sched.c): `kernel/reliefnt/sched/sched.c`
- [Memory Manager](https://github.com/reliefosproject/reliefnt/blob/main/mm/mm.c): `mm/mm.c`
- [Program Execution](https://github.com/reliefosproject/reliefnt/blob/main/kernel/exec/userland.c): `kernel/exec/userland.c`
- [ELF Loader](https://github.com/reliefosproject/reliefnt/blob/main/kernel/exec/elf.c): `kernel/exec/elf.c`

### Storage and Filesystems

- [Storage Facade](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage.c): `drivers/bootstrap/storage.c`
- [Block I/O](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_block.c): `drivers/bootstrap/storage/storage_block.c`
- [Disk Management](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_disk.c): `drivers/bootstrap/storage/storage_disk.c`
- [Storage VFS](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_vfs.c): `drivers/bootstrap/storage/storage_vfs.c`
- [exFAT Backend](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_exfat.c): `drivers/bootstrap/storage/storage_exfat.c`
- [ext4 Backend](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/storage/storage_ext4_mount.c): `drivers/bootstrap/storage/storage_ext4_mount.c`
- [Proc and Sys Filesystems](https://github.com/reliefosproject/reliefnt/blob/main/fs/procfs.c): `fs/procfs.c`

### Devices and I/O

- [Driver Manager](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/driver_manager.c): `kernel/reliefnt/driver_manager.c`
- [Network Stack](https://github.com/reliefosproject/reliefnt/blob/main/net/net.c): `net/net.c`
- [SVGA Graphics](https://github.com/reliefosproject/reliefnt/blob/main/drivers/bootstrap/svga/render.c): `drivers/bootstrap/svga/render.c`
- [AC97 Audio](https://github.com/reliefosproject/reliefnt/blob/main/drivers/ac97/ac97.c): `drivers/ac97/ac97.c`

### Interfaces and Diagnostics

- [System Calls](https://github.com/reliefosproject/reliefnt/blob/main/kernel/reliefnt/syscall.c): `kernel/reliefnt/syscall.c`
- [Kernel Debugger](https://github.com/reliefosproject/reliefnt/blob/main/debug/kerneldebug.c): `debug/kerneldebug.c`
- [Kernel UAPI](https://github.com/reliefosproject/reliefnt/blob/main/include/uapi/leonos/syscall_abi.h): `include/uapi/leonos/syscall_abi.h`

### Other components

- **Platform Firmware**

## Connections

- Platform Firmware → Boot Loader: starts
- Boot Loader → Kernel Runtime: hands off
- Kernel Runtime → x86-64 Platform: initializes
- x86-64 Platform → Interrupt Setup: configures
- Kernel Runtime → Task Scheduler: runs tasks
- Kernel Runtime → Memory Manager: uses
- Program Execution → ELF Loader: loads
- System Calls → Program Execution: dispatches
- System Calls → Kernel UAPI: implements ABI
- Storage Facade → Block I/O: includes (evidence: `drivers/bootstrap/storage.c`)
- Storage Facade → exFAT Backend: includes (evidence: `drivers/bootstrap/storage.c`)
- Storage Facade → ext4 Backend: includes (evidence: `drivers/bootstrap/storage.c`)
- Storage Facade → Storage VFS: includes (evidence: `drivers/bootstrap/storage.c`)
- Storage Facade → Disk Management: includes (evidence: `drivers/bootstrap/storage.c`)
- Storage VFS → exFAT Backend: reads files (evidence: `drivers/bootstrap/storage/storage_vfs.c`)
- Driver Manager → Kernel Runtime: manages lifecycle
- Kernel Runtime → Network Stack: provides networking
- Kernel Runtime → Proc and Sys Filesystems: exposes system state
- Driver Manager → SVGA Graphics: registers drivers
- Driver Manager → AC97 Audio: registers drivers
- Kernel Debugger → Kernel Runtime: debugs
