mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 10:40:00 +00:00
1.5 KiB
1.5 KiB
CLeonOS Stage23
Stage Goal
- Add a kernel shell command
rusttest. - Implement
rusttestlogic in Rust (no_std) instead of C. - Link Rust object into the kernel ELF so command runs in kernel mode.
What Was Implemented
- Kernel Rust source added:
clks/rust/src/lib.rs- exports
clks_rusttest_hello() - output text:
Hello world!
- Kernel build integration (CMake):
- build
libclks_kernel_rust.a - link kernel ELF with
${KERNEL_RUST_LIB}
- build
- Shell integration:
- add command
rusttest rusttestcalls Rust symbolclks_rusttest_hello()
- add command
- Compatibility symbols for Rust link:
- add
clks/lib/libc_compat.cformemcpy/memset/memmove/memcmp/bcmp
- add
- Stage banner updated:
CLEONOS Stage23 START
Acceptance Criteria
- Kernel boots and prints
CLEONOS Stage23 START. helpcontainsrusttest.- Running
rusttestprints exactly:Hello world!
- No regression to existing shell commands.
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
- Rust link undefined symbols (
memcpy/memset/...):- Ensure
clks/lib/libc_compat.cis included in kernel source set.
- Ensure
- Panic-related undefined symbol:
- Ensure Rust file keeps
#[panic_handler]andrust_eh_personalitystub.
- Ensure Rust file keeps
rusttestcommand not found:- Confirm
helpoutput includesrusttestand shell dispatch branch exists.
- Confirm