mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 18:44:01 +00:00
1.4 KiB
1.4 KiB
Stage 26 - Kernel Builtin ELF Loader + Root Hello ELF
Goal
- Move
elfloaderfrom standalone user ELF into a kernel builtin command. - Keep
hello.elfas root-level user ELF test payload.
Implementation
- Removed standalone user app
elfloader_main.c. - Added kernel shell builtin command:
elfloader [path].- Default target path:
/hello.elf. - Builtin flow:
fs_read -> elf64 inspect -> exec load -> entry call -> return status.
- Default target path:
- Updated CMake ramdisk placement rules:
hello.elf->/hello.elf
- Simplified user Rust library back to shared helper export (
cleonos_rust_guarded_len).
Acceptance Criteria
- No
elfloader.elfis generated or packed. - Ramdisk root contains
/hello.elf. - In kernel shell:
elfloaderloads and executes/hello.elf, then returns status.elfloader /path/to/app.elfworks for other absolute/relative paths.
Build Targets
make userappsmake ramdiskmake isomake run
QEMU Command
make run
Debug Notes
- If
elfloaderreportsfile missing, check ramdisk root packaging for/hello.elf. - If it reports
invalid elf64, verify user app link script and ELF output format. - If it reports
exec failed, inspectEXECchannel logs for load/entry/return status. hello.elfis supported in current synchronous exec mode./shell/shell.elfis intentionally blocked in synchronous mode (interactive loop requires process/task context switching stage).