# aboutuip/zeros-system-pro architecture

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

- Interactive diagram: https://gitdiagram.com/aboutuip/zeros-system-pro
- Repository: https://github.com/aboutuip/zeros-system-pro

## Overview

ZerOS-System-Pro is a browser-based teaching virtual machine, with a separate Obr-to-ZAP host compiler. The documented user journey is power-on and boot, motherboard hardware setup, then firmware loading a kernel from NAS onto CPU core 2; the display presents the machine state and keyboard supplies input. The graph also preserves the compiler’s source-to-binary capability. README-level behavior is included where source excerpts were unavailable; edges are limited to documented wiring and sampled dispatch behavior.

Main entry points: [`ZerOS-PRO/Boot/Boot.ts`](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Boot/Boot.ts) (Firmware boot), [`ZerOS-PRO/Hardware/Motherboard/Host/QueuedWorker.ts`](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/QueuedWorker.ts) (Queued workers), [`ZerOS-PRO/Hardware/Motherboard/Host/BoardDispatch.ts`](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/BoardDispatch.ts) (Board dispatch), [`ZerOS-PRO/Hardware/Memory/Controller/MemoryController.ts`](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Controller/MemoryController.ts) (Memory controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and display"]
  node_boot["Firmware boot<br/>[Boot.ts]"]
  node_display["Display host<br/>[PageHost.ts]"]
  node_keyboard["Keyboard input<br/>[PublishKeyboard.ts]"]
end

subgraph group_board["Board coordination"]
  node_board["Motherboard<br/>[Motherboard.ts]"]
  node_boarddispatch["Board dispatch<br/>[BoardDispatch.ts]"]
  node_query["Hardware query<br/>[HardwareQuery.ts]"]
  node_workers["Queued workers<br/>[QueuedWorker.ts]"]
end

subgraph group_hardware["Virtual hardware"]
  node_cpu["CPU runtime<br/>[CpuRuntime.ts]"]
  node_core["Core execution<br/>[CoreDispatch.ts]"]
  node_memory["Memory controller"]
  node_unit["Memory unit<br/>[MemoryUnit.ts]"]
  node_block["Memory blocks<br/>[MemoryBlock.ts]"]
  node_gpu["GPU runtime<br/>[GpuRuntime.ts]"]
  node_webgpu["WebGPU acceleration<br/>[WebGpuAccel.ts]"]
  node_nas["NAS service<br/>[serve.mjs]"]
end

subgraph group_compiler["Obr compiler"]
  node_compiler["Obr compiler CLI<br/>[obrc.cpp]"]
  node_lexer["Lexer<br/>[Lexer.cpp]"]
  node_parser["Parser<br/>[Parser.cpp]"]
  node_sema["Semantic analysis<br/>[Sema.cpp]"]
  node_codegen["Code generation<br/>[Generate.cpp]"]
end

node_user(("User"))

node_user -->|"powers on"| node_boot
node_boot -->|"starts board"| node_board
node_boot -->|"presents boot"| node_display
node_display -->|"shows output"| node_user
node_user -->|"presses keys"| node_keyboard
node_keyboard -->|"publishes input"| node_display
node_board -->|"dispatches work"| node_boarddispatch
node_boarddispatch -->|"queries hardware"| node_query
node_boarddispatch -->|"opens workers"| node_workers
node_workers -->|"loads module"| node_cpu
node_workers -->|"loads module"| node_memory
node_workers -->|"loads module"| node_gpu
node_cpu -->|"schedules cores"| node_core
node_memory -->|"creates units"| node_unit
node_memory -->|"creates blocks"| node_block
node_gpu -.->|"runs acceleration"| node_webgpu
node_boot -->|"loads kernel"| node_nas
node_nas -->|"supplies binary"| node_cpu
node_user -->|"compiles source"| node_compiler
node_compiler -->|"lexes source"| node_lexer
node_lexer -->|"provides tokens"| node_parser
node_parser -->|"provides syntax"| node_sema
node_sema -->|"provides checked program"| node_codegen

click node_boot "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Boot/Boot.ts"
click node_display "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Display/Host/PageHost.ts"
click node_keyboard "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Display/Host/PublishKeyboard.ts"
click node_board "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Bootstrap/Motherboard.ts"
click node_boarddispatch "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/BoardDispatch.ts"
click node_query "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/HardwareQuery.ts"
click node_workers "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/QueuedWorker.ts"
click node_cpu "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Cpu/Bootstrap/CpuRuntime.ts"
click node_core "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Cpu/Host/CoreDispatch.ts"
click node_memory "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Controller/MemoryController.ts"
click node_unit "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Unit/MemoryUnit.ts"
click node_block "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Block/MemoryBlock.ts"
click node_gpu "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Gpu/Bootstrap/GpuRuntime.ts"
click node_webgpu "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Gpu/Bootstrap/WebGpuAccel.ts"
click node_nas "https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Nas/Server/serve.mjs"
click node_compiler "https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/obrc.cpp"
click node_lexer "https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/Lexer.cpp"
click node_parser "https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/Parser.cpp"
click node_sema "https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/Sema.cpp"
click node_codegen "https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/codegen/Generate.cpp"

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_boot,node_display,node_keyboard,node_user toneBlue
class node_board,node_boarddispatch,node_query,node_workers toneAmber
class node_cpu,node_core,node_memory,node_unit,node_block,node_gpu,node_webgpu,node_nas toneMint
class node_compiler,node_lexer,node_parser,node_sema,node_codegen toneRose
```

## Components

### Boot and display

- [Firmware boot](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Boot/Boot.ts): `ZerOS-PRO/Boot/Boot.ts`
- [Display host](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Display/Host/PageHost.ts): `ZerOS-PRO/Hardware/Display/Host/PageHost.ts`
- [Keyboard input](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Display/Host/PublishKeyboard.ts): `ZerOS-PRO/Hardware/Display/Host/PublishKeyboard.ts`

### Board coordination

- [Motherboard](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Bootstrap/Motherboard.ts): `ZerOS-PRO/Hardware/Motherboard/Bootstrap/Motherboard.ts`
- [Board dispatch](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/BoardDispatch.ts): `ZerOS-PRO/Hardware/Motherboard/Host/BoardDispatch.ts`
- [Hardware query](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/HardwareQuery.ts): `ZerOS-PRO/Hardware/Motherboard/Host/HardwareQuery.ts`
- [Queued workers](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Motherboard/Host/QueuedWorker.ts): `ZerOS-PRO/Hardware/Motherboard/Host/QueuedWorker.ts`

### Virtual hardware

- [CPU runtime](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Cpu/Bootstrap/CpuRuntime.ts): `ZerOS-PRO/Hardware/Cpu/Bootstrap/CpuRuntime.ts`
- [Core execution](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Cpu/Host/CoreDispatch.ts): `ZerOS-PRO/Hardware/Cpu/Host/CoreDispatch.ts`
- [Memory controller](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Controller/MemoryController.ts): `ZerOS-PRO/Hardware/Memory/Controller/MemoryController.ts`
- [Memory unit](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Unit/MemoryUnit.ts): `ZerOS-PRO/Hardware/Memory/Unit/MemoryUnit.ts`
- [Memory blocks](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Memory/Block/MemoryBlock.ts): `ZerOS-PRO/Hardware/Memory/Block/MemoryBlock.ts`
- [GPU runtime](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Gpu/Bootstrap/GpuRuntime.ts): `ZerOS-PRO/Hardware/Gpu/Bootstrap/GpuRuntime.ts`
- [WebGPU acceleration](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Gpu/Bootstrap/WebGpuAccel.ts): `ZerOS-PRO/Hardware/Gpu/Bootstrap/WebGpuAccel.ts`
- [NAS service](https://github.com/aboutuip/zeros-system-pro/blob/main/ZerOS-PRO/Hardware/Nas/Server/serve.mjs): `ZerOS-PRO/Hardware/Nas/Server/serve.mjs`

### Obr compiler

- [Obr compiler CLI](https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/obrc.cpp): `Compiler/Obr/src/obrc.cpp`
- [Lexer](https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/Lexer.cpp): `Compiler/Obr/src/Lexer.cpp`
- [Parser](https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/Parser.cpp): `Compiler/Obr/src/Parser.cpp`
- [Semantic analysis](https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/Sema.cpp): `Compiler/Obr/src/Sema.cpp`
- [Code generation](https://github.com/aboutuip/zeros-system-pro/blob/main/Compiler/Obr/src/codegen/Generate.cpp): `Compiler/Obr/src/codegen/Generate.cpp`

### Other components

- **User**

## Connections

- User → Firmware boot: powers on
- Firmware boot → Motherboard: starts board
- Firmware boot → Display host: presents boot
- Display host → User: shows output
- User → Keyboard input: presses keys
- Keyboard input → Display host: publishes input
- Motherboard → Board dispatch: dispatches work
- Board dispatch → Hardware query: queries hardware
- Board dispatch → Queued workers: opens workers
- Queued workers → CPU runtime: loads module
- Queued workers → Memory controller: loads module
- Queued workers → GPU runtime: loads module
- CPU runtime → Core execution: schedules cores
- Memory controller → Memory unit: creates units
- Memory controller → Memory blocks: creates blocks
- GPU runtime → WebGPU acceleration: runs acceleration
- Firmware boot → NAS service: loads kernel
- NAS service → CPU runtime: supplies binary
- User → Obr compiler CLI: compiles source
- Obr compiler CLI → Lexer: lexes source
- Lexer → Parser: provides tokens
- Parser → Semantic analysis: provides syntax
- Semantic analysis → Code generation: provides checked program
