# gabriel-rb-devc/sagui-fork architecture

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

- Interactive diagram: https://gitdiagram.com/gabriel-rb-devc/sagui-fork
- Repository: https://github.com/gabriel-rb-devc/sagui-fork

## Overview

SaguiOS is a 32-bit x86 operating system, from its own boot process through kernel services to graphical and command-line applications. The main user workflow is booting the system, opening the desktop or terminal, and launching programs; documented capabilities also include Cipó, Sagui 3D, a C compiler, Sagui Code, networking, audio, and video. The graph preserves these product branches and key kernel interfaces. Several subsystem links are documented in the README; unsampled implementation details are not inferred.

Main entry points: [`userland/programas/sagsh.c`](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/userland/programas/sagsh.c) (Sagsh shell), [`userland/ssh`](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/ssh) (SSH client), [`kernel/nucleo/principal.c`](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/nucleo/principal.c) (Kernel startup), [`kernel/nucleo/processos.c`](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/nucleo/processos.c) (Processes and syscalls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel and hardware"]
  node_kernel_entry["Kernel startup<br/>[principal.c]"]
  node_processes["Processes and syscalls<br/>[processos.c]"]
  node_kernel_interfaces["Kernel interfaces"]
  node_memory["Memory management"]
  node_storage[("Filesystems")]
  node_usb["USB support"]
end

subgraph group_desktop["Desktop and shell"]
  node_window_manager["Window manager<br/>[janelas.c]"]
  node_desktop_area["Desktop area<br/>[area_trabalho.c]"]
  node_shell["Sagsh shell<br/>[sagsh.c]"]
  node_terminal["Terminal<br/>[terminal.c]"]
end

subgraph group_apps["Applications"]
  node_libsagui["Program library"]
  node_browser["Cipó browser"]
  node_compiler["C compiler"]
  node_saguicode["Sagui Code"]
  node_games["Games and 3D"]
end

subgraph group_network["Network and security"]
  node_network_stack["Network stack<br/>[rede.c]"]
  node_ssh["SSH client"]
  node_tls["TLS and certificates"]
end

subgraph group_media["Media"]
  node_audio["Audio player"]
  node_video["Video playback"]
  node_h264_tables["H.264 tables<br/>[cabac_tab.h]"]
end

node_user(("Computer user"))

node_user -->|"boots system"| node_kernel_entry
node_kernel_entry -->|"starts processes"| node_processes
node_processes -->|"runs shell"| node_shell
node_user -->|"uses desktop"| node_desktop_area
node_desktop_area -->|"opens windows"| node_window_manager
node_user -->|"uses terminal"| node_terminal
node_terminal -->|"runs shell"| node_shell
node_shell -.->|"launches programs"| node_browser
node_shell -.->|"launches programs"| node_compiler
node_shell -.->|"launches programs"| node_saguicode
node_shell -.->|"launches programs"| node_games
node_shell -.->|"launches programs"| node_audio
node_shell -.->|"launches programs"| node_video
node_browser -.->|"uses networking"| node_network_stack
node_ssh -.->|"uses networking"| node_network_stack
node_ssh -.->|"uses security"| node_tls
node_video -->|"uses tables"| node_h264_tables

click node_kernel_entry "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/nucleo/principal.c"
click node_processes "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/nucleo/processos.c"
click node_kernel_interfaces "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/inc"
click node_memory "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/mem"
click node_storage "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/fs"
click node_network_stack "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/rede/rede.c"
click node_usb "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/usb"
click node_window_manager "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/gui/janelas.c"
click node_desktop_area "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/gui/area_trabalho.c"
click node_shell "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/userland/programas/sagsh.c"
click node_terminal "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/userland/programas/terminal.c"
click node_libsagui "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/libsagui"
click node_browser "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/navegador"
click node_compiler "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/compilador"
click node_saguicode "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/saguicode"
click node_games "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/sagui3d"
click node_ssh "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/ssh"
click node_tls "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/tls"
click node_audio "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/tocador"
click node_video "https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/video"
click node_h264_tables "https://github.com/gabriel-rb-devc/sagui-fork/blob/main/terceiros/ffmpeg-h264-tabelas/cabac_tab.h"

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_entry,node_processes,node_kernel_interfaces,node_memory,node_storage,node_usb,node_user toneBlue
class node_window_manager,node_desktop_area,node_shell,node_terminal toneAmber
class node_libsagui,node_browser,node_compiler,node_saguicode,node_games toneMint
class node_network_stack,node_ssh,node_tls toneRose
class node_audio,node_video,node_h264_tables toneIndigo
```

## Components

### Kernel and hardware

- [Kernel startup](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/nucleo/principal.c): `kernel/nucleo/principal.c`
- [Processes and syscalls](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/nucleo/processos.c): `kernel/nucleo/processos.c`
- [Kernel interfaces](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/inc): `kernel/inc`
- [Memory management](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/mem): `kernel/mem`
- [Filesystems](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/fs): `kernel/fs`
- [USB support](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/kernel/usb): `kernel/usb`

### Desktop and shell

- [Window manager](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/gui/janelas.c): `kernel/gui/janelas.c`
- [Desktop area](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/gui/area_trabalho.c): `kernel/gui/area_trabalho.c`
- [Sagsh shell](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/userland/programas/sagsh.c): `userland/programas/sagsh.c`
- [Terminal](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/userland/programas/terminal.c): `userland/programas/terminal.c`

### Applications

- [Program library](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/libsagui): `userland/libsagui`
- [Cipó browser](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/navegador): `userland/navegador`
- [C compiler](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/compilador): `userland/compilador`
- [Sagui Code](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/saguicode): `userland/saguicode`
- [Games and 3D](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/sagui3d): `userland/sagui3d`

### Network and security

- [Network stack](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/kernel/rede/rede.c): `kernel/rede/rede.c`
- [SSH client](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/ssh): `userland/ssh`
- [TLS and certificates](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/tls): `userland/tls`

### Media

- [Audio player](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/tocador): `userland/tocador`
- [Video playback](https://github.com/gabriel-rb-devc/sagui-fork/tree/main/userland/video): `userland/video`
- [H.264 tables](https://github.com/gabriel-rb-devc/sagui-fork/blob/main/terceiros/ffmpeg-h264-tabelas/cabac_tab.h): `terceiros/ffmpeg-h264-tabelas/cabac_tab.h`

### Other components

- **Computer user**

## Connections

- Computer user → Kernel startup: boots system
- Kernel startup → Processes and syscalls: starts processes
- Processes and syscalls → Sagsh shell: runs shell
- Computer user → Desktop area: uses desktop
- Desktop area → Window manager: opens windows
- Computer user → Terminal: uses terminal
- Terminal → Sagsh shell: runs shell
- Sagsh shell → Cipó browser: launches programs
- Sagsh shell → C compiler: launches programs
- Sagsh shell → Sagui Code: launches programs
- Sagsh shell → Games and 3D: launches programs
- Sagsh shell → Audio player: launches programs
- Sagsh shell → Video playback: launches programs
- Cipó browser → Network stack: uses networking
- SSH client → Network stack: uses networking
- SSH client → TLS and certificates: uses security
- Video playback → H.264 tables: uses tables (evidence: `userland/video/h264.c`)
