explaingit

nogamble/rvos

25CAudience · developerComplexity · 4/5Setup · hard

TLDR

A small teaching operating system kernel written in C that runs inside a RISC-V emulator, covering memory management, task scheduling, file system, system calls, and an interactive shell, built to help people learn OS internals hands-on.

Mindmap

mindmap
  root((rvos))
    What it does
      Runs in QEMU emulator
      Manages virtual memory
      Schedules tasks by priority
      Provides interactive shell
    Tech Stack
      C language
      RISC-V architecture
      QEMU emulator
      GDB debugger
    OS Subsystems
      Sv32 virtual memory
      Round-robin scheduler
      In-memory file system
      14 system calls
    Use Cases
      Study OS internals
      Learn RISC-V
      Debug with GDB
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study how an OS kernel manages memory and schedules tasks by reading and modifying the C source for each subsystem.

USE CASE 2

Run and debug a RISC-V OS in QEMU to understand how system calls bridge user programs and the kernel.

USE CASE 3

Build new shell commands or file system features on top of the existing kernel as a hands-on systems programming exercise.

Tech stack

CRISC-VQEMUGDBMake

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a RISC-V cross-compiler toolchain and QEMU for 32-bit RISC-V, not standard installs on most developer machines.

The explanation does not mention a license for this project.

In plain English

RVOS is a small operating system kernel written in C, designed to run inside QEMU, a program that pretends to be a RISC-V computer so you can test low-level code without physical hardware. The project started as a teaching kernel and grew into a compact lab project covering most of the core pieces an operating system needs: memory management, task scheduling, system calls, a file system, and a basic interactive shell. The kernel supports multiple "harts" (hardware threads, the RISC-V word for CPU cores), meaning it can run tasks in parallel across more than one simulated core. It uses a virtual memory model called Sv32, which gives each running task its own separate address space so tasks cannot accidentally read or write each other's memory. A weighted priority round-robin scheduler decides which task runs next, taking into account each task's priority level and a budget counter. The file system lives entirely in memory and supports common operations: creating, reading, writing, listing, and deleting files. Fourteen system calls are available to user-space tasks, covering console output, file operations, process information, and memory statistics. The interactive shell exposes these through simple commands like ps (show running tasks), free (show memory usage), ls (list files), cat, touch, and write. To use the project, you need a RISC-V cross-compiler toolchain and the QEMU emulator for RISC-V 32-bit targets. From the source directory, two make commands build and launch the kernel. A debug target starts QEMU paused so you can attach GDB for step-by-step inspection. The source layout is clear: each major subsystem (scheduler, memory, traps, UART, file system, shell) lives in its own C file. The README includes a full list of source files with a one-line description of each. This is primarily a learning project for people studying operating system internals and the RISC-V architecture.

Copy-paste prompts

Prompt 1
I'm studying the rvos kernel. Explain how the Sv32 virtual memory system gives each task its own address space so tasks cannot read each other's memory.
Prompt 2
Show me how to add a new system call to the rvos kernel in C, following the existing pattern for the 14 system calls already implemented.
Prompt 3
I'm debugging rvos with GDB attached to QEMU. The priority round-robin scheduler isn't picking the right task. Walk me through inspecting the scheduler state and budget counters.
Prompt 4
Help me add a new shell command to rvos that displays per-hart CPU usage, following the style of the existing ps and free commands.
Open on GitHub → Explain another repo

← nogamble on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.