]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: kconsole overhaul -- bugs fixed + readline + scrollback + extended keyboard
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 07:22:15 +0000 (04:22 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 07:22:15 +0000 (04:22 -0300)
commita2e7d0a209635fa837119f52f267996ea0998468
tree703c83db796015e7e532644ff1de3dde302e6b33
parenteb38508f3c07611bc65397fbeb2925a0ba46b093
feat: kconsole overhaul -- bugs fixed + readline + scrollback + extended keyboard

Bug fixes:
1. dmesg pollution from mem/ls/cat: added klog_set_suppress() flag
   in console.c. kconsole wraps command execution with suppression
   so interactive output doesn't contaminate the kernel log buffer.

2. UTF-8 em dash rendering as garbage on VGA: replaced all UTF-8
   em dashes in output strings (main.c, init.c) with ASCII '--'.
   VGA text mode only supports CP437, not UTF-8.

3. PANIC message appearing in dmesg: changed from kprintf() to
   console_write() so the emergency banner goes to screen/serial
   but NOT to the kernel log ring buffer.

Features:
1. VGA scrollback buffer (200 lines): lines that scroll off the
   top of the screen are saved in a circular buffer. Shift+PgUp
   scrolls back half-page, Shift+PgDn scrolls forward. Any new
   output auto-returns to live view (like Linux).

2. Command history (16 entries): Up/Down arrow keys navigate
   through previous commands. Duplicate suppression. Current
   line is saved/restored when navigating.

3. Full line editing: Left/Right arrows move cursor, Home/End
   jump to start/end, Delete key, insert-at-cursor mode.
   Emacs keybindings: Ctrl-A (home), Ctrl-E (end), Ctrl-U
   (kill line), Ctrl-K (kill to end).

4. Extended keyboard driver: HAL x86 keyboard now tracks shift
   state, handles 0xE0 extended scancodes, emits VT100 escape
   sequences for arrow keys/Home/End/PgUp/PgDn/Delete. Shift
   scancode map added for uppercase letters and symbols.
   Shift+PgUp/PgDn calls vga_scroll_back/fwd directly.

5. Serial input works with readline: VT100 sequences from
   terminal emulators are parsed by the same escape state
   machine, so -serial stdio now supports full line editing.

Build: clean, cppcheck: clean, smoke: 19/19 pass
include/console.h
include/vga_console.h
src/drivers/vga_console.c
src/hal/x86/keyboard.c
src/kernel/console.c
src/kernel/init.c
src/kernel/kconsole.c
src/kernel/main.c