Minimal Time-Sharing OS Kernel on RISC-V in Zig

2025-09-14
Minimal Time-Sharing OS Kernel on RISC-V in Zig

This post details a minimal proof-of-concept time-sharing operating system kernel implemented on RISC-V using the Zig programming language. The project, a re-imagining of an undergraduate OS assignment, leverages modern tooling and the RISC-V architecture. It features statically defined threads, inter-thread system calls, and round-robin scheduling via timer interrupts. Basic thread virtualization is implemented, with each thread having a private stack and register context. The code is open-sourced, and the author provides a detailed walkthrough of the implementation and code explanations, making it a valuable resource for students of systems software and computer architecture.

Read more
Development

Building a Compact C Standard Library with Newlib on Bare Metal RISC-V

2025-04-26
Building a Compact C Standard Library with Newlib on Bare Metal RISC-V

This article demonstrates building a compact C standard library using Newlib on a bare-metal RISC-V system. The author implements basic UART functions, passing them to Newlib to enable printf functionality. The process covers Newlib's concept, cross-compilation toolchain setup, UART driver, system calls, and linker script creation. The article concludes with running the application in QEMU and analyzing the debug log. This is a practical tutorial on embedded systems development, showing how to utilize the C standard library in resource-constrained environments.

Read more
Development