# apex-os/apexos architecture

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

- Interactive diagram: https://gitdiagram.com/apex-os/apexos
- Repository: https://github.com/apex-os/apexos

## Overview

ApexOS is a freestanding x86-64 operating system: firmware boots a monolithic kernel that initializes hardware and core services, then exposes an interactive shell and early graphical layer. Its documented workflows include persistent AXFS volumes over AHCI, Ring 3 programs loaded in AXF format and using syscalls, and a partial Ethernet/IP network stack. The graph combines README-documented system flows with relationships visible in excerpts; unsampled subsystems are included where the README identifies them, without inferring their internal call graph.

Main entry points: [`ApexKernel/Core/Init.c`](https://github.com/apex-os/apexos/blob/main/ApexKernel/Core/Init.c) (Kernel initialization), [`ApexKernel/Core/Shell/Shell.c`](https://github.com/apex-os/apexos/blob/main/ApexKernel/Core/Shell/Shell.c) (Kernel shell), [`ApexKernel/Filesystem/AXFS`](https://github.com/apex-os/apexos/tree/main/ApexKernel/Filesystem/AXFS) (AXFS filesystem), [`ApexKernel/Filesystem/VFS/FilesystemRouter.c`](https://github.com/apex-os/apexos/blob/main/ApexKernel/Filesystem/VFS/FilesystemRouter.c) (Volume routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and kernel core"]
  node_uefi["UEFI bootloader<br/>[Main.c]"]
  node_kernel["Kernel initialization<br/>[Init.c]"]
end

subgraph group_services["Kernel services"]
  node_memory["Memory management"]
  node_interrupts["Interrupts and timer"]
  node_smp["SMP and scheduling"]
  node_syscalls["Syscall services"]
end

subgraph group_storage["Storage and filesystems"]
  node_axfs["AXFS filesystem"]
  node_vfs["Volume routing<br/>[FilesystemRouter.c]"]
end

subgraph group_user["User-facing systems"]
  node_axf["AXF loaders"]
  node_shell["Kernel shell<br/>[Shell.c]"]
  node_apexui["ApexUI<br/>[Compositor.c]"]
end

subgraph group_io["Devices and networking"]
  node_ahci["AHCI storage driver<br/>[Controller.c]"]
  node_network["Network protocols"]
  node_display["Display and console"]
  node_input["Keyboard and mouse"]
end

node_firmware(("UEFI firmware"))
node_user(("Operator / program"))

node_firmware -->|"starts boot"| node_uefi
node_uefi -->|"loads kernel"| node_kernel
node_kernel -->|"initializes"| node_memory
node_kernel -->|"initializes"| node_interrupts
node_kernel -->|"brings up"| node_smp
node_kernel -.->|"initializes storage"| node_ahci
node_kernel -->|"initializes filesystem"| node_axfs
node_kernel -->|"initializes networking"| node_network
node_kernel -->|"initializes display"| node_display
node_kernel -->|"starts shell"| node_shell
node_ahci -->|"backs disk I/O"| node_axfs
node_axfs -->|"routed by"| node_vfs
node_vfs -.->|"provides executable files"| node_axf
node_axf -->|"launches programs"| node_syscalls
node_syscalls -->|"serves Ring 3"| node_user
node_shell -.->|"accesses volumes"| node_vfs
node_user -->|"interacts with"| node_shell
node_shell -.->|"prints output"| node_display
node_input -.->|"provides input"| node_apexui
node_apexui -->|"composes framebuffer"| node_display
node_user -->|"uses graphical layer"| node_apexui
node_network -.->|"serves network tools"| node_user

click node_uefi "https://github.com/apex-os/apexos/blob/main/ApexKernel/Boot/UEFI/Main.c"
click node_kernel "https://github.com/apex-os/apexos/blob/main/ApexKernel/Core/Init.c"
click node_memory "https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/Memory"
click node_interrupts "https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/Interrupts"
click node_smp "https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/SMP"
click node_syscalls "https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/Syscalls"
click node_ahci "https://github.com/apex-os/apexos/blob/main/ApexKernel/Drivers/Storage/AHCI/Controller.c"
click node_axfs "https://github.com/apex-os/apexos/tree/main/ApexKernel/Filesystem/AXFS"
click node_vfs "https://github.com/apex-os/apexos/blob/main/ApexKernel/Filesystem/VFS/FilesystemRouter.c"
click node_axf "https://github.com/apex-os/apexos/tree/main/ApexKernel/Formats/AXF"
click node_shell "https://github.com/apex-os/apexos/blob/main/ApexKernel/Core/Shell/Shell.c"
click node_network "https://github.com/apex-os/apexos/tree/main/ApexKernel/Network/Protocols"
click node_display "https://github.com/apex-os/apexos/tree/main/ApexKernel/Drivers/Display"
click node_input "https://github.com/apex-os/apexos/tree/main/ApexKernel/Drivers/Input"
click node_apexui "https://github.com/apex-os/apexos/blob/main/ApexUI/Core/Compositor/Compositor.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_uefi,node_kernel toneBlue
class node_memory,node_interrupts,node_smp,node_syscalls toneAmber
class node_axfs,node_vfs toneMint
class node_axf,node_shell,node_apexui toneRose
class node_ahci,node_network,node_display,node_input,node_firmware,node_user toneIndigo
```

## Components

### Boot and kernel core

- [UEFI bootloader](https://github.com/apex-os/apexos/blob/main/ApexKernel/Boot/UEFI/Main.c): `ApexKernel/Boot/UEFI/Main.c`
- [Kernel initialization](https://github.com/apex-os/apexos/blob/main/ApexKernel/Core/Init.c): `ApexKernel/Core/Init.c`

### Kernel services

- [Memory management](https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/Memory): `ApexKernel/Core/Memory`
- [Interrupts and timer](https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/Interrupts): `ApexKernel/Core/Interrupts`
- [SMP and scheduling](https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/SMP): `ApexKernel/Core/SMP`
- [Syscall services](https://github.com/apex-os/apexos/tree/main/ApexKernel/Core/Syscalls): `ApexKernel/Core/Syscalls`

### Storage and filesystems

- [AXFS filesystem](https://github.com/apex-os/apexos/tree/main/ApexKernel/Filesystem/AXFS): `ApexKernel/Filesystem/AXFS`
- [Volume routing](https://github.com/apex-os/apexos/blob/main/ApexKernel/Filesystem/VFS/FilesystemRouter.c): `ApexKernel/Filesystem/VFS/FilesystemRouter.c`

### User-facing systems

- [AXF loaders](https://github.com/apex-os/apexos/tree/main/ApexKernel/Formats/AXF): `ApexKernel/Formats/AXF`
- [Kernel shell](https://github.com/apex-os/apexos/blob/main/ApexKernel/Core/Shell/Shell.c): `ApexKernel/Core/Shell/Shell.c`
- [ApexUI](https://github.com/apex-os/apexos/blob/main/ApexUI/Core/Compositor/Compositor.c): `ApexUI/Core/Compositor/Compositor.c`

### Devices and networking

- [AHCI storage driver](https://github.com/apex-os/apexos/blob/main/ApexKernel/Drivers/Storage/AHCI/Controller.c): `ApexKernel/Drivers/Storage/AHCI/Controller.c`
- [Network protocols](https://github.com/apex-os/apexos/tree/main/ApexKernel/Network/Protocols): `ApexKernel/Network/Protocols`
- [Display and console](https://github.com/apex-os/apexos/tree/main/ApexKernel/Drivers/Display): `ApexKernel/Drivers/Display`
- [Keyboard and mouse](https://github.com/apex-os/apexos/tree/main/ApexKernel/Drivers/Input): `ApexKernel/Drivers/Input`

### Other components

- **UEFI firmware**
- **Operator / program**

## Connections

- UEFI firmware → UEFI bootloader: starts boot (evidence: `README.md`)
- UEFI bootloader → Kernel initialization: loads kernel (evidence: `README.md`)
- Kernel initialization → Memory management: initializes (evidence: `README.md`)
- Kernel initialization → Interrupts and timer: initializes (evidence: `README.md`)
- Kernel initialization → SMP and scheduling: brings up (evidence: `ApexKernel/Core/Init.c`)
- Kernel initialization → AHCI storage driver: initializes storage
- Kernel initialization → AXFS filesystem: initializes filesystem (evidence: `README.md`)
- Kernel initialization → Network protocols: initializes networking (evidence: `README.md`)
- Kernel initialization → Display and console: initializes display (evidence: `README.md`)
- Kernel initialization → Kernel shell: starts shell (evidence: `README.md`)
- AHCI storage driver → AXFS filesystem: backs disk I/O
- AXFS filesystem → Volume routing: routed by
- Volume routing → AXF loaders: provides executable files
- AXF loaders → Syscall services: launches programs (evidence: `README.md`)
- Syscall services → Operator / program: serves Ring 3 (evidence: `README.md`)
- Kernel shell → Volume routing: accesses volumes
- Operator / program → Kernel shell: interacts with (evidence: `README.md`)
- Kernel shell → Display and console: prints output
- Keyboard and mouse → ApexUI: provides input
- ApexUI → Display and console: composes framebuffer (evidence: `README.md`)
- Operator / program → ApexUI: uses graphical layer (evidence: `README.md`)
- Network protocols → Operator / program: serves network tools
