# cai114514114514/logitos architecture

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

- Interactive diagram: https://gitdiagram.com/cai114514114514/logitos
- Repository: https://github.com/cai114514114514/logitos
- Video tour (about a minute): https://gitdiagram.com/cai114514114514/logitos/video

## Overview

LogitOS is an experimental x86_64 operating system, from its own boot path through a kernel, drivers, filesystems and user-facing applications. The README’s principal user workflow is browsing: enter a URL, fetch a selected HTTP(S) page, parse and style it, lay it out, and render it; JavaScript can keep pages interactive. Other major product branches include the desktop, POSIX-inspired processes and shell, and AetherScript with its compiler and IDE. Browser internals are represented at domain-stage level. The tree and sampled excerpts do not expose the boot implementation, network stack, or multimedia decoders, so those are not mapped as detailed components.

Main entry points: [`c/apps/gui/browser/app/main.c`](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/app/main.c) (Browser App), [`c/apps/as/cli/main.c`](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/cli/main.c) (AetherScript CLI), [`c/kernel/core/settings.c`](https://github.com/cai114514114514/logitos/blob/main/c/kernel/core/settings.c) (Kernel Services), [`c/apps/gui/aui.c`](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/aui.c) (Desktop UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["OS Platform"]
  node_kernel["Kernel Services<br/>[settings.c]"]
  node_drivers["Device Drivers<br/>[device.c]"]
  node_vfs["Virtual Filesystem<br/>[vfs.c]"]
  node_logitfs[("LogitFS<br/>[logitfs.c]")]
  node_processes["Processes<br/>[runtime.c]"]
  node_shell["Shell<br/>[sh.c]"]
end

subgraph group_desktop["Desktop"]
  node_desktopui["Desktop UI<br/>[aui.c]"]
  node_terminal["Terminal<br/>[terminal.c]"]
end

subgraph group_browser["Web Browser"]
  node_browserapp["Browser App<br/>[main.c]"]
  node_fetch["Page Fetch<br/>[fetch.h]"]
  node_tokenizer["HTML Tokenizer<br/>[tokenizer.c]"]
  node_domtree["DOM Construction<br/>[tree.c]"]
  node_css["CSS Engine<br/>[engine.c]"]
  node_layout["Page Layout<br/>[block.c]"]
  node_renderer["Page Renderer<br/>[renderer.c]"]
  node_jsruntime["JavaScript Runtime<br/>[page.c]"]
  node_jsdom["JavaScript DOM<br/>[dom.c]"]
  node_network["Network Services"]
end

subgraph group_language["AetherScript"]
  node_ascli["AetherScript CLI<br/>[main.c]"]
  node_frontend["Language Frontend<br/>[parser.c]"]
  node_sema["Semantic Analysis<br/>[check.c]"]
  node_llvm["LLVM Backend<br/>[emit.c]"]
  node_asruntime["Language Runtime<br/>[object.c]"]
  node_studio["Language IDE<br/>[studio.c]"]
  node_compiler["AetherScript Compiler<br/>[main.c]"]
end

node_user(("User"))
node_firmware(("System Firmware"))

node_firmware -->|"boots"| node_kernel
node_user -->|"uses"| node_desktopui
node_desktopui -->|"opens"| node_browserapp
node_desktopui -->|"opens"| node_terminal
node_terminal -->|"runs"| node_shell
node_shell -->|"launches"| node_processes
node_processes -->|"uses services"| node_kernel
node_kernel -->|"controls devices"| node_drivers
node_kernel -->|"serves files"| node_vfs
node_vfs -->|"mounts"| node_logitfs
node_browserapp -->|"requests pages"| node_fetch
node_fetch -->|"uses"| node_network
node_browserapp -->|"tokenizes markup"| node_tokenizer
node_tokenizer -->|"produces tokens"| node_domtree
node_browserapp -->|"builds document"| node_domtree
node_browserapp -->|"computes styles"| node_css
node_browserapp -->|"lays out page"| node_layout
node_browserapp -->|"renders page"| node_renderer
node_browserapp -->|"runs scripts"| node_jsruntime
node_jsruntime -->|"accesses DOM"| node_jsdom
node_user -->|"runs programs"| node_ascli
node_ascli -->|"parses source"| node_frontend
node_ascli -->|"checks types"| node_sema
node_ascli -->|"generates code"| node_llvm
node_ascli -->|"executes with"| node_asruntime
node_user -->|"edits programs"| node_studio
node_studio -->|"runs checks"| node_compiler

click node_kernel "https://github.com/cai114514114514/logitos/blob/main/c/kernel/core/settings.c"
click node_drivers "https://github.com/cai114514114514/logitos/blob/main/c/drivers/core/device.c"
click node_vfs "https://github.com/cai114514114514/logitos/blob/main/c/fs/vfs/vfs.c"
click node_logitfs "https://github.com/cai114514114514/logitos/blob/main/c/fs/logitfs/logitfs.c"
click node_processes "https://github.com/cai114514114514/logitos/blob/main/c/apps/libc/src/runtime.c"
click node_shell "https://github.com/cai114514114514/logitos/blob/main/c/apps/coreutils/sh.c"
click node_desktopui "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/aui.c"
click node_terminal "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/terminal/terminal.c"
click node_browserapp "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/app/main.c"
click node_fetch "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/net/fetch.h"
click node_tokenizer "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/html/tokenizer.c"
click node_domtree "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/html/tree.c"
click node_css "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/css/engine.c"
click node_layout "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/layout/block.c"
click node_renderer "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/paint/renderer.c"
click node_jsruntime "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/js/runtime/page.c"
click node_jsdom "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/js/dom/dom.c"
click node_network "https://github.com/cai114514114514/logitos/tree/main/c/apps/gui/browser/net"
click node_ascli "https://github.com/cai114514114514/logitos/blob/main/c/apps/as/cli/main.c"
click node_frontend "https://github.com/cai114514114514/logitos/blob/main/c/apps/as/frontend/parser.c"
click node_sema "https://github.com/cai114514114514/logitos/blob/main/c/apps/as/sema/check.c"
click node_llvm "https://github.com/cai114514114514/logitos/blob/main/c/apps/as/backend/llvm/emit.c"
click node_asruntime "https://github.com/cai114514114514/logitos/blob/main/c/apps/as/runtime/object.c"
click node_studio "https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/studio/studio.c"
click node_compiler "https://github.com/cai114514114514/logitos/blob/main/c/apps/as/cli/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_kernel,node_drivers,node_vfs,node_logitfs,node_processes,node_shell,node_user toneBlue
class node_desktopui,node_terminal toneAmber
class node_browserapp,node_fetch,node_tokenizer,node_domtree,node_css,node_layout,node_renderer,node_jsruntime,node_jsdom,node_network toneMint
class node_ascli,node_frontend,node_sema,node_llvm,node_asruntime,node_studio,node_compiler toneRose
class node_firmware toneIndigo
```

## Components

### OS Platform

- [Kernel Services](https://github.com/cai114514114514/logitos/blob/main/c/kernel/core/settings.c): `c/kernel/core/settings.c`
- [Device Drivers](https://github.com/cai114514114514/logitos/blob/main/c/drivers/core/device.c): `c/drivers/core/device.c`
- [Virtual Filesystem](https://github.com/cai114514114514/logitos/blob/main/c/fs/vfs/vfs.c): `c/fs/vfs/vfs.c`
- [LogitFS](https://github.com/cai114514114514/logitos/blob/main/c/fs/logitfs/logitfs.c): `c/fs/logitfs/logitfs.c`
- [Processes](https://github.com/cai114514114514/logitos/blob/main/c/apps/libc/src/runtime.c): `c/apps/libc/src/runtime.c`
- [Shell](https://github.com/cai114514114514/logitos/blob/main/c/apps/coreutils/sh.c): `c/apps/coreutils/sh.c`

### Desktop

- [Desktop UI](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/aui.c): `c/apps/gui/aui.c`
- [Terminal](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/terminal/terminal.c): `c/apps/gui/terminal/terminal.c`

### Web Browser

- [Browser App](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/app/main.c): `c/apps/gui/browser/app/main.c`
- [Page Fetch](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/net/fetch.h): `c/apps/gui/browser/net/fetch.h`
- [HTML Tokenizer](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/html/tokenizer.c): `c/apps/gui/browser/html/tokenizer.c`
- [DOM Construction](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/html/tree.c): `c/apps/gui/browser/html/tree.c`
- [CSS Engine](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/css/engine.c): `c/apps/gui/browser/css/engine.c`
- [Page Layout](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/layout/block.c): `c/apps/gui/browser/layout/block.c`
- [Page Renderer](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/paint/renderer.c): `c/apps/gui/browser/paint/renderer.c`
- [JavaScript Runtime](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/js/runtime/page.c): `c/apps/gui/browser/js/runtime/page.c`
- [JavaScript DOM](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/browser/js/dom/dom.c): `c/apps/gui/browser/js/dom/dom.c`
- [Network Services](https://github.com/cai114514114514/logitos/tree/main/c/apps/gui/browser/net): `c/apps/gui/browser/net`

### AetherScript

- [AetherScript CLI](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/cli/main.c): `c/apps/as/cli/main.c`
- [Language Frontend](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/frontend/parser.c): `c/apps/as/frontend/parser.c`
- [Semantic Analysis](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/sema/check.c): `c/apps/as/sema/check.c`
- [LLVM Backend](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/backend/llvm/emit.c): `c/apps/as/backend/llvm/emit.c`
- [Language Runtime](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/runtime/object.c): `c/apps/as/runtime/object.c`
- [Language IDE](https://github.com/cai114514114514/logitos/blob/main/c/apps/gui/studio/studio.c): `c/apps/gui/studio/studio.c`
- [AetherScript Compiler](https://github.com/cai114514114514/logitos/blob/main/c/apps/as/cli/main.c): `c/apps/as/cli/main.c`

### Other components

- **User**
- **System Firmware**

## Connections

- System Firmware → Kernel Services: boots
- User → Desktop UI: uses
- Desktop UI → Browser App: opens
- Desktop UI → Terminal: opens
- Terminal → Shell: runs
- Shell → Processes: launches
- Processes → Kernel Services: uses services
- Kernel Services → Device Drivers: controls devices
- Kernel Services → Virtual Filesystem: serves files
- Virtual Filesystem → LogitFS: mounts
- Browser App → Page Fetch: requests pages
- Page Fetch → Network Services: uses
- Browser App → HTML Tokenizer: tokenizes markup
- HTML Tokenizer → DOM Construction: produces tokens
- Browser App → DOM Construction: builds document
- Browser App → CSS Engine: computes styles
- Browser App → Page Layout: lays out page
- Browser App → Page Renderer: renders page
- Browser App → JavaScript Runtime: runs scripts
- JavaScript Runtime → JavaScript DOM: accesses DOM
- User → AetherScript CLI: runs programs
- AetherScript CLI → Language Frontend: parses source
- AetherScript CLI → Semantic Analysis: checks types
- AetherScript CLI → LLVM Backend: generates code
- AetherScript CLI → Language Runtime: executes with
- User → Language IDE: edits programs
- Language IDE → AetherScript Compiler: runs checks
