验证与调试
平台层改动会影响启动、内存、IRQ、timer、console 和设备发现。验证应从最小编译检查开始,再逐步到 QEMU 或板卡 bring-up。
最小检查
平台模板或平台选择变更后,先运行:
cargo fmt --check
cargo metadata --locked --no-deps --format-version 1
cargo test -p axbuild --lib
cargo xtask clippy --package axbuild
外部平台应在自己的 workspace 和本地 ax-hal 增加对应 package / optional dependency / feature,然后再运行:
cargo check -p axplat-myplat --features irq,smp
AX_PLATFORM_CRATE=axplat_myplat cargo check -p ax-hal --features axplat-myplat,irq,smp
如果修改了具体平台 crate,还应对该 crate 运行 targeted clippy:
cargo xtask clippy --package axplat-myplat
cargo xtask clippy --package ax-hal
QEMU 验证
动态平台路径优先使用 cargo xtask:
cargo xtask arceos test qemu --arch aarch64
cargo xtask starry test qemu --arch riscv64
cargo xtask axvisor test qemu --arch x86_64 --test-group normal
外部平台只有在补齐启动入口、链接脚本、console、timer、内存和 IRQ 后,才应宣称可启动 QEMU。