# atwodots/minios-esp architecture

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

## Overview

MiniOS-ESP is a FreeRTOS-based command-line OS for microcontrollers, with serial input and an ST7789 display. Its main workflow is serial input into the shell, command handling, then application services such as file, network, time, and calculator operations. Kernel processes and hardware drivers support that workflow; settings, themes, graphing, and screensavers provide distinct user-facing capabilities. Several application implementations were not sampled, so those capability links rely on the README rather than inspected calls.

Main entry points: [`src/coresys/commands.cpp`](https://github.com/atwodots/minios-esp/blob/master/src/coresys/commands.cpp) (Command handling), [`src/drivers/display.cpp`](https://github.com/atwodots/minios-esp/blob/master/src/drivers/display.cpp) (Display rendering), [`src/apps/tools/settings.cpp`](https://github.com/atwodots/minios-esp/blob/master/src/apps/tools/settings.cpp) (Interactive settings), [`src/drivers/network.cpp`](https://github.com/atwodots/minios-esp/blob/master/src/drivers/network.cpp) (WiFi and HTTP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Kernel and shell"]
  node_main["System startup<br/>[main.cpp]"]
  node_kernel["Process kernel<br/>[kernel.cpp]"]
  node_shell["Command shell<br/>[shell.cpp]"]
  node_commands["Command handling<br/>[commands.cpp]"]
end

subgraph group_services["User services"]
  node_filesystem["File management<br/>[filesystem.cpp]"]
  node_network["WiFi and HTTP<br/>[network.cpp]"]
  node_time["Time and alarms<br/>[timeutils.cpp]"]
  node_calculator["Expression calculator<br/>[calc.cpp]"]
  node_grapher["Function graphing<br/>[grapher.cpp]"]
  node_settings["Interactive settings<br/>[settings.cpp]"]
  node_games["Games"]
  node_mirror["Mirror utility<br/>[mirror.cpp]"]
end

subgraph group_hardware["Drivers and display"]
  node_display["Display rendering<br/>[display.cpp]"]
  node_tft["ST7789 driver"]
end

subgraph group_state["System configuration"]
  node_theme["Theme system<br/>[theme.cpp]"]
  node_config["Persistent configuration<br/>[config.cpp]"]
  node_wallpaper["Wallpaper system<br/>[wallpaper.cpp]"]
end

node_user(("Terminal user"))
node_serial(("Serial interface"))
node_spiffs[("SPIFFS storage")]
node_wifi(("WiFi network"))
node_ntp(("NTP service"))

node_user -->|"enters commands"| node_serial
node_serial -->|"provides input"| node_shell
node_main -->|"initializes"| node_display
node_main -->|"initializes"| node_kernel
node_main -->|"starts process"| node_shell
node_shell -->|"dispatches commands"| node_commands
node_commands -->|"handles file commands"| node_filesystem
node_commands -->|"handles network commands"| node_network
node_commands -->|"handles time commands"| node_time
node_commands -->|"handles calculations"| node_calculator
node_commands -->|"offers graphing"| node_grapher
node_commands -.->|"offers settings"| node_settings
node_commands -.->|"offers games"| node_games
node_commands -.->|"offers mirror utility"| node_mirror
node_filesystem -->|"reads and writes"| node_spiffs
node_network -->|"connects"| node_wifi
node_network -.->|"synchronizes time"| node_ntp
node_settings -->|"controls WiFi"| node_network
node_settings -->|"selects theme"| node_theme
node_settings -->|"reads device settings"| node_config
node_theme -.->|"persists selection"| node_config
node_display -->|"reads theme"| node_theme
node_display -->|"draws wallpaper"| node_wallpaper
node_display -->|"renders through"| node_tft
node_display -->|"mirrors output"| node_serial
node_time -->|"synchronizes"| node_ntp

click node_main "https://github.com/atwodots/minios-esp/blob/master/src/kernel/main.cpp"
click node_kernel "https://github.com/atwodots/minios-esp/blob/master/src/kernel/kernel.cpp"
click node_shell "https://github.com/atwodots/minios-esp/blob/master/src/coresys/shell.cpp"
click node_commands "https://github.com/atwodots/minios-esp/blob/master/src/coresys/commands.cpp"
click node_filesystem "https://github.com/atwodots/minios-esp/blob/master/src/drivers/filesystem.cpp"
click node_network "https://github.com/atwodots/minios-esp/blob/master/src/drivers/network.cpp"
click node_time "https://github.com/atwodots/minios-esp/blob/master/src/apps/misc/timeutils.cpp"
click node_calculator "https://github.com/atwodots/minios-esp/blob/master/src/apps/tools/calc.cpp"
click node_grapher "https://github.com/atwodots/minios-esp/blob/master/src/apps/misc/grapher.cpp"
click node_settings "https://github.com/atwodots/minios-esp/blob/master/src/apps/tools/settings.cpp"
click node_games "https://github.com/atwodots/minios-esp/tree/master/src/apps/games"
click node_mirror "https://github.com/atwodots/minios-esp/blob/master/src/apps/misc/mirror.cpp"
click node_theme "https://github.com/atwodots/minios-esp/blob/master/src/coresys/theme.cpp"
click node_config "https://github.com/atwodots/minios-esp/blob/master/src/coresys/config.cpp"
click node_wallpaper "https://github.com/atwodots/minios-esp/blob/master/src/coresys/wallpaper.cpp"
click node_display "https://github.com/atwodots/minios-esp/blob/master/src/drivers/display.cpp"
click node_tft "https://github.com/atwodots/minios-esp/blob/master/lib/Adafruit_ST7789/Adafruit_ST7789.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_main,node_kernel,node_shell,node_commands,node_user toneBlue
class node_filesystem,node_network,node_time,node_calculator,node_grapher,node_settings,node_games,node_mirror,node_spiffs toneAmber
class node_display,node_tft toneMint
class node_theme,node_config,node_wallpaper toneRose
class node_serial,node_wifi,node_ntp toneIndigo
```

## Components

### Kernel and shell

- [System startup](https://github.com/atwodots/minios-esp/blob/master/src/kernel/main.cpp): `src/kernel/main.cpp`
- [Process kernel](https://github.com/atwodots/minios-esp/blob/master/src/kernel/kernel.cpp): `src/kernel/kernel.cpp`
- [Command shell](https://github.com/atwodots/minios-esp/blob/master/src/coresys/shell.cpp): `src/coresys/shell.cpp`
- [Command handling](https://github.com/atwodots/minios-esp/blob/master/src/coresys/commands.cpp): `src/coresys/commands.cpp`

### User services

- [File management](https://github.com/atwodots/minios-esp/blob/master/src/drivers/filesystem.cpp): `src/drivers/filesystem.cpp`
- [WiFi and HTTP](https://github.com/atwodots/minios-esp/blob/master/src/drivers/network.cpp): `src/drivers/network.cpp`
- [Time and alarms](https://github.com/atwodots/minios-esp/blob/master/src/apps/misc/timeutils.cpp): `src/apps/misc/timeutils.cpp`
- [Expression calculator](https://github.com/atwodots/minios-esp/blob/master/src/apps/tools/calc.cpp): `src/apps/tools/calc.cpp`
- [Function graphing](https://github.com/atwodots/minios-esp/blob/master/src/apps/misc/grapher.cpp): `src/apps/misc/grapher.cpp`
- [Interactive settings](https://github.com/atwodots/minios-esp/blob/master/src/apps/tools/settings.cpp): `src/apps/tools/settings.cpp`
- [Games](https://github.com/atwodots/minios-esp/tree/master/src/apps/games): `src/apps/games`
- [Mirror utility](https://github.com/atwodots/minios-esp/blob/master/src/apps/misc/mirror.cpp): `src/apps/misc/mirror.cpp`

### Drivers and display

- [Display rendering](https://github.com/atwodots/minios-esp/blob/master/src/drivers/display.cpp): `src/drivers/display.cpp`
- [ST7789 driver](https://github.com/atwodots/minios-esp/blob/master/lib/Adafruit_ST7789/Adafruit_ST7789.cpp): `lib/Adafruit_ST7789/Adafruit_ST7789.cpp`

### System configuration

- [Theme system](https://github.com/atwodots/minios-esp/blob/master/src/coresys/theme.cpp): `src/coresys/theme.cpp`
- [Persistent configuration](https://github.com/atwodots/minios-esp/blob/master/src/coresys/config.cpp): `src/coresys/config.cpp`
- [Wallpaper system](https://github.com/atwodots/minios-esp/blob/master/src/coresys/wallpaper.cpp): `src/coresys/wallpaper.cpp`

### Other components

- **Terminal user**
- **Serial interface**
- **SPIFFS storage**
- **WiFi network**
- **NTP service**

## Connections

- Terminal user → Serial interface: enters commands
- Serial interface → Command shell: provides input
- System startup → Display rendering: initializes (evidence: `src/kernel/main.cpp`)
- System startup → Process kernel: initializes (evidence: `src/kernel/main.cpp`)
- System startup → Command shell: starts process (evidence: `src/kernel/main.cpp`)
- Command shell → Command handling: dispatches commands
- Command handling → File management: handles file commands
- Command handling → WiFi and HTTP: handles network commands
- Command handling → Time and alarms: handles time commands
- Command handling → Expression calculator: handles calculations
- Command handling → Function graphing: offers graphing
- Command handling → Interactive settings: offers settings
- Command handling → Games: offers games
- Command handling → Mirror utility: offers mirror utility
- File management → SPIFFS storage: reads and writes
- WiFi and HTTP → WiFi network: connects
- WiFi and HTTP → NTP service: synchronizes time
- Interactive settings → WiFi and HTTP: controls WiFi (evidence: `src/apps/tools/settings.cpp`)
- Interactive settings → Theme system: selects theme (evidence: `src/apps/tools/settings.cpp`)
- Interactive settings → Persistent configuration: reads device settings (evidence: `src/apps/tools/settings.cpp`)
- Theme system → Persistent configuration: persists selection
- Display rendering → Theme system: reads theme (evidence: `src/drivers/display.cpp`)
- Display rendering → Wallpaper system: draws wallpaper (evidence: `src/drivers/display.cpp`)
- Display rendering → ST7789 driver: renders through
- Display rendering → Serial interface: mirrors output (evidence: `src/drivers/display.cpp`)
- Time and alarms → NTP service: synchronizes
