How starlightconsole/comet works
Main Components
a) Core Components:
• CLI Interface (from cli.rs)
• Serial Communication Handler (from serial.rs and serial/device.rs)
• QEMU Integration (from serial/qemu.rs)
• Port Management (from port.rs)
• Styling System (from style.rs)
b) External Interfaces:
• Physical Serial Port Connection
• QEMU Virtual Serial Connection
• Starship Integration
• File System (for binary uploads)
┌─ User Interface Layer ─────────────────────┐
• CLI Interface │
• ┬───────────────────────┘
• ↓
┌─ Core Logic Layer ──────────────────────────────────────┐
• ┌─────────────┐ ┌──────────────┐ ┌──────────┐ │
• Port │←→│ Serial │←→│ Style │ │
• Manager │ │ Handler │ │ System │ │
• ┘ └──────────────┘ └──────────┘ │
• ┬────────────────────────────┘
• ↓
┌─ Device Layer ─────────────────────────────────────────┐
• ┌────────────┐ ┌─────────────┐ │
• Physical │ │ QEMU │ │
• Serial │ │ Integration │ │
• ┘ └─────────────┘ │
• ┘
Key Interactions to Highlight
a) Command Flow:
• Debug Mode: CLI → Serial Handler → Device
• Upload Mode: CLI → Serial Handler → Device + File System
• Test Mode: CLI → QEMU Integration → Virtual Serial
b) Data Flow:
• Serial Input: Device → Serial Handler → STDOUT
• Binary Upload: File System → Serial Handler → Device
• QEMU Communication: QEMU Process ↔ Serial Handler
Additional Elements
• Command types (Debug, Upload, Test)
• Data flow directions
• Component responsibilities
• Integration points with Starship
• STDERR vs STDOUT handling