How cawarus/cawos_python works
Project type and purpose
• This is a Python-based, command-line “OS emulator” or microkernel environment.
• Purpose: simulate booting, kernel operations, shell interaction, and built-in utilities (cat, ls, ping, etc.) plus a simple app framework (under data/app).
File structure
Top-level:
• main.py + run.bat – entry point for the simulator
• core/ – kernel and runtime modules
– boot.py / fastboot.py – bootloader logic
– os/ – two kernel implementations (CawOS & SimplOS)
– shell.py – command-interpreter
– bin/ – each command is a Python script plugin
– fs/ – virtual file-system logic
– input/ – keyboard driver
– logger.py – system logging service
– auth.py, verify.py, secury.py, recovery.py – security & recovery services
• data/ – persistent runtime data
– json/ – configurations (boot_mode.json, exit_status.json)
– app/ – user applications (calculator, clock, etc.)
– log/ – runtime logs
Extract insights from the README
• Minimal description (“Working in progress”) so rely on code layout.
Main components & interactions
a. Components:
1. Bootloader (core/boot.py & fastboot.py)
2. Kernel (core/os/CawOS or core/os/SimplOS)
3. Core Services within Kernel:
• File System (core/fs/fs.py)
• Logger (core/logger.py)
• Input Driver (core/input/keyboard.py)
• Security & Auth (core/auth.py, core/verify.py, core/secury.py)
• Recovery (core/recovery.py)
4. Shell (core/shell.py)
5. Built-in Utilities (core/bin/*.py)
6. User Apps (data/app/*.py)
7. Persistent Data Store (data/json/, data/log/)
8. Host Interface (main.py / run.bat)
b. Relationships & data flows:
• Host Interface launches Bootloader → Kernel
• Kernel initializes Services → mounts File System & Logger
• Kernel activates Shell → listens for Input
• Shell parses commands → dynamically loads bin/* modules or user apps
• Commands & Apps invoke FS & Logger & Security APIs
• Logs written to data/log; configs read from data/json
c. Architectural patterns & principles:
• Modular monolith with plugin-style commands/apps
• Layered: Bootloader → Kernel Core → Services → Shell → Plugins
• Single responsibility per module (FS, Logger, Input, Security)
d. Key technologies:
• Python’s import mechanism for dynamic command/app loading
• JSON for configuration and status
• File-based persistence in data/log and data/json