# manikineko/manios architecture

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

- Interactive diagram: https://gitdiagram.com/manikineko/manios
- Repository: https://github.com/manikineko/manios

## Overview

ManiOS is an independent i386 operating system spanning a ZKT kernel, Unix-like userspace, networked file and CPU services, ManiDOS/DOS compatibility, and its own graphical desktop. The primary boot-to-use workflow initializes kernel memory, scheduling, devices and filesystems, then provides processes and a shell; users can browse local or remote files, run commands and DOS programs, or start the desktop and GUI applications. The README documents major capabilities not directly sampled; links for those are cited to it rather than implying their source was inspected.

Main entry points: [`zkt/kernel/main.c`](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/kernel/main.c) (Kernel startup), [`zkt/fs/vfs.c`](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/fs/vfs.c) (Virtual filesystem), [`zkt/kernel/syscall.c`](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/kernel/syscall.c) (Processes and syscalls), [`userland/dosrun/main.c`](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/dosrun/main.c) (DOS emulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and kernel"]
  node_bootloader["Native bootloader<br/>[stage2.c]"]
  node_kernel["Kernel startup<br/>[main.c]"]
end

subgraph group_core["Kernel services"]
  node_abi["Userspace ABI<br/>[zkt_abi.h]"]
  node_memory["Memory management<br/>[heap.h]"]
  node_scheduler["Thread scheduler<br/>[sched.c]"]
  node_process["Processes and syscalls<br/>[syscall.c]"]
  node_drivers["Device drivers<br/>[drivers.h]"]
end

subgraph group_storage["Storage and network"]
  node_vfs["Virtual filesystem<br/>[vfs.c]"]
  node_fat[("FAT filesystem<br/>[fat.c]")]
  node_network["Network stack<br/>[net.h]"]
  node_zrpclient["ZRP client<br/>[zrp_client.c]"]
  node_zrpserver["ZRP server<br/>[zrp_server.c]"]
end

subgraph group_userland["Programs and compatibility"]
  node_libc["C library<br/>[stdio.c]"]
  node_shell["Shell and utilities<br/>[sh.c]"]
  node_manidos["ManiDOS<br/>[main.c]"]
  node_dosrun["DOS emulator<br/>[main.c]"]
  node_cpud["CPU server<br/>[cpud.c]"]
end

subgraph group_desktop["Graphical desktop"]
  node_graphics["Framebuffer graphics<br/>[fb.c]"]
  node_gfx["2D graphics library<br/>[gfx.c]"]
  node_desktop["ManiDE window system<br/>[main.c]"]
  node_window["Window interface<br/>[win.c]"]
  node_ui["Widget toolkit<br/>[widgets.c]"]
  node_guiapps["GUI applications<br/>[files.c]"]
end

node_operator(("Computer operator"))
node_dossoftware(("DOS application"))
node_remotehost(("Remote ManiOS host"))

node_operator -->|"boots system"| node_bootloader
node_bootloader -.->|"loads kernel"| node_kernel
node_kernel -->|"initializes"| node_memory
node_kernel -->|"starts"| node_scheduler
node_kernel -->|"initializes"| node_drivers
node_kernel -->|"starts userspace"| node_process
node_kernel -->|"initializes"| node_network
node_kernel -->|"initializes"| node_vfs
node_kernel -->|"initializes"| node_graphics
node_process -->|"implements calls"| node_abi
node_process -.->|"serves file calls"| node_vfs
node_drivers -.->|"exposes devices"| node_vfs
node_vfs -.->|"mounts volumes"| node_fat
node_operator -->|"runs commands"| node_shell
node_shell -.->|"uses library"| node_libc
node_operator -->|"runs DOS"| node_manidos
node_operator -->|"starts program"| node_dosrun
node_dosrun -->|"interprets"| node_dossoftware
node_dosrun -->|"uses drive letters"| node_manidos
node_operator -->|"starts service"| node_cpud
node_kernel -->|"starts server"| node_zrpserver
node_zrpclient -->|"sends UDP requests"| node_network
node_zrpclient -->|"requests remote tree"| node_remotehost
node_remotehost -->|"serves ZRP"| node_zrpserver
node_operator -->|"starts desktop"| node_desktop
node_desktop -.->|"uses windows"| node_window
node_desktop -->|"composites display"| node_graphics
node_window -.->|"hosts widgets"| node_ui
node_guiapps -->|"uses toolkit"| node_ui
node_guiapps -.->|"opens windows"| node_window
node_gfx -.->|"draws framebuffer"| node_graphics

click node_bootloader "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/boot/stage2.c"
click node_kernel "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/kernel/main.c"
click node_abi "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/abi/zkt_abi.h"
click node_memory "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/mm/heap.h"
click node_scheduler "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/scheduler/sched.c"
click node_process "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/kernel/syscall.c"
click node_drivers "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/drivers/drivers.h"
click node_vfs "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/fs/vfs.c"
click node_fat "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/fs/fat.c"
click node_network "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/net/net.h"
click node_zrpclient "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/net/zrp_client.c"
click node_zrpserver "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/net/zrp_server.c"
click node_libc "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/libc/stdio.c"
click node_shell "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/bin/sh.c"
click node_manidos "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/dos/main.c"
click node_dosrun "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/dosrun/main.c"
click node_cpud "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/bin/cpud.c"
click node_graphics "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/drivers/fb.c"
click node_gfx "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/libgfx/gfx.c"
click node_desktop "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/manide/main.c"
click node_window "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/libwin/win.c"
click node_ui "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/libui/widgets.c"
click node_guiapps "https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/apps/files.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_bootloader,node_kernel toneBlue
class node_abi,node_memory,node_scheduler,node_process,node_drivers toneAmber
class node_vfs,node_fat,node_network,node_zrpclient,node_zrpserver toneMint
class node_libc,node_shell,node_manidos,node_dosrun,node_cpud toneRose
class node_graphics,node_gfx,node_desktop,node_window,node_ui,node_guiapps,node_operator,node_dossoftware,node_remotehost toneIndigo
```

## Components

### Boot and kernel

- [Native bootloader](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/boot/stage2.c): `boot/stage2.c`
- [Kernel startup](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/kernel/main.c): `zkt/kernel/main.c`

### Kernel services

- [Userspace ABI](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/abi/zkt_abi.h): `zkt/abi/zkt_abi.h`
- [Memory management](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/mm/heap.h): `zkt/mm/heap.h`
- [Thread scheduler](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/scheduler/sched.c): `zkt/scheduler/sched.c`
- [Processes and syscalls](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/kernel/syscall.c): `zkt/kernel/syscall.c`
- [Device drivers](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/drivers/drivers.h): `zkt/drivers/drivers.h`

### Storage and network

- [Virtual filesystem](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/fs/vfs.c): `zkt/fs/vfs.c`
- [FAT filesystem](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/fs/fat.c): `zkt/fs/fat.c`
- [Network stack](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/net/net.h): `zkt/net/net.h`
- [ZRP client](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/net/zrp_client.c): `zkt/net/zrp_client.c`
- [ZRP server](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/net/zrp_server.c): `zkt/net/zrp_server.c`

### Programs and compatibility

- [C library](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/libc/stdio.c): `libc/stdio.c`
- [Shell and utilities](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/bin/sh.c): `userland/bin/sh.c`
- [ManiDOS](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/dos/main.c): `userland/dos/main.c`
- [DOS emulator](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/dosrun/main.c): `userland/dosrun/main.c`
- [CPU server](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/userland/bin/cpud.c): `userland/bin/cpud.c`

### Graphical desktop

- [Framebuffer graphics](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/zkt/drivers/fb.c): `zkt/drivers/fb.c`
- [2D graphics library](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/libgfx/gfx.c): `desktop/libgfx/gfx.c`
- [ManiDE window system](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/manide/main.c): `desktop/manide/main.c`
- [Window interface](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/libwin/win.c): `desktop/libwin/win.c`
- [Widget toolkit](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/libui/widgets.c): `desktop/libui/widgets.c`
- [GUI applications](https://github.com/manikineko/manios/blob/claude/bold-pasteur-aqukfo/desktop/apps/files.c): `desktop/apps/files.c`

### Other components

- **Computer operator**
- **DOS application**
- **Remote ManiOS host**

## Connections

- Computer operator → Native bootloader: boots system (evidence: `README.md`)
- Native bootloader → Kernel startup: loads kernel
- Kernel startup → Memory management: initializes (evidence: `zkt/kernel/main.c`)
- Kernel startup → Thread scheduler: starts (evidence: `zkt/kernel/main.c`)
- Kernel startup → Device drivers: initializes (evidence: `zkt/kernel/main.c`)
- Kernel startup → Processes and syscalls: starts userspace (evidence: `zkt/kernel/main.c`)
- Kernel startup → Network stack: initializes (evidence: `zkt/kernel/main.c`)
- Kernel startup → Virtual filesystem: initializes (evidence: `zkt/kernel/main.c`)
- Kernel startup → Framebuffer graphics: initializes (evidence: `zkt/kernel/main.c`)
- Processes and syscalls → Userspace ABI: implements calls (evidence: `zkt/abi/zkt_abi.h`)
- Processes and syscalls → Virtual filesystem: serves file calls
- Device drivers → Virtual filesystem: exposes devices
- Virtual filesystem → FAT filesystem: mounts volumes
- Computer operator → Shell and utilities: runs commands (evidence: `README.md`)
- Shell and utilities → C library: uses library
- Computer operator → ManiDOS: runs DOS (evidence: `README.md`)
- Computer operator → DOS emulator: starts program (evidence: `userland/dosrun/main.c`)
- DOS emulator → DOS application: interprets (evidence: `userland/dosrun/main.c`)
- DOS emulator → ManiDOS: uses drive letters (evidence: `userland/dosrun/main.c`)
- Computer operator → CPU server: starts service (evidence: `README.md`)
- Kernel startup → ZRP server: starts server (evidence: `zkt/kernel/main.c`)
- ZRP client → Network stack: sends UDP requests (evidence: `zkt/net/zrp_client.c`)
- ZRP client → Remote ManiOS host: requests remote tree (evidence: `README.md`)
- Remote ManiOS host → ZRP server: serves ZRP (evidence: `README.md`)
- Computer operator → ManiDE window system: starts desktop (evidence: `README.md`)
- ManiDE window system → Window interface: uses windows
- ManiDE window system → Framebuffer graphics: composites display (evidence: `README.md`)
- Window interface → Widget toolkit: hosts widgets
- GUI applications → Widget toolkit: uses toolkit (evidence: `README.md`)
- GUI applications → Window interface: opens windows
- 2D graphics library → Framebuffer graphics: draws framebuffer
