# uri86/urix architecture

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

- Interactive diagram: https://gitdiagram.com/uri86/urix
- Repository: https://github.com/uri86/urix

## Overview

URIX is a small x86-64 operating system with a kernel, filesystem, process and syscall services, and embedded userspace programs. Its main workflow boots the kernel, discovers storage and mounts a root filesystem, installs embedded programs, then starts userspace; the shell launches commands through process and syscall services. The graph also preserves documented filesystem, process, memory, device, and editor/configuration capabilities. Some subsystem paths are represented by their exact tree directories because their implementations were not excerpted; relationships are included only where excerpts or README text support them.

Main entry points: [`src/kernel.c`](https://github.com/uri86/urix/blob/main/src/kernel.c) (Kernel boot), [`src/syscall/syscall.c`](https://github.com/uri86/urix/blob/main/src/syscall/syscall.c) (System calls), [`src/process/process.c`](https://github.com/uri86/urix/blob/main/src/process/process.c) (Process scheduler), [`userspace/include/urix.h`](https://github.com/uri86/urix/blob/main/userspace/include/urix.h) (Userspace API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Kernel and devices"]
  node_kernel["Kernel boot<br/>[kernel.c]"]
  node_interrupts["Interrupt handling"]
  node_keyboard["Keyboard input<br/>[keyboard.c]"]
  node_vga["Display output<br/>[vga.c]"]
  node_ata["ATA driver<br/>[ata.c]"]
  node_ramdisk["RAM disk<br/>[ramdisk.c]"]
end

subgraph group_storage["Storage and filesystems"]
  node_blockdev["Block devices<br/>[blockdev.c]"]
  node_vfsmanager["Filesystem manager<br/>[vfs_manager.c]"]
  node_vfs["Virtual filesystem<br/>[vfs.c]"]
  node_ext2["Ext2 filesystem<br/>[ext2.c]"]
  node_devfs["Device filesystem<br/>[devfs.c]"]
  node_elf["ELF loader<br/>[elf.c]"]
end

subgraph group_services["Kernel services"]
  node_process["Process scheduler<br/>[process.c]"]
  node_syscalls["System calls<br/>[syscall.c]"]
  node_fdpipe["FDs and pipes"]
  node_memory["Memory management"]
end

subgraph group_user["Userspace"]
  node_libc["C library"]
  node_urixapi["Userspace API<br/>[urix.h]"]
  node_shell["Command shell<br/>[shell.c]"]
  node_commands["User commands"]
  node_editor["Text editor<br/>[editor.c]"]
  node_config["Config library<br/>[conf.c]"]
end

node_kernel -->|"initializes"| node_ata
node_kernel -->|"initializes"| node_blockdev
node_kernel -->|"creates fallback"| node_ramdisk
node_kernel -->|"initializes"| node_vfs
node_kernel -->|"starts scheduler"| node_process
node_kernel -->|"writes embedded programs"| node_vfs
node_kernel -->|"loads init"| node_process
node_ata -.->|"registers devices"| node_blockdev
node_ramdisk -.->|"registers device"| node_blockdev
node_vfsmanager -->|"scans devices"| node_blockdev
node_vfsmanager -->|"probes and formats"| node_ext2
node_vfsmanager -->|"mounts volumes"| node_vfs
node_vfs -.->|"dispatches filesystem ops"| node_ext2
node_process -->|"loads executable"| node_elf
node_process -->|"creates address space"| node_memory
node_process -->|"manages descriptors"| node_fdpipe
node_syscalls -->|"dispatches process calls"| node_process
node_syscalls -->|"reads and writes files"| node_vfs
node_syscalls -->|"uses descriptors and pipes"| node_fdpipe
node_syscalls -->|"reads console input"| node_keyboard
node_syscalls -->|"writes console output"| node_vga
node_shell -->|"uses API"| node_urixapi
node_urixapi -.->|"requests kernel services"| node_syscalls
node_shell -->|"executes programs"| node_commands
node_editor -->|"uses file and terminal calls"| node_urixapi
node_editor -->|"loads editor settings"| node_config
node_config -->|"uses file calls"| node_urixapi
node_commands -.->|"uses userspace API"| node_urixapi
node_urixapi -.->|"shares runtime helpers"| node_libc

click node_kernel "https://github.com/uri86/urix/blob/main/src/kernel.c"
click node_interrupts "https://github.com/uri86/urix/tree/main/src/interrupts"
click node_keyboard "https://github.com/uri86/urix/blob/main/src/drivers/keyboard.c"
click node_vga "https://github.com/uri86/urix/blob/main/src/drivers/vga.c"
click node_ata "https://github.com/uri86/urix/blob/main/src/drivers/ata.c"
click node_ramdisk "https://github.com/uri86/urix/blob/main/src/drivers/ramdisk.c"
click node_blockdev "https://github.com/uri86/urix/blob/main/src/fs/blockdev.c"
click node_vfsmanager "https://github.com/uri86/urix/blob/main/src/fs/vfs_manager.c"
click node_vfs "https://github.com/uri86/urix/blob/main/src/fs/vfs.c"
click node_ext2 "https://github.com/uri86/urix/blob/main/src/fs/ext2.c"
click node_devfs "https://github.com/uri86/urix/blob/main/src/fs/devfs.c"
click node_elf "https://github.com/uri86/urix/blob/main/src/fs/elf.c"
click node_process "https://github.com/uri86/urix/blob/main/src/process/process.c"
click node_syscalls "https://github.com/uri86/urix/blob/main/src/syscall/syscall.c"
click node_fdpipe "https://github.com/uri86/urix/tree/main/src/process"
click node_memory "https://github.com/uri86/urix/tree/main/src/memory"
click node_libc "https://github.com/uri86/urix/tree/main/libc/src"
click node_urixapi "https://github.com/uri86/urix/blob/main/userspace/include/urix.h"
click node_shell "https://github.com/uri86/urix/blob/main/userspace/src/shell.c"
click node_commands "https://github.com/uri86/urix/tree/main/userspace/src"
click node_editor "https://github.com/uri86/urix/blob/main/userspace/src/editor.c"
click node_config "https://github.com/uri86/urix/blob/main/userspace/liburix/conf.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_kernel,node_interrupts,node_keyboard,node_vga,node_ata,node_ramdisk toneBlue
class node_blockdev,node_vfsmanager,node_vfs,node_ext2,node_devfs,node_elf toneAmber
class node_process,node_syscalls,node_fdpipe,node_memory toneMint
class node_libc,node_urixapi,node_shell,node_commands,node_editor,node_config toneRose
```

## Components

### Kernel and devices

- [Kernel boot](https://github.com/uri86/urix/blob/main/src/kernel.c): `src/kernel.c`
- [Interrupt handling](https://github.com/uri86/urix/tree/main/src/interrupts): `src/interrupts`
- [Keyboard input](https://github.com/uri86/urix/blob/main/src/drivers/keyboard.c): `src/drivers/keyboard.c`
- [Display output](https://github.com/uri86/urix/blob/main/src/drivers/vga.c): `src/drivers/vga.c`
- [ATA driver](https://github.com/uri86/urix/blob/main/src/drivers/ata.c): `src/drivers/ata.c`
- [RAM disk](https://github.com/uri86/urix/blob/main/src/drivers/ramdisk.c): `src/drivers/ramdisk.c`

### Storage and filesystems

- [Block devices](https://github.com/uri86/urix/blob/main/src/fs/blockdev.c): `src/fs/blockdev.c`
- [Filesystem manager](https://github.com/uri86/urix/blob/main/src/fs/vfs_manager.c): `src/fs/vfs_manager.c`
- [Virtual filesystem](https://github.com/uri86/urix/blob/main/src/fs/vfs.c): `src/fs/vfs.c`
- [Ext2 filesystem](https://github.com/uri86/urix/blob/main/src/fs/ext2.c): `src/fs/ext2.c`
- [Device filesystem](https://github.com/uri86/urix/blob/main/src/fs/devfs.c): `src/fs/devfs.c`
- [ELF loader](https://github.com/uri86/urix/blob/main/src/fs/elf.c): `src/fs/elf.c`

### Kernel services

- [Process scheduler](https://github.com/uri86/urix/blob/main/src/process/process.c): `src/process/process.c`
- [System calls](https://github.com/uri86/urix/blob/main/src/syscall/syscall.c): `src/syscall/syscall.c`
- [FDs and pipes](https://github.com/uri86/urix/tree/main/src/process): `src/process`
- [Memory management](https://github.com/uri86/urix/tree/main/src/memory): `src/memory`

### Userspace

- [C library](https://github.com/uri86/urix/tree/main/libc/src): `libc/src`
- [Userspace API](https://github.com/uri86/urix/blob/main/userspace/include/urix.h): `userspace/include/urix.h`
- [Command shell](https://github.com/uri86/urix/blob/main/userspace/src/shell.c): `userspace/src/shell.c`
- [User commands](https://github.com/uri86/urix/tree/main/userspace/src): `userspace/src`
- [Text editor](https://github.com/uri86/urix/blob/main/userspace/src/editor.c): `userspace/src/editor.c`
- [Config library](https://github.com/uri86/urix/blob/main/userspace/liburix/conf.c): `userspace/liburix/conf.c`

## Connections

- Kernel boot → ATA driver: initializes (evidence: `src/kernel.c`)
- Kernel boot → Block devices: initializes (evidence: `src/kernel.c`)
- Kernel boot → RAM disk: creates fallback (evidence: `src/kernel.c`)
- Kernel boot → Virtual filesystem: initializes (evidence: `src/kernel.c`)
- Kernel boot → Process scheduler: starts scheduler (evidence: `src/kernel.c`)
- Kernel boot → Virtual filesystem: writes embedded programs (evidence: `src/kernel.c`)
- Kernel boot → Process scheduler: loads init (evidence: `src/kernel.c`)
- ATA driver → Block devices: registers devices
- RAM disk → Block devices: registers device
- Filesystem manager → Block devices: scans devices (evidence: `src/fs/vfs_manager.c`)
- Filesystem manager → Ext2 filesystem: probes and formats (evidence: `src/fs/vfs_manager.c`)
- Filesystem manager → Virtual filesystem: mounts volumes (evidence: `src/fs/vfs_manager.c`)
- Virtual filesystem → Ext2 filesystem: dispatches filesystem ops
- Process scheduler → ELF loader: loads executable (evidence: `src/process/process.c`)
- Process scheduler → Memory management: creates address space (evidence: `src/process/process.c`)
- Process scheduler → FDs and pipes: manages descriptors (evidence: `src/process/process.c`)
- System calls → Process scheduler: dispatches process calls (evidence: `src/syscall/syscall.c`)
- System calls → Virtual filesystem: reads and writes files (evidence: `src/syscall/syscall.c`)
- System calls → FDs and pipes: uses descriptors and pipes (evidence: `src/syscall/syscall.c`)
- System calls → Keyboard input: reads console input (evidence: `src/syscall/syscall.c`)
- System calls → Display output: writes console output (evidence: `src/syscall/syscall.c`)
- Command shell → Userspace API: uses API (evidence: `userspace/src/shell.c`)
- Userspace API → System calls: requests kernel services
- Command shell → User commands: executes programs (evidence: `userspace/src/shell.c`)
- Text editor → Userspace API: uses file and terminal calls (evidence: `userspace/src/editor.c`)
- Text editor → Config library: loads editor settings (evidence: `userspace/src/editor.c`)
- Config library → Userspace API: uses file calls (evidence: `userspace/liburix/conf.c`)
- User commands → Userspace API: uses userspace API (evidence: `userspace/src/shell.c`)
- Userspace API → C library: shares runtime helpers
