Shell System

User Interface and Command Processing

Overview

The Shell System provides Chapp-E's user interface, handling command input, processing, and output. It integrates with the FSM, GCS, and other systems to provide a complete interactive experience.

Memory Layout

The Shell System uses fixed memory addresses (≥ 0x200000):

Address Name Size Description
0x203000 SHELL_BUFFER_ADDR 256 bytes Input buffer for command storage
0x203100 SHELL_BUFFER_POS_ADDR 1 byte Current buffer position (input length)

API Reference

shell_init

Initializes the shell system.

; Initialize shell
call shell_init

; Sets up:
; - Clears screen
; - Clears input buffer
; - Resets VGA cursor
; - Prepares for user input

shell_main_loop

Main shell loop (runs forever, handles user input).

; Start shell
call shell_main_loop

; Continuously:
; - Displays prompt
; - Reads keyboard input
; - Processes commands
; - Executes commands
; - Integrates with brain_tick heartbeat

shell_print_prompt

Prints the shell prompt ("Chapp-E:>").

; Print prompt
call shell_print_prompt

Integration

System Integration

The Shell integrates with multiple systems:

  • FSM: Manages input states (READY, TYPING, PROCESSING)
  • GCS: Filters input characters
  • I/O System: Handles keyboard input and screen output
  • Formatting System: Provides colored output and formatting
  • Brain Controller: Routes messages to subsystems
  • brain_tick: Heartbeat system runs when shell is idle

Command Processing Flow

User types → I/O System → GCS (filter) → FSM (state) → Shell (process) → Execute

File Locations

  • 64-bit Implementation: system/shell/shell_64.asm
  • 16-bit Boot Version: system/shell/chappe.asm
  • Formatting: system/shell/formatting_64.asm

Related Documentation