Skip to content

week15.md

feliciachou edited this page Jun 16, 2022 · 6 revisions

mini riscv os

Build & Run on Windows 10

git-bash FreedomStudio

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)

Build a minimal multi-tasking OS kernel for RISC-V from scratch:

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.

Building and Verification

Changes the current working directory to the specified one and then

make
make qemu

Licensing

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.

References : https://www.cakeresume.com/portfolios/mini-riscv-os?locale=en https://bytemeta.vip/index.php/repo/cccriscv/mini-riscv-os https://github.com/cccriscv/mini-riscv-os

Clone this wiki locally