How ardyanptr/c3os works
C3OS is an embedded operating-system environment for ESP32-C3 and ESP8266 boards, combining a native command interface, on-device applications, persistent storage, and Lua scripting. Its principal documented workflow is user input through the firmware shell, command dispatch to a handler or script, and feedback through local display or serial. The tree also shows app/process management, games, Wi-Fi tools, crash recovery, and power management. Shell and storage relationships are documented in the README; sampled code confirms selected app, crash, and power behaviors, but not all subsystem wiring.
Main entry points: main.cpp Command Shell · process_manager.cpp Process Manager · lua_l.cpp Lua Integration · C3FS.cpp C3FS Storage
Components 21
Firmware Core
- Command Shell
src/main.cpp - BIOS and Boot
src/system16/BIOS.cpp - App Catalog
src/system16/app.h - Process Manager
src/component/process_manager.cpp - Display and Serial
src/component/ui_.h - Button Input
src/component/button.cpp
Applications
- Essential Apps
src/app/Essential - Game Clients
src/app/Game - Wi-Fi Tools
src/app/WiFiApp - App Store
src/app/Essential/StoreManager.cpp - File Manager
src/app/Essential/FileManager.cpp
Storage and Runtime
- Lua Integration
src/system16/lua_l/lua_l.cpp - Lua Runtime
lib/lua/src/lapi.c - C3FS Storage
src/system16/C3FS/C3FS.cpp - Filesystem Cache
src/system16/C3FS/C3FS_Cache.cpp
System Services
- Crash Engine
src/app/CrashApp/CrashEngine.cpp - Power Manager
src/system16/power_manager.cpp - Task Manager UI
src/UI/task_manager.h - Wi-Fi Service
src/component/wifiservice.cpp
Other components
- User
- LittleFS
Connections 21
- User → Command Shell: enters commands
- User → Button Input: presses controls
- Command Shell → Display and Serial: outputs feedback
- Command Shell → Lua Integration: invokes scripts
- Lua Integration → Lua Runtime: runs Lua
- BIOS and Boot → Command Shell: starts firmware
- App Catalog → Process Manager: provides app entries
- Process Manager → Display and Serial: clears app display
- Process Manager → Task Manager UI: manages processes
- Command Shell → Game Clients: starts game clients
- Command Shell → Essential Apps: dispatches app handlers
- File Manager → C3FS Storage: scans files
- File Manager → Lua Integration: runs Lua scripts
- App Store → Wi-Fi Service: uses Wi-Fi
- App Store → LittleFS: writes downloads
- C3FS Storage → LittleFS: stores files
- Filesystem Cache → C3FS Storage: caches filesystem data
- Crash Engine → LittleFS: persists crash logs
- Power Manager → Wi-Fi Service: changes Wi-Fi power
- Power Manager → Display and Serial: dims display
- Wi-Fi Tools → Wi-Fi Service: uses Wi-Fi