# algorift169/galio architecture

> Architecture diagram of the GitHub repository algorift169/galio, 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/algorift169/galio
- Repository: https://github.com/algorift169/galio

## Overview

Galio is a freestanding x86_64 operating system with an interactive, privilege-aware shell as its main user workflow: users enter commands or `.gh` scripts, which use kernel services for filesystem, process, and syscall operations. The product also includes a desktop-style display, device-backed filesystem entries, networking, and power lifecycle support. The graph combines README-described capabilities with relationships visible in the supplied excerpts and SOURCE INDEX; unsampled subsystems are represented at their existing directory paths, without asserting internal calls that were not shown.

Main entry points: [`tools/shell/shell.c`](https://github.com/algorift169/galio/blob/main/tools/shell/shell.c) (Interactive shell), [`kernel/syscall/syscall.c`](https://github.com/algorift169/galio/blob/main/kernel/syscall/syscall.c) (Syscall dispatch), [`kernel/fs/vfs/vfs_core.c`](https://github.com/algorift169/galio/blob/main/kernel/fs/vfs/vfs_core.c) (Virtual filesystem), [`drift/interpreter/core/intptr.c`](https://github.com/algorift169/galio/blob/main/drift/interpreter/core/intptr.c) (Drift interpreter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Shell and scripting"]
  node_shell_runtime["Interactive shell<br/>[shell.c]"]
  node_shell_commands["Shell commands"]
  node_drift_runtime["Drift interpreter<br/>[intptr.c]"]
  node_drift_lexer["Drift lexer<br/>[lexer.c]"]
  node_drift_parser["Drift parser<br/>[parser.c]"]
end

subgraph group_kernel["Kernel services"]
  node_auth["Authentication and rex<br/>[auth.c]"]
  node_syscalls["Syscall dispatch<br/>[syscall.c]"]
  node_process["Process management<br/>[process.c]"]
  node_memory["Memory and paging<br/>[paging.c]"]
end

subgraph group_storage["Filesystem and devices"]
  node_vfs[("Virtual filesystem<br/>[vfs_core.c]")]
  node_ext2[("EXT2 storage<br/>[ext2.c]")]
  node_device_manager["Device nodes<br/>[device_manager.c]"]
end

subgraph group_hardware["Hardware and networking"]
  node_device_drivers["Device drivers"]
  node_network["Networking"]
  node_power["Power lifecycle"]
end

subgraph group_desktop["Desktop and display"]
  node_desktop_ui["Shell UI"]
  node_display_server["Display server<br/>[server.c]"]
  node_framebuffer["Framebuffer output<br/>[fb.c]"]
end

node_user(("User"))

node_user -->|"enters commands"| node_shell_runtime
node_shell_runtime -->|"runs commands"| node_shell_commands
node_shell_runtime -->|"runs scripts"| node_drift_runtime
node_drift_runtime -->|"tokenizes input"| node_drift_lexer
node_drift_runtime -->|"parses input"| node_drift_parser
node_shell_runtime -->|"uses privilege flow"| node_auth
node_auth -->|"loads credentials"| node_vfs
node_shell_commands -.->|"invokes syscall tools"| node_syscalls
node_syscalls -->|"dispatches process calls"| node_process
node_syscalls -->|"dispatches filesystem calls"| node_vfs
node_process -->|"uses address spaces"| node_memory
node_vfs -->|"uses disk store"| node_ext2
node_device_manager -->|"creates device nodes"| node_vfs
node_device_manager -->|"reads device input"| node_device_drivers
node_shell_runtime -->|"uses display UI"| node_desktop_ui
node_syscalls -->|"references display services"| node_display_server
node_display_server -.->|"renders output"| node_framebuffer
node_display_server -->|"draws desktop elements"| node_desktop_ui
node_user -.->|"uses network services"| node_network
node_user -.->|"requests lifecycle actions"| node_power

click node_shell_runtime "https://github.com/algorift169/galio/blob/main/tools/shell/shell.c"
click node_shell_commands "https://github.com/algorift169/galio/tree/main/tools/shell/commands"
click node_drift_runtime "https://github.com/algorift169/galio/blob/main/drift/interpreter/core/intptr.c"
click node_drift_lexer "https://github.com/algorift169/galio/blob/main/drift/lexer/core/lexer.c"
click node_drift_parser "https://github.com/algorift169/galio/blob/main/drift/parser/core/parser.c"
click node_auth "https://github.com/algorift169/galio/blob/main/kernel/auth.c"
click node_syscalls "https://github.com/algorift169/galio/blob/main/kernel/syscall/syscall.c"
click node_process "https://github.com/algorift169/galio/blob/main/kernel/process/process.c"
click node_memory "https://github.com/algorift169/galio/blob/main/kernel/mm/paging.c"
click node_vfs "https://github.com/algorift169/galio/blob/main/kernel/fs/vfs/vfs_core.c"
click node_ext2 "https://github.com/algorift169/galio/blob/main/kernel/fs/ext2/ext2.c"
click node_device_manager "https://github.com/algorift169/galio/blob/main/kernel/dev/device_manager.c"
click node_device_drivers "https://github.com/algorift169/galio/tree/main/kernel/drivers"
click node_network "https://github.com/algorift169/galio/tree/main/kernel/net"
click node_power "https://github.com/algorift169/galio/tree/main/kernel/power"
click node_desktop_ui "https://github.com/algorift169/galio/tree/main/ui/src"
click node_display_server "https://github.com/algorift169/galio/blob/main/gui/src/display/srver/server.c"
click node_framebuffer "https://github.com/algorift169/galio/blob/main/kernel/drivers/video/fb.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_shell_runtime,node_shell_commands,node_drift_runtime,node_drift_lexer,node_drift_parser,node_user toneBlue
class node_auth,node_syscalls,node_process,node_memory toneAmber
class node_vfs,node_ext2,node_device_manager toneMint
class node_device_drivers,node_network,node_power toneRose
class node_desktop_ui,node_display_server,node_framebuffer toneIndigo
```

## Components

### Shell and scripting

- [Interactive shell](https://github.com/algorift169/galio/blob/main/tools/shell/shell.c): `tools/shell/shell.c`
- [Shell commands](https://github.com/algorift169/galio/tree/main/tools/shell/commands): `tools/shell/commands`
- [Drift interpreter](https://github.com/algorift169/galio/blob/main/drift/interpreter/core/intptr.c): `drift/interpreter/core/intptr.c`
- [Drift lexer](https://github.com/algorift169/galio/blob/main/drift/lexer/core/lexer.c): `drift/lexer/core/lexer.c`
- [Drift parser](https://github.com/algorift169/galio/blob/main/drift/parser/core/parser.c): `drift/parser/core/parser.c`

### Kernel services

- [Authentication and rex](https://github.com/algorift169/galio/blob/main/kernel/auth.c): `kernel/auth.c`
- [Syscall dispatch](https://github.com/algorift169/galio/blob/main/kernel/syscall/syscall.c): `kernel/syscall/syscall.c`
- [Process management](https://github.com/algorift169/galio/blob/main/kernel/process/process.c): `kernel/process/process.c`
- [Memory and paging](https://github.com/algorift169/galio/blob/main/kernel/mm/paging.c): `kernel/mm/paging.c`

### Filesystem and devices

- [Virtual filesystem](https://github.com/algorift169/galio/blob/main/kernel/fs/vfs/vfs_core.c): `kernel/fs/vfs/vfs_core.c`
- [EXT2 storage](https://github.com/algorift169/galio/blob/main/kernel/fs/ext2/ext2.c): `kernel/fs/ext2/ext2.c`
- [Device nodes](https://github.com/algorift169/galio/blob/main/kernel/dev/device_manager.c): `kernel/dev/device_manager.c`

### Hardware and networking

- [Device drivers](https://github.com/algorift169/galio/tree/main/kernel/drivers): `kernel/drivers`
- [Networking](https://github.com/algorift169/galio/tree/main/kernel/net): `kernel/net`
- [Power lifecycle](https://github.com/algorift169/galio/tree/main/kernel/power): `kernel/power`

### Desktop and display

- [Shell UI](https://github.com/algorift169/galio/tree/main/ui/src): `ui/src`
- [Display server](https://github.com/algorift169/galio/blob/main/gui/src/display/srver/server.c): `gui/src/display/srver/server.c`
- [Framebuffer output](https://github.com/algorift169/galio/blob/main/kernel/drivers/video/fb.c): `kernel/drivers/video/fb.c`

### Other components

- **User**

## Connections

- User → Interactive shell: enters commands
- Interactive shell → Shell commands: runs commands
- Interactive shell → Drift interpreter: runs scripts
- Drift interpreter → Drift lexer: tokenizes input (evidence: `drift/interpreter/core/intptr.c`)
- Drift interpreter → Drift parser: parses input (evidence: `drift/interpreter/core/intptr.c`)
- Interactive shell → Authentication and rex: uses privilege flow (evidence: `tools/shell/shell.c`)
- Authentication and rex → Virtual filesystem: loads credentials (evidence: `kernel/auth.c`)
- Shell commands → Syscall dispatch: invokes syscall tools
- Syscall dispatch → Process management: dispatches process calls (evidence: `kernel/syscall/syscall.c`)
- Syscall dispatch → Virtual filesystem: dispatches filesystem calls (evidence: `kernel/syscall/syscall.c`)
- Process management → Memory and paging: uses address spaces (evidence: `kernel/process/process.c`)
- Virtual filesystem → EXT2 storage: uses disk store
- Device nodes → Virtual filesystem: creates device nodes (evidence: `kernel/dev/device_manager.c`)
- Device nodes → Device drivers: reads device input (evidence: `kernel/dev/device_manager.c`)
- Interactive shell → Shell UI: uses display UI (evidence: `tools/shell/shell.c`)
- Syscall dispatch → Display server: references display services (evidence: `kernel/syscall/syscall.c`)
- Display server → Framebuffer output: renders output
- Display server → Shell UI: draws desktop elements (evidence: `gui/src/display/srver/server.c`)
- User → Networking: uses network services
- User → Power lifecycle: requests lifecycle actions
