# kierasword/nevos architecture

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

- Interactive diagram: https://gitdiagram.com/kierasword/nevos
- Repository: https://github.com/kierasword/nevos

## Overview

NevOS is a small x86_32 protected-mode kernel and OS. The visible startup path initializes FAT and the RTC, loads `program.nxe`, and enters user mode; the kernel also exposes syscall dispatch and exception handlers, console/key input, and FAT file operations. Most behavior is implemented together in `src/kernel.c`, so nodes separate its responsibilities rather than imply separate modules. The excerpts do not show boot assembly or the program’s relationship to the loaded executable, so those links are omitted or marked unverified.

Main entry points: [`src/kernel.c`](https://github.com/kierasword/nevos/blob/master/src/kernel.c) (Kernel startup), [`src/boot.asm`](https://github.com/kierasword/nevos/blob/master/src/boot.asm) (Boot entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Kernel startup"]
  node_boot["Boot entry<br/>[boot.asm]"]
  node_kernel_start["Kernel startup<br/>[kernel.c]"]
  node_user_loader["User-mode launch<br/>[kernel.c]"]
end

subgraph group_services["Kernel services"]
  node_syscalls["Syscall dispatch<br/>[kernel.c]"]
  node_exceptions["Exception handling<br/>[kernel.c]"]
  node_console["Console I/O<br/>[kernel.c]"]
  node_keyboard["Keyboard input<br/>[kernel.c]"]
end

subgraph group_devices["Storage and devices"]
  node_fat["FAT filesystem<br/>[kernel.c]"]
  node_disk_io["Sector I/O<br/>[kernel.c]"]
  node_rtc["RTC timekeeping<br/>[kernel.c]"]
end

node_x86_hw(("x86 hardware"))

node_boot -.->|"enters"| node_kernel_start
node_kernel_start -->|"mounts"| node_fat
node_kernel_start -->|"reads clock"| node_rtc
node_kernel_start -->|"loads program"| node_fat
node_kernel_start -->|"enters user mode"| node_user_loader
node_syscalls -->|"dispatches file calls"| node_fat
node_syscalls -->|"dispatches time call"| node_rtc
node_exceptions -->|"reports faults"| node_console
node_kernel_start -->|"reads sectors"| node_disk_io
node_fat -->|"reads and writes"| node_disk_io
node_console -->|"writes display or serial"| node_x86_hw
node_keyboard -->|"reads input"| node_x86_hw
node_rtc -->|"reads registers"| node_x86_hw

click node_boot "https://github.com/kierasword/nevos/blob/master/src/boot.asm"
click node_kernel_start "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_user_loader "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_syscalls "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_exceptions "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_console "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_keyboard "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_fat "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_disk_io "https://github.com/kierasword/nevos/blob/master/src/kernel.c"
click node_rtc "https://github.com/kierasword/nevos/blob/master/src/kernel.c"

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_boot,node_kernel_start,node_user_loader toneBlue
class node_syscalls,node_exceptions,node_console,node_keyboard toneAmber
class node_fat,node_disk_io,node_rtc toneMint
class node_x86_hw toneIndigo
```

## Components

### Kernel startup

- [Boot entry](https://github.com/kierasword/nevos/blob/master/src/boot.asm): `src/boot.asm`
- [Kernel startup](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`
- [User-mode launch](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`

### Kernel services

- [Syscall dispatch](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`
- [Exception handling](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`
- [Console I/O](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`
- [Keyboard input](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`

### Storage and devices

- [FAT filesystem](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`
- [Sector I/O](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`
- [RTC timekeeping](https://github.com/kierasword/nevos/blob/master/src/kernel.c): `src/kernel.c`

### Other components

- **x86 hardware**

## Connections

- Boot entry → Kernel startup: enters
- Kernel startup → FAT filesystem: mounts (evidence: `src/kernel.c`)
- Kernel startup → RTC timekeeping: reads clock (evidence: `src/kernel.c`)
- Kernel startup → FAT filesystem: loads program (evidence: `src/kernel.c`)
- Kernel startup → User-mode launch: enters user mode (evidence: `src/kernel.c`)
- Syscall dispatch → FAT filesystem: dispatches file calls (evidence: `src/kernel.c`)
- Syscall dispatch → RTC timekeeping: dispatches time call (evidence: `src/kernel.c`)
- Exception handling → Console I/O: reports faults (evidence: `src/kernel.c`)
- Kernel startup → Sector I/O: reads sectors (evidence: `src/kernel.c`)
- FAT filesystem → Sector I/O: reads and writes (evidence: `src/kernel.c`)
- Console I/O → x86 hardware: writes display or serial (evidence: `src/kernel.c`)
- Keyboard input → x86 hardware: reads input (evidence: `src/kernel.c`)
- RTC timekeeping → x86 hardware: reads registers (evidence: `src/kernel.c`)
