本项目是2025年系统能力培养赛操作系统赛题目,包括basic、busybox、lua、libctest、iozone、unixbench、iperf、libcbench、lmbench、netperf、cyclictest和LTP共12组测试题目。
注: 对上述测试题目,为帮助同学理解,我们考虑给出题目描述、编译方法、样例输出、评分依据四个部分的测例题目说明信息,相关信息放在oskernel-testsuits-cooperation仓库。我们希望能够有志愿者同学帮助我们进一步完成剩余的测例题目说明信息。
请愿意做志愿者的同学参考已经给出basic、busybox、lua等已完成的测例题目说明信息,查看信息提交指导帮助来更新测例题目说明信息。
志愿者工作是本次比赛评选优秀组织奖和技术贡献奖的重要参考依据。
- 你的电脑上需要安装docker。
- 运行
make docker
进入docker环境。 - 运行
make
构建评测样例和SD卡镜像文件。
当完成操作系统开发后,可在大赛平台进行提交评测。
本次大赛的初赛阶段评测使用QEMU虚拟环境,提交的项目根目录中必须包含一个Makefile文件,评测时会自动在您的项目中执行make all命令,您应该在Makefile中的all目标对操作系统进行编译,并生成ELF格式的kernel-rv和kernel-la两个文件,作为您操作系统的内核。除此之外,如果您的系统需要一些辅助文件(如rootfs等),在编译时还可以生成disk.img镜像文件,会在运行qemu时一同挂载,disk.img是可选的。
同时QEMU启动时还会使用-drive file参数挂载磁盘镜像,磁盘镜像为EXT4文件系统,没有分区表。在磁盘镜像的根目录里包含若干个预先编译好的ELF可执行文件和测试脚本(以下简称测试点),测试脚本命名格式为xxxxx_testcode.sh。您的操作系统在启动后需要主动扫描磁盘,并依次运行其中每一个测试点,将其运行结果输出到屏幕上,评测系统会根据您操作系统的屏幕输出内容进行评分。
您可以根据操作系统的完成度自由选择跳过其中若干个测试点,未被运行的测试点将不计分。若您没有选择通过脚本运行测试点,那么也需要按照脚本的格式输出测试点前后的提示信息,如“#### OS COMP TEST GROUP START basic ####”等,否则会影响评分。
测试点的执行顺序与评分无关,多个测试点只能串行运行,不可同时运行多个测试点。具体测试点的数量、内容以及编译方式将在赛题公布时同步发布。
当您的操作系统执行完所有测试点后,应该主动调用关机命令,评测机会在检测到QEMU进程退出或达到最长限制时间后进行打分。
运行Riscv QEMU的完整命令如下所示,其中os_file为您生产的kernel-rv文件;fs为包含测试点的磁盘镜像;disk.img为您仓库编译时生成的磁盘镜像文件,若没有生成此文件则运行时命令不包含disk.img。
qemu-system-riscv64 -machine virt -kernel {os_file} -m {mem} -nographic -smp {smp} -bios default -drive file={fs},if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 -no-reboot -device virtio-net-device,netdev=net -netdev user,id=net \
-rtc base=utc \
-drive file=disk.img,if=none,format=raw,id=x1 -device virtio-blk-device,drive=x1,bus=virtio-mmio-bus.1
运行Loong Arch QEMU的完整命令如下所示,各部分含义与Riscv相同。
qemu-system-loongarch64 -kernel {os_file} -m {mem} -nographic -smp {smp} -drive file={fs},if=none,format=raw,id=x0 \
-device virtio-blk-pci,drive=x0,bus=virtio-mmio-bus.0 -no-reboot -device virtio-net-pci,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5555-:5555,hostfwd=udp::5555-:5555 \
-rtc base=utc \
-drive file=disk-la.img,if=none,format=raw,id=x1 -device virtio-blk-pci,drive=x1,bus=virtio-mmio-bus.1
比赛评测时的编译和运行工作均在Docker容器中运行,可在此链接中查看Dockerfile。其中安装的QEMU和工具链版本如下所示:
root@f8eccecd6f32:/# qemu-system-riscv64 --version
QEMU emulator version 9.2.1
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
root@f8eccecd6f32:/# qemu-system-loongarch64 --version
QEMU emulator version 9.2.1
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
root@3343cebd6f66:/# riscv64-buildroot-linux-musl-gcc --version
riscv64-buildroot-linux-musl-gcc.br_real (Buildroot 2020.08-14-ge5a2a90) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# riscv64-linux-gcc --version
riscv64-linux-gcc.br_real (Buildroot 2020.08-14-ge5a2a90) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# riscv64-linux-gnu-gcc --version
riscv64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# riscv64-linux-musl-gcc --version
riscv64-linux-musl-gcc (GCC) 11.2.1 20211120
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# loongarch64-linux-gnu-gcc --version
loongarch64-linux-gnu-gcc (GCC) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# loongarch64-linux-musl-gcc --version
loongarch64-linux-musl-gcc (GCC) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@3343cebd6f66:/# cargo version
warning: `/root/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
cargo 1.86.0-nightly (088d49608 2025-01-10)
root@3343cebd6f66:/# rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-2024-02-03-x86_64-unknown-linux-gnu
nightly-2025-01-18-x86_64-unknown-linux-gnu (default)
root@3343cebd6f66:/# rustup target list --installed
loongarch64-unknown-linux-gnu
loongarch64-unknown-none
riscv64gc-unknown-none-elf
riscv64imac-unknown-none-elf
x86_64-unknown-linux-gnu