# staycool1374-ger/nexios architecture

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

- Interactive diagram: https://gitdiagram.com/staycool1374-ger/nexios
- Repository: https://github.com/staycool1374-ger/nexios

## Overview

NexIOS is a freestanding real-time operating system whose central workflow is launching user programs under kernel control: a user enters commands through the shell, the kernel loads ELF tasks, maps their address spaces, grants capabilities, and schedules them. System calls connect tasks to kernel services such as IPC, filesystems, and synchronization; architecture-specific code handles hardware interrupts and faults. The README also describes process isolation and fault termination, while filesystem, driver, and network components are visible in the tree. Some subsystem links are documented capabilities rather than verified calls in the sampled source.

Main entry points: [`src/kernel/syscall/syscall.cpp`](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/syscall/syscall.cpp) (System calls), [`src/kernel/elf/elf_loader.cpp`](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/elf/elf_loader.cpp) (ELF loader), [`src/kernel/vfs/vfs.cpp`](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/vfs/vfs.cpp) (Virtual filesystem), [`src/kernel/driver/driver.cpp`](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/driver/driver.cpp) (Device drivers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_user["User interface"]
  node_shell["Shell<br/>[shell.cpp]"]
  node_terminal["Terminal<br/>[terminal.cpp]"]
  node_userapps["User programs<br/>[user-app.c]"]
end

subgraph group_execution["Process execution"]
  node_elf["ELF loader<br/>[elf_loader.cpp]"]
  node_tasks["Task management<br/>[task.cpp]"]
  node_scheduler["Real-time scheduler<br/>[scheduler.cpp]"]
  node_faults["Fault handling"]
end

subgraph group_kernel["Kernel services"]
  node_syscalls["System calls<br/>[syscall.cpp]"]
  node_ipc["IPC<br/>[ipc.cpp]"]
  node_vfs["Virtual filesystem<br/>[vfs.cpp]"]
  node_sync["Synchronization<br/>[sync.cpp]"]
end

subgraph group_protection["Memory and security"]
  node_caps["Capabilities<br/>[cap.cpp]"]
  node_vmm["Virtual memory<br/>[vmm.cpp]"]
  node_pmm["Physical memory<br/>[pmm.cpp]"]
end

subgraph group_platform["Platform I/O"]
  node_initrd["Initrd<br/>[initrd.cpp]"]
  node_drivers["Device drivers<br/>[driver.cpp]"]
  node_network["Network stack<br/>[net.cpp]"]
  node_hal["Architecture HAL"]
end

node_operator(("User"))

node_operator -->|"enters commands"| node_terminal
node_terminal -->|"forwards input"| node_shell
node_shell -->|"loads ELF"| node_elf
node_elf -->|"creates task"| node_tasks
node_tasks -->|"schedules task"| node_scheduler
node_userapps -->|"requests services"| node_syscalls
node_syscalls -->|"dispatches filesystem calls"| node_vfs
node_syscalls -->|"dispatches IPC calls"| node_ipc
node_syscalls -->|"checks capabilities"| node_caps
node_syscalls -->|"dispatches sync calls"| node_sync
node_elf -->|"maps address space"| node_vmm
node_vmm -->|"allocates frames"| node_pmm
node_elf -->|"sets capability domain"| node_caps
node_faults -->|"terminates faulting task"| node_tasks
node_faults -->|"handles architecture traps"| node_hal
node_vfs -->|"reads initrd files"| node_initrd
node_vfs -->|"serves device files"| node_drivers
node_drivers -->|"uses hardware interface"| node_hal
node_drivers -.->|"supports network devices"| node_network

click node_shell "https://github.com/staycool1374-ger/nexios/blob/main/src/services/shell.cpp"
click node_terminal "https://github.com/staycool1374-ger/nexios/blob/main/src/services/terminal/terminal.cpp"
click node_userapps "https://github.com/staycool1374-ger/nexios/blob/main/userspace/user-app.c"
click node_elf "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/elf/elf_loader.cpp"
click node_tasks "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/task/task.cpp"
click node_scheduler "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/task/scheduler.cpp"
click node_faults "https://github.com/staycool1374-ger/nexios/tree/main/src/kernel/arch"
click node_syscalls "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/syscall/syscall.cpp"
click node_ipc "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/ipc/ipc.cpp"
click node_vfs "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/vfs/vfs.cpp"
click node_sync "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/sync/sync.cpp"
click node_caps "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/cap/cap.cpp"
click node_vmm "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/memory/vmm.cpp"
click node_pmm "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/memory/pmm.cpp"
click node_initrd "https://github.com/staycool1374-ger/nexios/blob/main/src/initrd/initrd.cpp"
click node_drivers "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/driver/driver.cpp"
click node_network "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/net/net.cpp"
click node_hal "https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/arch/hal/interrupt_controller.hpp"

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_shell,node_terminal,node_userapps,node_operator toneBlue
class node_elf,node_tasks,node_scheduler,node_faults toneAmber
class node_syscalls,node_ipc,node_vfs,node_sync toneMint
class node_caps,node_vmm,node_pmm toneRose
class node_initrd,node_drivers,node_network,node_hal toneIndigo
```

## Components

### User interface

- [Shell](https://github.com/staycool1374-ger/nexios/blob/main/src/services/shell.cpp): `src/services/shell.cpp`
- [Terminal](https://github.com/staycool1374-ger/nexios/blob/main/src/services/terminal/terminal.cpp): `src/services/terminal/terminal.cpp`
- [User programs](https://github.com/staycool1374-ger/nexios/blob/main/userspace/user-app.c): `userspace/user-app.c`

### Process execution

- [ELF loader](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/elf/elf_loader.cpp): `src/kernel/elf/elf_loader.cpp`
- [Task management](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/task/task.cpp): `src/kernel/task/task.cpp`
- [Real-time scheduler](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/task/scheduler.cpp): `src/kernel/task/scheduler.cpp`
- [Fault handling](https://github.com/staycool1374-ger/nexios/tree/main/src/kernel/arch): `src/kernel/arch`

### Kernel services

- [System calls](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/syscall/syscall.cpp): `src/kernel/syscall/syscall.cpp`
- [IPC](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/ipc/ipc.cpp): `src/kernel/ipc/ipc.cpp`
- [Virtual filesystem](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/vfs/vfs.cpp): `src/kernel/vfs/vfs.cpp`
- [Synchronization](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/sync/sync.cpp): `src/kernel/sync/sync.cpp`

### Memory and security

- [Capabilities](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/cap/cap.cpp): `src/kernel/cap/cap.cpp`
- [Virtual memory](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/memory/vmm.cpp): `src/kernel/memory/vmm.cpp`
- [Physical memory](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/memory/pmm.cpp): `src/kernel/memory/pmm.cpp`

### Platform I/O

- [Initrd](https://github.com/staycool1374-ger/nexios/blob/main/src/initrd/initrd.cpp): `src/initrd/initrd.cpp`
- [Device drivers](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/driver/driver.cpp): `src/kernel/driver/driver.cpp`
- [Network stack](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/net/net.cpp): `src/kernel/net/net.cpp`
- [Architecture HAL](https://github.com/staycool1374-ger/nexios/blob/main/src/kernel/arch/hal/interrupt_controller.hpp): `src/kernel/arch/hal/interrupt_controller.hpp`

### Other components

- **User**

## Connections

- User → Terminal: enters commands
- Terminal → Shell: forwards input
- Shell → ELF loader: loads ELF
- ELF loader → Task management: creates task
- Task management → Real-time scheduler: schedules task
- User programs → System calls: requests services
- System calls → Virtual filesystem: dispatches filesystem calls
- System calls → IPC: dispatches IPC calls
- System calls → Capabilities: checks capabilities
- System calls → Synchronization: dispatches sync calls
- ELF loader → Virtual memory: maps address space
- Virtual memory → Physical memory: allocates frames
- ELF loader → Capabilities: sets capability domain
- Fault handling → Task management: terminates faulting task
- Fault handling → Architecture HAL: handles architecture traps
- Virtual filesystem → Initrd: reads initrd files
- Virtual filesystem → Device drivers: serves device files
- Device drivers → Architecture HAL: uses hardware interface
- Device drivers → Network stack: supports network devices
