raspberry-pi-os
Learning operating system development using Linux kernel and Raspberry Pi
A step-by-step tutorial in C and assembly that teaches you how to build a simple operating system kernel from scratch for the Raspberry Pi 3, comparing each feature to how the real Linux kernel implements it.
This repository is a teaching project, not a finished product. It is a step-by-step guide that shows you how to build a simple operating system kernel from scratch, written for the Raspberry Pi 3, a small inexpensive computer. The author calls the result Raspberry Pi OS, or RPi OS. An operating system kernel is the core program that sits between the hardware and everything else and manages things like memory and running programs.
The teaching approach is the interesting part. The code is loosely based on the Linux kernel, the same core used in Android and most servers, but stripped down to a very limited version so it is possible to follow. Each lesson first explains how RPi OS implements a particular feature, then shows how the much larger Linux kernel does the same thing. This lets a reader see a simple version first and then connect it to how real-world systems work.
The repository is organized so you can track progress. Every lesson has its own folder under a src directory that holds a snapshot of the source code as it stood when that lesson was finished. That way you can watch the operating system grow piece by piece instead of facing the whole thing at once. The author states that you do not need any prior operating-system development experience to follow along.
The table of contents lays out the curriculum. Early lessons cover starting the kernel and initializing the processor. Later ones move into interrupt handling, scheduling which program runs next, user processes and system calls, and virtual memory management. Several further topics, including signals, file systems, executable files, device drivers, and networking, are listed as still to be done, so the project is openly a work in progress.
The README also links to an introduction, a list of prerequisites, and a contribution guide, and it points to community channels on Twitter, Facebook, and Slack. In plain terms, this is an educational resource in C and assembly that walks a curious reader through writing a tiny operating system, using real Linux internals as the reference point throughout.
Where it fits
- Follow the numbered lessons to build a mini OS kernel step by step and understand how interrupts and memory management really work.
- Compare the simplified RPi OS version of scheduling or virtual memory to the real Linux kernel code to understand both at once.
- Use the per-lesson source snapshots as a reference checkpoint when building your own bare-metal Raspberry Pi project.