Repository navigation
6 Shell, Terminal, and Display
Relevant source files
This page provides a high-level overview of the user-facing layer in CadenzaOS, encompassing command parsing and execution, terminal line editing and input device routing, and visual display subsystems across text mode, framebuffers, consoles, and serial ports.
The user interaction pipeline bridges raw hardware scancodes to interactive terminal prompts, feeds parsed tokens into a statically registered shell command registry src/kernel/shell.zig117-123 with policy-based safety checks, and renders output through multiplexed display backends.
Since this is a parent page, high-level summaries are provided below. For full implementation details, refer to the child pages:
- Shell Command Pipeline: Shell Command Pipeline — execution, parsing, command registries, policy checks, entropy/velocity, and filesystem commands.
-
Terminal, Input Devices and Prompts: Terminal, Input Devices and Prompts —
terminal.zigline editing, ghost-text predictors, keyboard scancodes, mouse events, and prompt dialogs. - Display: VGA, Framebuffer, Console and Serial: Display: VGA, Framebuffer, Console and Serial — VGA text mode, VESA framebuffer rendering, font glyphs, console multiplexing, and COM1 serial mirroring.
Sources: src/kernel/shell.zig, src/kernel/terminal.zig
The shell layer (src/kernel/shell.zig) implements a line-oriented command processor operating without dynamic memory allocation outside of bounded fixed-buffer allocators src/kernel/shell.zig109-110 Commands are statically registered in the commands table src/kernel/shell.zig125-154 mapping names and argument requirements to handler functions.
The pipeline processes input tokens, evaluates safety policies via the Conductor/Composer subsystems, and dispatches builtin commands or spawns binaries via the filesystem and binary loader.
For full technical details, see Shell Command Pipeline.
Sources: src/kernel/shell.zig
The terminal layer (src/kernel/terminal.zig) manages interactive line editing, command history buffers src/kernel/terminal.zig71-77 cursor positioning, and dynamic display mode switching between single-row Canvas mode and wrapped Stream modesrc/kernel/terminal.zig12-25 It integrates with keyboard input handlers, mouse event streams, and UI confirmation prompts.
It also hooks into behavioral prediction engines via setPredictorsrc/kernel/terminal.zig104-106 to supply ghost-text autocomplete suggestions on the active command line.
For full technical details, see Terminal, Input Devices and Prompts.
Sources: src/kernel/terminal.zig
CadenzaOS abstracts output across multiple rendering backends. The display architecture supports legacy VGA text mode (vga.zig), VESA graphical framebuffers (framebuffer.zig) backed by bitmap font rendering (font.zig), console multiplexing (console.zig), and COM1 serial port mirroring (serial.zig) for debugging and automated smoke testing. Formatting helpers (convert.zig) provide lightweight number-to-string conversions.
For full technical details, see Display: VGA, Framebuffer, Console and Serial.
Sources: src/kernel/shell.zig, src/kernel/terminal.zig
The user-facing layer coordinates input capture, terminal editing, shell command execution, and display rendering in a continuous interactive loop.

Sources: src/kernel/shell.zig, src/kernel/terminal.zig
The following diagram bridges natural language subsystem concepts to their concrete code entities within the CadenzaOS codebase:

Sources: src/kernel/shell.zig, src/kernel/terminal.zig
- Overview
- Getting Started and Build System
- Kernel Configuration and Global State
- Project Governance and Contributing
- Boot and Early Kernel Initialization
- Bootloader Stages and Linking
- kmain Boot Sequence
- Splash Screen and Branding
- Interrupts, Scheduling, and Syscalls
- IDT, PIC, APIC and IRQ Stubs
- Scheduler and Task Lifecycle
- System Call Interface
- Demonstration Tasks
- CodaFS Filesystem and Storage
- On-Disk Format and Operations
- Space Manager and Block Devices
- Binary Format and Program Loading
- Shell, Terminal, and Display
- Shell Command Pipeline
- Terminal, Input Devices and Prompts
- Display: VGA, Framebuffer, Console and Serial