mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 10:40:00 +00:00
2.3 KiB
2.3 KiB
CLeonOS Stage22
Stage Goal
- Add shell-side observability and diagnostics while keeping ELF path unchanged.
- Introduce in-kernel log journal so shell can inspect boot/runtime logs.
- Extend
/tempworkflow with copy/move utilities and command execution metrics.
What Was Implemented
- Kernel log journal (ring buffer):
- Added log journal storage in
clks/kernel/log.c. - Added APIs:
clks_log_journal_count()clks_log_journal_read(index_from_oldest, out_line, out_size)
- Added log journal storage in
- Shell command expansion:
dmesg [n](reads recent journal lines)shstat(shell command counters)memstat(PMM + heap snapshot)fsstat(VFS node and directory child counts)taskstat(scheduler/task runtime snapshot)cp <src> <dst>mv <src> <dst>
- Command accounting:
- Tracks total/ok/fail/unknown command counts.
- Safety policy:
cpdestination must be under/temp.mvsource and destination must both be under/temp.
- Stage banner updated to:
CLEONOS Stage22 START
Acceptance Criteria
- Boot completes and shell remains interactive.
helplists new Stage22 commands.dmesgprints recent log lines from kernel journal.shstatshows changing counters after running commands.memstat/fsstat/taskstatprint non-empty statistics./tempcopy/move flow works:cpsucceeds to/tempdestination.mvsucceeds when both paths are in/temp.- invalid policy paths are rejected with message.
Suggested Validation Script (Manual)
helpdmesg 20memstatfsstattaskstatcd /tempmkdir s22write /temp/s22/a.txt alphacp /temp/s22/a.txt /temp/s22/b.txtcat /temp/s22/b.txtmv /temp/s22/b.txt /temp/s22/c.txtls /temp/s22shstat
Build Targets
make setupmake userappsmake isomake runmake debug
QEMU Command
qemu-system-x86_64 -M q35 -m 1024M -cdrom build/CLeonOS-x86_64.iso -serial stdio
Common Bugs and Debugging
dmesgoutput empty:- Ensure command is run after boot logs are produced.
cpfails unexpectedly:- Check destination path is under
/temp. - Verify source is a regular file.
- Check destination path is under
mvfails after copy:- Stage22 requires source path under
/tempfor removal.
- Stage22 requires source path under
taskstatmissing details:- Confirm scheduler task count is non-zero and system reached idle loop.