I tried to write a rust OS kernel that mimics the implementation of xv6. Here is the link to it:
To write the OS, I set the main.rs #![no_std] and set target in
[build] target = "riscv64imac-unknown-none-elf" [target.riscv64imac-unknown-none-elf] rustflags = ["-C", "link-arg=-Tlinker.ld"]
However, the setting also stop me from testing my code. The problem become worse as I write more and more code without test.
The test I created will complain errors like:
= note: the `riscv64imac-unknown-none-elf` target may not support the standard library = note: `std` is required by `test_42` because it does not declare `#![no_std]` = help: consider building the standard library from source with `cargo build -Zbuild-std`
Is there any way that I can test part of my code while build them with no_std?