# zinnia-os/zinnia architecture

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

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

## Overview

Zinnia is a modular 64-bit Unix-like Rust kernel and driver collection. Its principal workflow is booting the kernel, loading initramfs contents, starting the configured init process, and serving its POSIX-style system calls through process, memory, filesystem, and device facilities. The repository also documents DRM rendering and evdev input, and includes networking, USB, block, and filesystem drivers. Edges reflect the documented startup path and sampled implementations; some subsystem connections are necessarily summarized because their dispatch code was not sampled.

Main entry points: [`kernel/src/syscall`](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/syscall) (System calls), [`kernel/src/lib.rs`](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/lib.rs) (Kernel startup), [`kernel/src/device/block`](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/block) (Block layer), [`kernel/src/vfs`](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/vfs) (Virtual filesystem)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Boot and Startup"]
  node_boot["Boot entry"]
  node_kernel_main["Kernel startup<br/>[lib.rs]"]
  node_initramfs["Initramfs loader<br/>[initramfs.rs]"]
  node_init["Init process<br/>[mod.rs]"]
end

subgraph group_core["Kernel Core"]
  node_process["Processes and signals"]
  node_scheduler["Task scheduler<br/>[mod.rs]"]
  node_memory["Virtual memory"]
end

subgraph group_interfaces["User Interfaces"]
  node_syscalls["System calls"]
  node_drm["DRM interface<br/>[mod.rs]"]
  node_input["Input events<br/>[mod.rs]"]
end

subgraph group_devices["Devices and Drivers"]
  node_block["Block layer"]
  node_device_core["Device framework"]
  node_pci["PCI framework"]
  node_nvme["NVMe driver<br/>[lib.rs]"]
  node_net["Network stack"]
  node_net_drivers["Network drivers"]
  node_gpu["Virtio GPU<br/>[lib.rs]"]
  node_hid["USB HID parser<br/>[parser.rs]"]
end

subgraph group_storage["Storage"]
  node_vfs["Virtual filesystem"]
  node_fs_types["Filesystem types"]
  node_ext2["Ext2 driver<br/>[lib.rs]"]
end

node_user(("User process"))
node_disk[("Block device")]
node_display["Display hardware"]
node_input_hw["Input hardware"]

node_boot -->|"enters"| node_kernel_main
node_kernel_main -->|"loads contents"| node_initramfs
node_kernel_main -->|"starts init"| node_init
node_init -->|"opens executable"| node_vfs
node_user -->|"requests services"| node_syscalls
node_syscalls -->|"dispatches process calls"| node_process
node_syscalls -->|"dispatches file calls"| node_vfs
node_syscalls -->|"dispatches memory calls"| node_memory
node_syscalls -->|"dispatches socket calls"| node_net
node_syscalls -->|"dispatches DRM calls"| node_drm
node_process -->|"schedules tasks"| node_scheduler
node_vfs -->|"routes filesystem operations"| node_fs_types
node_ext2 -->|"registers filesystem"| node_fs_types
node_ext2 -->|"reads and writes blocks"| node_block
node_block -->|"transfers data"| node_disk
node_pci -->|"discovers device"| node_nvme
node_pci -->|"discovers devices"| node_net_drivers
node_nvme -->|"provides block I/O"| node_block
node_net_drivers -->|"provides network interface"| node_net
node_drm -->|"invokes display operations"| node_gpu
node_gpu -->|"drives"| node_display
node_input_hw -->|"supplies reports"| node_hid
node_hid -->|"emits events"| node_input

