How rachitkumar205/visionhubos works
Main components
• Hardware Interface Layer:
• The actual ESP32 board, connected to an SSD1306 display and a set of input buttons.
• Drivers Layer:
• Driver (src/drivers/display.rs) – interfaces with the SSD1306.
• Input Driver (src/drivers/input.rs) – handles button input.
• The drivers are centralized within the drivers module (src/drivers/mod.rs).
• System Kernel Layer:
• Event Handling (src/system/events.rs) – manages system events.
• Process Scheduler (src/system/scheduler.rs) – basic scheduler to manage tasks.
• System module overall (src/system/mod.rs) forms the kernel’s backbone.
• User Interface (UI) Layer:
• UI Framework (src/ui/framework.rs) – provides abstractions for creating screens and animations.
• Animations (src/ui/animations.rs) and multiple UI Screens (src/ui/screens/home.rs, loading.rs, menu.rs) – create the interactive component.
• The UI module initialization is available via src/ui/mod.rs.
• Build & Configuration:
• Cargo configuration files (Cargo.toml, .cargo/config.toml) and build script (build.rs) denote build system details.
• rust-toolchain.toml shows the compiler specifics.
• sdkconfig.defaults may capture hardware-specific configurations.
Relationships and interactions
• The hardware layer communicates with the drivers layer. The display and input drivers directly interact with the physical hardware.
• Drivers feed data into the system kernel, where events are generated and processed. The process scheduler coordinates when and how different routines get executed.
• The UI layer listens to the events from the system and uses the scheduler’s updates to render new screens or animations.
• Internal dependencies: The UI framework relies on the underlying system events to update its state; similarly, the system components may trigger driver functions or changes as needed.
Architectural patterns and design principles
• Separation of Concerns: Each module (drivers, system, UI) is isolated such that changes in input/output handling (drivers) do not heavily impact the scheduler or UI rendering.
• Modular and Extensible Design: Adding or modifying drivers is straightforward as indicated by the README. This is facilitated by clear modular boundaries observed from the directory structure.
• Embedded OS Design: With its basic process scheduler and event handling, the code structure reflects typical small-scale operating system kernels used in embedded systems.
Technology and framework details
• Rust is the core language and Cargo is used for package/build management.
• Hardware-specific libraries or binding functions might be inferred under the drivers.
• The OS has a UI framework that may define its own abstractions for creating screens and animations.
Specific elements
• For each main module (Drivers, System, UI), include detailed labels specifying the responsible files (e.g., label “Display Driver – src/drivers/display.rs”).
• You may also include a side note highlighting that build and configuration files (Cargo.toml, build.rs, rust-toolchain.toml) support the codebase and provide necessary build-time configurations, even though they are not part of the runtime architecture.