๐ฅ๏ธ Terminal (executable) โ
The terminal executable provides a graphical terminal window exposed as a character device and uses it to host the command-line shell.
Role โ
- Bridges GUI events and text I/O semantics through a mounted
/devices/terminaldevice. - Launches
/binaries/command_line_shellwith terminal-backed stdin/stdout/stderr.
Startup and lifecycle โ
- Creates
TerminalUI object (window, label display, text input). - Mounts terminal object as
/devices/terminalcharacter device. - Opens
Standardstreams on that path. - Executes command-line shell executable.
- Runs event loop until terminal window close/delete event.
Runtime integration points โ
virtual_file_system::mount_staticfor runtime device registration.xila::executable::executeto start command-line shell child process.graphicsand LVGL for window/input rendering.shared::utf8_chunksfor buffered output write handling.
Data and control flow / VFS touchpoints โ
- Write path: shell output ->
/devices/terminal->DirectBaseOperations::write-> UI display append. - Read path: UI enter key -> validated input queue ->
/devices/terminalread by shell. - Control flow: parent terminal loop keeps processing events while child shell uses same device streams.
Concurrency and event-loop model โ
- Terminal executable runs a periodic loop with
sleep(20 ms)while pollinghandle_events. - Device read/write paths use lock-protected terminal inner state (
RwLock<CriticalSectionRawMutex, Inner>).
Failure semantics โ
- Device mount/open/execute failures return executable error and are logged + printed.
- Resource contention on terminal locks maps to
RessourceBusy/file_system::Error::RessourceBusy.
Contract vs implementation โ
- Contract: terminal executable exposes a character-device-backed text console and runs shell inside it.
- Current implementation: LVGL window + textarea, mounted static device node
/devices/terminal, and shell child execution via executable runtime.
Operational limitations โ
- Input is newline-validated; no advanced terminal emulation (PTY, ANSI parser state machine) is implemented here.
- UI/event loop cadence is fixed and may affect responsiveness under heavy output.