Whuse is a Rust rewrite of the original RuOK kernel project, rebuilt as a self-contained workspace rooted in this repository.
The project now tracks both riscv64 and loongarch64 with OSCOMP-oriented
build and run entrypoints.
All primary validation in this repository is aligned to:
- Contest image:
docker.educg.net/cg/os-contest:20260104 - Testsuits branch:
pre-2025 - Contest runner mode:
WHUSE_QEMU_MODE=contest - Real flow mode:
WHUSE_OSCOMP_COMPAT=0
Current measured QEMU in the contest image is 10.0.2 for both
qemu-system-riscv64 and qemu-system-loongarch64.
To avoid contest-time rustup installs, this repository pins Rust to the contest
image's preinstalled toolchain nightly-2025-01-18 with profile = "minimal"
in rust-toolchain.toml instead of using a floating channel or a newer
unavailable version.
Contest builds must not depend on Cargo alias loading from .cargo/config.toml,
because hidden directories are filtered during submission. The repository keeps
the real config in root-level cargo_config.toml, vendors registry crates under
vendor/, and make recreates .cargo/config.toml before any Cargo command.
Build scripts still call xtask explicitly via:
cargo run --manifest-path tools/xtask/Cargo.toml -- <command>make targets already use this explicit form internally.
crates/hal-api: shared HAL traits and global registrationcrates/hal-riscv64-virt: RISC-Vvirtplatform implementation skeletoncrates/kernel-core: boot flow, logging, panic path, and kernel wiringcrates/mm: frame allocator and user address-space modelcrates/task: cooperative task scheduler modelcrates/proc: process table and file descriptor statecrates/vfs: in-memory root filesystem, devfs, procfs-lite, and mountscrates/syscall: RISC-V ABI syscall dispatcher with Phase 1 handlerscrates/user-init: built-in init seed data and boot-time filesystem setupplatform/riscv64-virt: platform binary and RISC-V entry assemblytools/xtask: build/check/qemu helper entrypoints
The competition runner executes make all and expects:
kernel-rvkernel-la
Optional extra disk images:
disk.img(RISC-V extra disk)disk-la.img(LoongArch extra disk)
make all
make check
make test
make oscomp-images
make contest-selfcheckxtask supports two QEMU modes:
contest(default foroscomp-*): run QEMU inside the contest docker image.host(default forqemu-*): run QEMU directly on host tools.
Competition scoring should use contest mode only.
Environment controls:
WHUSE_QEMU_MODE=contest|hostWHUSE_QEMU_RISCV_MEM=<size>RISC-V QEMU memory (default1G)WHUSE_QEMU_LOONGARCH_MEM=<size>LoongArch QEMU memory (default1G)WHUSE_DISK_IMAGE=<path>for primary diskWHUSE_EXTRA_DISK_IMAGE=<path>for second diskWHUSE_OSCOMP_TESTSUITS_DIR=<path>testsuits sourceWHUSE_OSCOMP_DOCKER_IMAGE=<image>contest image (defaultdocker.educg.net/cg/os-contest:20260104)WHUSE_OSCOMP_COMPAT=0for real execution flowWHUSE_LTP_PROFILE=score|full(scoreby default for high-yield LTP convergence)WHUSE_LTP_WHITELIST=/musl/ltp_score_whitelist.txtWHUSE_LTP_BLACKLIST=/musl/ltp_score_blacklist.txt
make oscomp-riscv-contest
make oscomp-loongarch-contest
make contest-selfcheckHost quick mode:
make oscomp-riscv-host
make oscomp-loongarch-hostLTP-focused run:
make stage2-riscv-ltpBefore merging feature branches into master, compare each architecture against
its own baseline:
step-begin/step-endcoverage must not regress.- Any step previously ending with
:0must not regress to non-zero. - Runtime regression tolerance is within
<=3%jitter.
masteris the only development branch.- GitLab
mainis treated as a publish mirror for competition submissions. - Do not develop directly on
main; syncmaster -> mainonly after validation.
make allalways produceskernel-rvandkernel-laat repository root.- Contest LoongArch boot path uses
-kernel kernel-la(not bootrom/loader). - Test execution is scan-driven: the kernel discovers
*_testcode.shfrom disk, runs them serially, emitsstep-begin/end/timeout/skip, and prints groupSTART/ENDmarkers for scoring.
| Item | Previous | Contest-aligned now |
|---|---|---|
| LoongArch contest boot | bootrom + loader | direct -kernel kernel-la |
| Testsuite execution | fixed built-in order | disk scan *_testcode.sh (serial) |
| Default oscomp mode | implicit/mixed | explicit contest |
| Baseline self-check | manual | make contest-selfcheck |