# aj39210/versitileos-master architecture

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

- Interactive diagram: https://gitdiagram.com/aj39210/versitileos-master
- Repository: https://github.com/aj39210/versitileos-master

## Overview

VeRsitileOS is a hobbyist operating system whose visible product is a freestanding kernel with hardware drivers, storage/filesystems, process support, and graphics. A useful user-facing path is a booted kernel exposing mounted files and devices to processes; the supplied excerpts show filesystem and task mechanisms, but not the complete boot-to-user orchestration. The graph retains major kernel subsystems and driver families present in the tree. Evidence is limited to the README, source index references, and sampled excerpts; uncertain wiring is omitted.

Main entry points: [`Kernel/Kernel/block.c`](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/block.c) (Block device registry), [`Kernel/fs/vfs/vfs.c`](https://github.com/aj39210/versitileos-master/blob/main/Kernel/fs/vfs/vfs.c) (Virtual filesystem), [`Kernel/Drivers/Ethernet`](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/Ethernet) (Ethernet and Wi-Fi), [`Kernel/Kernel/kmain.c`](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/kmain.c) (Kernel entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Kernel core"]
  node_boot["Kernel entry<br/>[kmain.c]"]
  node_memory["Memory management"]
  node_interrupts["Interrupt and timer"]
end

subgraph group_devices["Hardware I/O"]
  node_pci["PCI discovery<br/>[pci.c]"]
  node_usb["USB xHCI<br/>[xhci.c]"]
  node_input["Input devices"]
  node_network["Ethernet and Wi-Fi"]
  node_virtio["Virtio devices"]
end

subgraph group_storage["Storage and filesystems"]
  node_block[("Block device registry<br/>[block.c]")]
  node_diskdrivers["Disk drivers"]
  node_vfs["Virtual filesystem<br/>[vfs.c]"]
  node_filesystem["Filesystem backends"]
end

subgraph group_execution["Execution"]
  node_task["Tasks and processes<br/>[task.c]"]
  node_syscalls["System calls<br/>[syscall.c]"]
  node_modules["Kernel modules<br/>[module.c]"]
end

subgraph group_graphics["Graphics"]
  node_graphics["Display drivers"]
  node_drm["DRM interface<br/>[drm.c]"]
end

node_user(("User process"))

node_usb -->|"handles input"| node_input
node_usb -.->|"registers storage"| node_block
node_diskdrivers -.->|"registers devices"| node_block
node_vfs -->|"reads partitions"| node_block
node_vfs -->|"mounts backends"| node_filesystem
node_filesystem -->|"reads blocks"| node_block
node_task -->|"uses files"| node_vfs
node_task -->|"maps address spaces"| node_memory
node_network -->|"uses network API"| node_virtio
node_modules -->|"dispatches drivers"| node_network
node_modules -.->|"dispatches drivers"| node_graphics
node_graphics -->|"uses DRM"| node_drm
node_user -.->|"requests services"| node_syscalls
node_boot -.->|"initializes"| node_memory
node_boot -.->|"initializes"| node_interrupts
node_pci -.->|"discovers hardware"| node_network

click node_boot "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/kmain.c"
click node_memory "https://github.com/aj39210/versitileos-master/tree/main/Kernel/Kernel/mm"
click node_interrupts "https://github.com/aj39210/versitileos-master/tree/main/Kernel/Kernel/irq"
click node_pci "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Drivers/PCI/pci.c"
click node_usb "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Drivers/Usb/xhci.c"
click node_input "https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/HID"
click node_network "https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/Ethernet"
click node_virtio "https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/Virtio"
click node_block "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/block.c"
click node_diskdrivers "https://github.com/aj39210/versitileos-master/tree/main/Kernel/Block"
click node_vfs "https://github.com/aj39210/versitileos-master/blob/main/Kernel/fs/vfs/vfs.c"
click node_filesystem "https://github.com/aj39210/versitileos-master/tree/main/Kernel/fs"
click node_task "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/process/task.c"
click node_syscalls "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/syscalls/syscall.c"
click node_modules "https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/modules/module.c"
click node_graphics "https://github.com/aj39210/versitileos-master/tree/main/Kernel/gpu"
click node_drm "https://github.com/aj39210/versitileos-master/blob/main/Kernel/drm/code/drm.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_memory,node_interrupts,node_user toneBlue
class node_pci,node_usb,node_input,node_network,node_virtio toneAmber
class node_block,node_diskdrivers,node_vfs,node_filesystem toneMint
class node_task,node_syscalls,node_modules toneRose
class node_graphics,node_drm toneIndigo
```

## Components

### Kernel core

- [Kernel entry](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/kmain.c): `Kernel/Kernel/kmain.c`
- [Memory management](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Kernel/mm): `Kernel/Kernel/mm`
- [Interrupt and timer](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Kernel/irq): `Kernel/Kernel/irq`

### Hardware I/O

- [PCI discovery](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Drivers/PCI/pci.c): `Kernel/Drivers/PCI/pci.c`
- [USB xHCI](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Drivers/Usb/xhci.c): `Kernel/Drivers/Usb/xhci.c`
- [Input devices](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/HID): `Kernel/Drivers/HID`
- [Ethernet and Wi-Fi](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/Ethernet): `Kernel/Drivers/Ethernet`
- [Virtio devices](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Drivers/Virtio): `Kernel/Drivers/Virtio`

### Storage and filesystems

- [Block device registry](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/block.c): `Kernel/Kernel/block.c`
- [Disk drivers](https://github.com/aj39210/versitileos-master/tree/main/Kernel/Block): `Kernel/Block`
- [Virtual filesystem](https://github.com/aj39210/versitileos-master/blob/main/Kernel/fs/vfs/vfs.c): `Kernel/fs/vfs/vfs.c`
- [Filesystem backends](https://github.com/aj39210/versitileos-master/tree/main/Kernel/fs): `Kernel/fs`

### Execution

- [Tasks and processes](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/process/task.c): `Kernel/Kernel/process/task.c`
- [System calls](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/syscalls/syscall.c): `Kernel/Kernel/syscalls/syscall.c`
- [Kernel modules](https://github.com/aj39210/versitileos-master/blob/main/Kernel/Kernel/modules/module.c): `Kernel/Kernel/modules/module.c`

### Graphics

- [Display drivers](https://github.com/aj39210/versitileos-master/tree/main/Kernel/gpu): `Kernel/gpu`
- [DRM interface](https://github.com/aj39210/versitileos-master/blob/main/Kernel/drm/code/drm.c): `Kernel/drm/code/drm.c`

### Other components

- **User process**

## Connections

- USB xHCI → Input devices: handles input (evidence: `Kernel/Drivers/Usb/xhci.c`)
- USB xHCI → Block device registry: registers storage
- Disk drivers → Block device registry: registers devices
- Virtual filesystem → Block device registry: reads partitions (evidence: `Kernel/fs/vfs/vfs.c`)
- Virtual filesystem → Filesystem backends: mounts backends (evidence: `Kernel/fs/vfs/vfs.c`)
- Filesystem backends → Block device registry: reads blocks (evidence: `Kernel/fs/ext2/ext2.c`)
- Tasks and processes → Virtual filesystem: uses files (evidence: `Kernel/Kernel/process/task.c`)
- Tasks and processes → Memory management: maps address spaces (evidence: `Kernel/Kernel/process/task.c`)
- Ethernet and Wi-Fi → Virtio devices: uses network API (evidence: `Kernel/Drivers/Ethernet/network.c`)
- Kernel modules → Ethernet and Wi-Fi: dispatches drivers (evidence: `Kernel/Kernel/modules/module.c`)
- Kernel modules → Display drivers: dispatches drivers
- Display drivers → DRM interface: uses DRM (evidence: `Kernel/drm/code/drm.c`)
- User process → System calls: requests services
- Kernel entry → Memory management: initializes
- Kernel entry → Interrupt and timer: initializes
- PCI discovery → Ethernet and Wi-Fi: discovers hardware
