Build a minimal multi-tasking OS kernel for RISC-V from scratch
Mini-riscv-os was inspired by jserv's mini-arm-os project.
However, ccckmit rewrite the project for RISC-V, and run on Win10 instead of Linux.
After download and extract the FreedomStudio for windows. You have to set the system PATH to the folder of riscv64-unknown-elf-gcc/bin
and riscv-qemu/bin
. For example, I set PATH to the following folders.
D:\install\FreedomStudio-2020-06-3-win64\SiFive\riscv64-unknown-elf-gcc-8.3.0-2020.04.1\bin
D:\install\FreedomStudio-2020-06-3-win64\SiFive\riscv-qemu-4.2.0-2020.04.0\bin
And you should start your git-bash to build the project. (It works for me in vscode bash terminal)
- 01-HelloOs
- Enable UART to print trivial greetings
- 02-ContextSwitch
- Basic switch from OS to user task
- 03-MultiTasking
- Two user tasks are interactively switching
- 04-TimerInterrupt
- Enable SysTick for future scheduler implementation
- 05-Preemptive
- Basic preemptive scheduling
- 06-Spinlock
- Lock implementation to protect critical sections
- 07-ExterInterrupt
- Learning PLIC & external interruption
- 08-BlockDeviceDriver
- Learning VirtIO Protocol & Device driver implementation
- 09-MemoryAllocator
- Understanding how to write the linker script & how the heap works
- 10-SystemCall
- Invoking a mini ecall from machine mode.
- Changes the current working directory to the specified one and then
make
make qemu
mini-riscv-os
is freely redistributable under the two-clause BSD License.
Use of this source code is governed by a BSD-style license that can be found
in the LICENSE
file.