mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 18:44:01 +00:00
1.8 KiB
1.8 KiB
Stage 28 - ANSI TTY + Default User Shell Entry + User Syscall Trace
Goal
- Add ANSI color control support to TTY.
- Introduce ANSI-colored experience in user shell.
- Default to entering user shell after kernel is ready.
- Add serial log tracing for syscalls while user programs are running.
Implementation
- TTY:
- Added ANSI CSI/SGR parsing (
ESC[...m) for standard foreground/background colors. - Added support for reset/default color behavior (
0,39,49) and bright color range (90..97,100..107). - Added per-cell color buffers so scrolling/redraw keeps color attributes.
- Added ANSI CSI/SGR parsing (
- User shell:
- Colored prompt and startup text now use ANSI sequences.
- Added
ansi/colorcommand to preview palette. clearnow uses ANSI clear/home sequence.
- Boot behavior:
- Enabled user shell auto-exec by default in userland manager.
- Boot log now reports default user-shell mode when auto-exec is enabled.
- Syscall tracing:
- Added bounded debug trace in
clks/kernel/syscall.cfor syscalls issued while a user-path program is active. - Trace emits begin/end markers and syscall IDs with budget guard to avoid log flooding.
- Added bounded debug trace in
Acceptance Criteria
- User shell prompt/output can display ANSI colors correctly on TTY.
- Boot enters default user-shell flow (auto launch enabled).
- Serial logs include syscall trace lines while user programs execute.
- Stage27 and Stage28 docs are present and indexed in
docs/README.md.
Build Targets
make userappsmake ramdiskmake isomake run
QEMU Command
make run
Debug Notes
- If ANSI text shows raw escape chars, verify
clks/kernel/tty.cANSI parser path is compiled. - If user shell does not auto launch, check
clks/kernel/userland.cauto-exec flags and retry tick flow. - If syscall trace is missing, confirm
clks_exec_current_path_is_user()is true during the target run.