FlitOS is a real-time operating system kernel for RISC-V machine. The kernel currently supports 32-bit device only. This project is part of UCDavis ECS251. This repo contains a simulator from UCDClassNitta/riscv-console.
The simulation environment and toolchain have been setup to run within a Docker container. The directions assume that you have git, Docker, X-11 support and a bash shell on your machine. If you are running on Windows and wish to use PowerShell follow the directions here.
The code is available on github. Assuming you have ssh setup for git start by cloning the repository with the following command:
git clone git@github.com:XiaoxingChen/flitos.git
Once the repository has been cloned, change directories into the riscv-console and run the console launch script with the command:
cd flitos
./rvconsole.sh
Once the container is launched you should see a prompt like:
root@fedcba9876543210:/code#
root@fedcba9876543210:/code# cd riscv-firmware
root@fedcba9876543210:/code/riscv-firmware# make
root@fedcba9876543210:/code# cd riscv-cart
root@fedcba9876543210:/code/riscv-cart# make
root@fedcba9876543210:/code/runsim.sh
See the original document of riscv-console to find how to load the firmware and cartridge.
Here is the effect of our sample game.
We use another docker image with QEMU inside to do simulation.
docker run --rm -it -v $(pwd):/code -p 5000:5000 --privileged --name riscv-toolchain pwn2de4d/riscv-toolchain
qemu-system-riscv32 -nographic -machine virt -device loader,file=bin/os_test_qemu -bios none
FlitOS supports thread create
, yield
, join
and sleep
.
Mutex and condition variables are provided as synchronization objects.
A thread safe queue called pipe
is provided for inter-thread communication.