Skip to content

6 Shell, Terminal, and Display

Glen edited this page Nov 14, 2026 · 2 revisions

Shell, Title, and Display

Relevant source files

1. Overview and Scope

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.zig line 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


2. Shell Command Pipeline

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


3. Terminal, Input Devices and Prompts

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


4. Display: VGA, Framebuffer, Console and Serial

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


5. Subsystem Integration and Data Flow

The user-facing layer coordinates input capture, terminal editing, shell command execution, and display rendering in a continuous interactive loop.

User-Facing Subsystem Data Flow

diagram

Sources: src/kernel/shell.zig, src/kernel/terminal.zig

Subsystem Concept to Code Entity Mapping

The following diagram bridges natural language subsystem concepts to their concrete code entities within the CadenzaOS codebase:

diagram

Sources: src/kernel/shell.zig, src/kernel/terminal.zig

Clone this wiki locally