Skip to content

Guide · Open source

How to use raspberry-pi-os: clone, build and learn kernel basics

Updated · written with AI from the project's own documentation and checked against our catalogue data

raspberry-pi-os is an MIT-licensed, written lesson guide for building a small operating system kernel, called RPi OS, from scratch on the Raspberry Pi 3. It is aimed at students and developers who have some C and programming background and want to see how an OS works at a low level. After working through it, you will know where the repository's lessons and source snapshots are and how each lesson compares a hand-built kernel feature with the Linux kernel.

RPi OSs-matyukevich/raspberry-pi-os · ★ 14k · MIT

Quick start

  1. 1Read the README. Open the repository README to understand the goal and the Raspberry Pi 3 requirement.
  2. 2Clone the repository. Run the git clone command to download the lessons and source code to your machine.
  3. 3Check the prerequisites. Open docs/Prerequisites.md and confirm you have a Raspberry Pi 3 and a Linux build environment.
  4. 4Read the Introduction. Open docs/Introduction.md for project goals and history.
  5. 5Work through lesson 1. Read the RPi OS page, then the Linux pages, and compare the two approaches.
  6. 6Use the src snapshots. Open the matching src folder for each lesson to see the code at the point the lesson was completed.
  7. 7Do the exercises. Finish each lesson's exercises page before moving to the next lesson.

What raspberry-pi-os teaches

The repository is a step-by-step guide that teaches how to create a simple operating system kernel from scratch. The RPi OS source code is largely based on the Linux kernel, but the OS has very limited functionality and supports only the Raspberry Pi 3.

Each lesson first explains how a kernel feature is implemented in RPi OS, then shows how the same functionality works in the Linux kernel. Understanding the guide does not require any specific OS development skills, according to the README.

  • Lesson 1: Kernel Initialization
  • Lesson 2: Processor initialization
  • Lesson 3: Interrupt handling
  • Lesson 4: Process scheduler
  • Lesson 5: User processes and system calls
  • Lesson 6: Virtual memory management
  • Lessons 7 to 11 (signals, file systems, ELF, drivers, networking) are marked To be done

Clone the repository

The README's install step is to clone the repository with git. Cloning gives you the lesson documents in the docs folder and the source code in the src folder.

git clone https://github.com/s-matyukevich/raspberry-pi-os

Check the prerequisites before you build

You need Raspberry Pi 3 hardware to run the OS, and a Linux environment for building. The README points to docs/Prerequisites.md for details, which are not included in the material used for this page, so read that file in the repository before you start.

The guide supports only the Raspberry Pi 3. The README does not say it works on other Raspberry Pi models, so do not assume it does.

  • Raspberry Pi 3 hardware for running RPi OS
  • A Linux environment for building
  • Full details in docs/Prerequisites.md

Follow the lessons in order

Start with the Introduction (docs/Introduction.md) for project goals and history, then work through lesson 1 onward. Each lesson has a corresponding folder in the src directory containing a snapshot of the OS source code at the time the lesson was completed, so you can see how the project changes from one lesson to the next.

Lessons 2, 3, 4 and 5 each have a RPi OS page and a Linux page, and lesson 1 and lesson 3 include Linux sub-pages. Lesson 6's Linux section is marked In progress, and each lesson ends with an exercises page.

  • Read the RPi OS page for the lesson first
  • Read the matching Linux page to compare the approach
  • Check the src snapshot folder for that lesson's code
  • Try the lesson's exercises page

Contribute or follow the project

The project is still under active development. If you want to take part, read the Contribution guide at docs/Contributions.md. The README also links to a Slack group, a Facebook group and a Twitter account for updates.

What people use it for

  • Learning how a kernel starts up and initializes the processor on a Raspberry Pi 3
  • Studying how interrupts, timers and exception handling work, then comparing them with the Linux kernel
  • Following how a process scheduler and system calls are built in a small kernel
  • Preparing for an operating systems course with a hands-on project
  • Comparing a minimal hand-built kernel with the Linux kernel's approach

Frequently asked questions

Is raspberry-pi-os free to use?

Yes. The repository is licensed under the MIT licence, according to the project summary. You can clone it with git and use the code under that licence's terms.

What hardware do I need to use raspberry-pi-os?

You need a Raspberry Pi 3 to run RPi OS. The README says the OS supports only the Raspberry Pi 3. You also need a Linux environment for building, and the prerequisites details are in docs/Prerequisites.md.

How do I install raspberry-pi-os?

Clone the repository with git clone https://github.com/s-matyukevich/raspberry-pi-os. The project uses a clone-and-build method, so the source is downloaded and then built in a Linux environment.

Can I use RPi OS as my everyday operating system?

No. The README says RPi OS has very limited functionality. It is a learning project, not a general-purpose OS.

Does raspberry-pi-os work on Raspberry Pi 4 or Pi Zero?

The README says the project supports only the Raspberry Pi 3. It does not claim support for other models, so use a Raspberry Pi 3 for this project.

How does raspberry-pi-os compare with xv6 or Writing an OS in Rust?

Comparable projects include xv6, the Linux kernel, OSDev Wiki examples and Writing an OS in Rust. raspberry-pi-os differs in that each lesson explicitly compares a small kernel feature with how the Linux kernel does it.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

raspberry-pi-os suits students and developers with some C background who have a Raspberry Pi 3 and want a hands-on, lesson-by-lesson look at kernel internals. Skip it if you want a usable operating system, if you have a different Raspberry Pi model, or if you need a finished course, because several lessons are still in progress or to be done.

Install options & downloads