This document helps you run your oscomp work locally. Please execute the following commands.
git clone https://github.com/oscomp/autotest-for-oskernel.gitsudo docker pull docker.educg.net/cg/os-contest:20250714This docker image provides environment for OS build toolchain and qemu-systems.
The auxiliary test data is used for judging your work. You can choose any directory you like, which we call $data in the following script.
# Create the directory.
mkdir $data
# Copy the judge scripts there.
cd autotest-for-oskernel
cp -rf kernel/judge/* $data
# Download the SD card images.
cd $data
wget https://github.com/oscomp/testsuits-for-oskernel/releases/download/pre-20250615/sdcard-la.img.xz
wget https://github.com/oscomp/testsuits-for-oskernel/releases/download/pre-20250615/sdcard-rv.img.xz
# It is possible to omit the `gzip` in order to save time,
# provided you modify the testing scripts locally.
unxz sdcard-la.img.xz
gzip sdcard-la.img
unxz sdcard-rv.img.xz
gzip sdcard-rv.imgNote this "kernel" is not the operating system kernel.
cd autotest-for-oskernel/kernel
zip ../kernel.zip -r *We assume you already have your work locally. We refer to its folder as $os in the following script.
Navigate to the parent folder of this repository, and run:
sudo docker run --rm \
-v $os:/coursegrader/submit \
-v $data:/coursegrader/testdata \
-v autotest-for-oskernel:/cg \
-v $data:/mnt/cghook/ \
docker.educg.net/cg/os-contest:20250714 python3 /cg/kernel.zipThe docker will build your OS, evaluate it, and output the result on the console.
To stop it, use docker stop, rather than force-exiting the python script. The latter method will leave the files in a locked state, and unlocking might require a reboot.