RISC-V Meaty Skeleton with QEMU virt board

From OSDev.wiki
Revision as of 03:29, 10 September 2022 by osdev>Donaldsebleung
Jump to navigation Jump to search

This tutorial assumes you have completed RISC-V Bare Bones on the QEMU virt board, or alternatively, HiFive-1 Bare Bones. If not, you should complete them first for an overview of how to boot your own operating system on RISC-V. This tutorial is deliberately brief on concepts that have already been covered in the bare bones tutorials and their transitive prerequisites.

The bare bones tutorials provide minimal examples that are not structured to enable sustainable mid- to long-term development of the codebase. This tutorial attempts to rectify that by providing a well-structured project that should serve you well through your OSDev journey with the following features:

  • Hierarchical project structure with make build system for sustainable mid- to long-term development
  • Includes debug target for debugging with GDB (requires cross-debugger targeting riscv64-elf)
  • Basic console output through NS16550A UART
  • Convenience wrappers for powering off and rebooting the device
  • Working kprintf supporting base format specifiers (no floating point support; no sub-specifiers; no n specifier) to facilitate printf debugging
  • panic function for kernel panics

Bare Bones

Main article: Bare Bones