click node_boot "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/boot"
click node_kernel_main "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/lib.rs"
click node_initramfs "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/vfs/fs/initramfs.rs"
click node_init "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/process/mod.rs"
click node_syscalls "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/syscall"
click node_process "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/process"
click node_scheduler "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/sched/mod.rs"
click node_memory "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/memory/virt"
click node_vfs "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/vfs"
click node_fs_types "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/vfs/fs"
click node_ext2 "https://github.com/zinnia-os/zinnia/blob/main/drivers/fs/ext2/src/lib.rs"
click node_block "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/block"
click node_device_core "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device"
click node_pci "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/pci"
click node_nvme "https://github.com/zinnia-os/zinnia/blob/main/drivers/block/nvme/src/lib.rs"
click node_net "https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/net"
click node_net_drivers "https://github.com/zinnia-os/zinnia/tree/main/drivers/net"
click node_drm "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/device/drm/mod.rs"
click node_gpu "https://github.com/zinnia-os/zinnia/blob/main/drivers/video/virtio_gpu/src/lib.rs"
click node_input "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/device/input/mod.rs"
click node_hid "https://github.com/zinnia-os/zinnia/blob/main/kernel/src/device/usb/hid/parser.rs"

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_main,node_initramfs,node_init,node_user toneBlue
class node_process,node_scheduler,node_memory,node_disk toneAmber
class node_syscalls,node_drm,node_input toneMint
class node_block,node_device_core,node_pci,node_nvme,node_net,node_net_drivers,node_gpu,node_hid toneRose
class node_vfs,node_fs_types,node_ext2,node_display,node_input_hw toneIndigo
```

## Components

### Boot and Startup

- [Boot entry](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/boot): `kernel/src/boot`
- [Kernel startup](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/lib.rs): `kernel/src/lib.rs`
- [Initramfs loader](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/vfs/fs/initramfs.rs): `kernel/src/vfs/fs/initramfs.rs`
- [Init process](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/process/mod.rs): `kernel/src/process/mod.rs`

### Kernel Core

- [Processes and signals](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/process): `kernel/src/process`
- [Task scheduler](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/sched/mod.rs): `kernel/src/sched/mod.rs`
- [Virtual memory](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/memory/virt): `kernel/src/memory/virt`

### User Interfaces

- [System calls](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/syscall): `kernel/src/syscall`
- [DRM interface](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/device/drm/mod.rs): `kernel/src/device/drm/mod.rs`
- [Input events](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/device/input/mod.rs): `kernel/src/device/input/mod.rs`

### Devices and Drivers

- [Block layer](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/block): `kernel/src/device/block`
- [Device framework](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device): `kernel/src/device`
- [PCI framework](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/pci): `kernel/src/device/pci`
- [NVMe driver](https://github.com/zinnia-os/zinnia/blob/main/drivers/block/nvme/src/lib.rs): `drivers/block/nvme/src/lib.rs`
- [Network stack](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/device/net): `kernel/src/device/net`
- [Network drivers](https://github.com/zinnia-os/zinnia/tree/main/drivers/net): `drivers/net`
- [Virtio GPU](https://github.com/zinnia-os/zinnia/blob/main/drivers/video/virtio_gpu/src/lib.rs): `drivers/video/virtio_gpu/src/lib.rs`
- [USB HID parser](https://github.com/zinnia-os/zinnia/blob/main/kernel/src/device/usb/hid/parser.rs): `kernel/src/device/usb/hid/parser.rs`

### Storage

- [Virtual filesystem](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/vfs): `kernel/src/vfs`
- [Filesystem types](https://github.com/zinnia-os/zinnia/tree/main/kernel/src/vfs/fs): `kernel/src/vfs/fs`
- [Ext2 driver](https://github.com/zinnia-os/zinnia/blob/main/drivers/fs/ext2/src/lib.rs): `drivers/fs/ext2/src/lib.rs`

### Other components

- **User process**
- **Block device**
- **Display hardware**
- **Input hardware**

## Connections

- Boot entry → Kernel startup: enters
- Kernel startup → Initramfs loader: loads contents
- Kernel startup → Init process: starts init
- Init process → Virtual filesystem: opens executable
- User process → System calls: requests services
- System calls → Processes and signals: dispatches process calls
- System calls → Virtual filesystem: dispatches file calls
- System calls → Virtual memory: dispatches memory calls
- System calls → Network stack: dispatches socket calls
- System calls → DRM interface: dispatches DRM calls
- Processes and signals → Task scheduler: schedules tasks
- Virtual filesystem → Filesystem types: routes filesystem operations
- Ext2 driver → Filesystem types: registers filesystem
- Ext2 driver → Block layer: reads and writes blocks
- Block layer → Block device: transfers data
- PCI framework → NVMe driver: discovers device
- PCI framework → Network drivers: discovers devices
- NVMe driver → Block layer: provides block I/O
- Network drivers → Network stack: provides network interface
- DRM interface → Virtio GPU: invokes display operations
- Virtio GPU → Display hardware: drives
- Input hardware → USB HID parser: supplies reports
- USB HID parser → Input events: emits events
