1. Double echo: TTY keyboard callback was echoing characters via
tty_output_char() AND kconsole was echoing via console_write().
Fix: keyboard_set_callback(0) detaches TTY on kconsole entry.
2. Backspace printing garbage: VGA vga_put_char() only handled \n,
treating \b as a visible glyph. Fix: full control char support
in vga_put_char — \b moves cursor back, \r resets column, \t
advances to next tab stop, non-printable chars filtered.
3. Enter printing garbage: same root cause as #2 — \r was not
handled by VGA. Now handled properly.
4. Cursor not tracking: VGA had no hardware cursor update. Added
hal_video_set_cursor() HAL function using CRTC registers
0x3D4/0x3D5 on x86, called after every character output.
5. Clear screen broken: was using ANSI escape \033[2J which VGA
can't parse. Added vga_clear() function, kconsole calls it
directly.
6. dmesg contamination: kconsole prompts and help text used
kprintf() which appends to klog ring buffer. Introduced
kc_puts() wrapper over console_write() for interactive output
that should NOT appear in dmesg.
7. Scroll (Shift+PageUp/Down): deferred — requires scrollback
buffer (significant feature). Documented as known limitation.
8. Serial input not working (-serial stdio): kgetc() only read
from PS/2 keyboard via keyboard_read_blocking(). Added
hal_uart_try_getc() to HAL (poll UART LSR data-ready bit),
rewrote kgetc() to poll both keyboard and UART in a loop.
9. ring3 command: removed from kconsole (useless without initrd
in emergency mode). Replaced with proper ls command using
readdir to list directory contents.
HAL changes (all 4 architectures):
- hal_video_set_cursor(row, col) — x86 uses VGA CRTC I/O ports
- hal_uart_try_getc() — non-blocking serial RX polling