# frednora/gramado architecture

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

- Interactive diagram: https://gitdiagram.com/frednora/gramado
- Repository: https://github.com/frednora/gramado

## Overview

Gramado is an operating system with a kernel, bootloader, system services, and a desktop environment. The principal user-facing path is boot into the OS, start the init process, launch the window system and desktop applications, then interact through windows, a taskbar, or a terminal. The tree also shows distinct filesystem, device, networking, and graphics subsystems. Relationships are limited to those visible in excerpts or explicitly documented in the README; some likely subsystem interactions remain unverified.

Main entry points: [`core/sysd/src/main.c`](https://github.com/frednora/gramado/blob/main/core/sysd/src/main.c) (Init Process), [`gramde/velo3d/eng00/main.c`](https://github.com/frednora/gramado/blob/main/gramde/velo3d/eng00/main.c) (Window Server), [`core/castleos/garden/entry/kmain.c`](https://github.com/frednora/gramado/blob/main/core/castleos/garden/entry/kmain.c) (Kernel Entry), [`core/castleos/gthouse/fs/fs.c`](https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/fs/fs.c) (Filesystem)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot"]
  node_bootloader["x86 Bootloader<br/>[bl.h]"]
end

subgraph group_kernel["Kernel Services"]
  node_init["Init Process<br/>[main.c]"]
  node_kernel_entry["Kernel Entry<br/>[kmain.c]"]
  node_scheduler["Scheduling<br/>[sched.c]"]
  node_memory["Memory Management<br/>[mm.c]"]
  node_filesystem["Filesystem<br/>[fs.c]"]
  node_vfs["Virtual Filesystem<br/>[vfs.c]"]
end

subgraph group_hardware["Hardware"]
  node_block_storage["Block Storage<br/>[storage.c]"]
  node_display_driver["VGA Driver<br/>[main.c]"]
end

subgraph group_network["Networking"]
  node_network_stack["Network Stack<br/>[net.c]"]
  node_http["HTTP Services<br/>[http.c]"]
  node_network_daemon["Network Daemon<br/>[main.c]"]
end

subgraph group_desktop["Desktop Environment"]
  node_compositor["Compositor<br/>[main.c]"]
  node_window_server["Window Server<br/>[main.c]"]
  node_desktop_shell["Desktop<br/>[main.c]"]
  node_taskbar["Taskbar<br/>[main.c]"]
  node_terminal["Terminal<br/>[main.c]"]
  node_shell["Command Shell<br/>[main.c]"]
  node_apps["GUI Applications<br/>[main.c]"]
  node_three_d_demo["3D Demo<br/>[main.c]"]
end

node_user(("User"))

node_bootloader -.->|"starts kernel"| node_kernel_entry
node_kernel_entry -.->|"starts init"| node_init
node_init -->|"launches"| node_compositor
node_user -.->|"uses desktop"| node_desktop_shell
node_user -.->|"uses terminal"| node_terminal
node_taskbar -->|"launches app"| node_apps
node_terminal -->|"connects to display"| node_window_server
node_shell -.->|"accepts commands"| node_user
node_init -.->|"starts demo server"| node_window_server
node_filesystem -.->|"uses filesystem layer"| node_vfs
node_network_daemon -.->|"uses network stack"| node_network_stack
node_http -.->|"uses network services"| node_network_stack
node_block_storage -.->|"backs filesystem"| node_filesystem
node_display_driver -.->|"provides display"| node_compositor
node_three_d_demo -.->|"uses window system"| node_window_server

click node_bootloader "https://github.com/frednora/gramado/blob/main/core/boot/arch/x86/bsp/blgram/bl.h"
click node_init "https://github.com/frednora/gramado/blob/main/core/sysd/src/main.c"
click node_kernel_entry "https://github.com/frednora/gramado/blob/main/core/castleos/garden/entry/kmain.c"
click node_scheduler "https://github.com/frednora/gramado/blob/main/core/castleos/halls/dev/exec/ke/intake/sched/sched.c"
click node_memory "https://github.com/frednora/gramado/blob/main/core/castleos/halls/dev/req/mm/mm.c"
click node_filesystem "https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/fs/fs.c"
click node_vfs "https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/fs/vfs.c"
click node_network_stack "https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/net/net.c"
click node_http "https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/gramnet/http.c"
click node_network_daemon "https://github.com/frednora/gramado/blob/main/core/modules/servers/network/netd/server/main.c"
click node_block_storage "https://github.com/frednora/gramado/blob/main/core/castleos/halls/dev/per/blkdev/storage.c"
click node_display_driver "https://github.com/frednora/gramado/blob/main/core/modules/servers/vgad/src/main.c"
click node_compositor "https://github.com/frednora/gramado/blob/main/gramde/winsys/comp00/src/main.c"
click node_window_server "https://github.com/frednora/gramado/blob/main/gramde/velo3d/eng00/main.c"
click node_desktop_shell "https://github.com/frednora/gramado/blob/main/gramde/shell/winshell/desktop/main.c"
click node_taskbar "https://github.com/frednora/gramado/blob/main/gramde/shell/winshell/taskbar/main.c"
click node_terminal "https://github.com/frednora/gramado/blob/main/gramde/shell/winshell/terminal/main.c"
click node_shell "https://github.com/frednora/gramado/blob/main/gramde/cmds/cmds00/shellxxx/main.c"
click node_apps "https://github.com/frednora/gramado/blob/main/gramde/shell/winapps/calc/main.c"
click node_three_d_demo "https://github.com/frednora/gramado/blob/main/gramde/velo3d/eng00/main.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_user toneBlue
class node_init,node_kernel_entry,node_scheduler,node_memory,node_filesystem,node_vfs toneAmber
class node_block_storage,node_display_driver toneMint
class node_network_stack,node_http,node_network_daemon toneRose
class node_compositor,node_window_server,node_desktop_shell,node_taskbar,node_terminal,node_shell,node_apps,node_three_d_demo toneIndigo
```

## Components

### Boot

- [x86 Bootloader](https://github.com/frednora/gramado/blob/main/core/boot/arch/x86/bsp/blgram/bl.h): `core/boot/arch/x86/bsp/blgram/bl.h`

### Kernel Services

- [Init Process](https://github.com/frednora/gramado/blob/main/core/sysd/src/main.c): `core/sysd/src/main.c`
- [Kernel Entry](https://github.com/frednora/gramado/blob/main/core/castleos/garden/entry/kmain.c): `core/castleos/garden/entry/kmain.c`
- [Scheduling](https://github.com/frednora/gramado/blob/main/core/castleos/halls/dev/exec/ke/intake/sched/sched.c): `core/castleos/halls/dev/exec/ke/intake/sched/sched.c`
- [Memory Management](https://github.com/frednora/gramado/blob/main/core/castleos/halls/dev/req/mm/mm.c): `core/castleos/halls/dev/req/mm/mm.c`
- [Filesystem](https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/fs/fs.c): `core/castleos/gthouse/fs/fs.c`
- [Virtual Filesystem](https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/fs/vfs.c): `core/castleos/gthouse/fs/vfs.c`

### Hardware

- [Block Storage](https://github.com/frednora/gramado/blob/main/core/castleos/halls/dev/per/blkdev/storage.c): `core/castleos/halls/dev/per/blkdev/storage.c`
- [VGA Driver](https://github.com/frednora/gramado/blob/main/core/modules/servers/vgad/src/main.c): `core/modules/servers/vgad/src/main.c`

### Networking

- [Network Stack](https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/net/net.c): `core/castleos/gthouse/net/net.c`
- [HTTP Services](https://github.com/frednora/gramado/blob/main/core/castleos/gthouse/gramnet/http.c): `core/castleos/gthouse/gramnet/http.c`
- [Network Daemon](https://github.com/frednora/gramado/blob/main/core/modules/servers/network/netd/server/main.c): `core/modules/servers/network/netd/server/main.c`

### Desktop Environment

- [Compositor](https://github.com/frednora/gramado/blob/main/gramde/winsys/comp00/src/main.c): `gramde/winsys/comp00/src/main.c`
- [Window Server](https://github.com/frednora/gramado/blob/main/gramde/velo3d/eng00/main.c): `gramde/velo3d/eng00/main.c`
- [Desktop](https://github.com/frednora/gramado/blob/main/gramde/shell/winshell/desktop/main.c): `gramde/shell/winshell/desktop/main.c`
- [Taskbar](https://github.com/frednora/gramado/blob/main/gramde/shell/winshell/taskbar/main.c): `gramde/shell/winshell/taskbar/main.c`
- [Terminal](https://github.com/frednora/gramado/blob/main/gramde/shell/winshell/terminal/main.c): `gramde/shell/winshell/terminal/main.c`
- [Command Shell](https://github.com/frednora/gramado/blob/main/gramde/cmds/cmds00/shellxxx/main.c): `gramde/cmds/cmds00/shellxxx/main.c`
- [GUI Applications](https://github.com/frednora/gramado/blob/main/gramde/shell/winapps/calc/main.c): `gramde/shell/winapps/calc/main.c`
- [3D Demo](https://github.com/frednora/gramado/blob/main/gramde/velo3d/eng00/main.c): `gramde/velo3d/eng00/main.c`

### Other components

- **User**

## Connections

- x86 Bootloader → Kernel Entry: starts kernel
- Kernel Entry → Init Process: starts init
- Init Process → Compositor: launches (evidence: `core/sysd/src/main.c`)
- User → Desktop: uses desktop (evidence: `README.md`)
- User → Terminal: uses terminal
- Taskbar → GUI Applications: launches app (evidence: `gramde/shell/winshell/taskbar/main.c`)
- Terminal → Window Server: connects to display (evidence: `gramde/shell/winshell/terminal/main.c`)
- Command Shell → User: accepts commands
- Init Process → Window Server: starts demo server (evidence: `gramde/velo3d/eng00/main.c`)
- Filesystem → Virtual Filesystem: uses filesystem layer
- Network Daemon → Network Stack: uses network stack
- HTTP Services → Network Stack: uses network services
- Block Storage → Filesystem: backs filesystem
- VGA Driver → Compositor: provides display
- 3D Demo → Window Server: uses window system (evidence: `gramde/velo3d/eng00/main.c`)
