# s-matyukevich/raspberry-pi-os architecture

> Architecture diagram of the GitHub repository s-matyukevich/raspberry-pi-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/s-matyukevich/raspberry-pi-os
- Repository: https://github.com/s-matyukevich/raspberry-pi-os

## Overview

This repository is a Raspberry Pi 3 bare-metal OS teaching project. Its main user workflow is to follow lessons that explain a kernel concept, inspect the corresponding RPi OS snapshot, and compare it with Linux; the source tree preserves the OS as it evolves. The graph emphasizes the documented lesson stages and the sampled UART/formatting code. Later kernel subsystems are represented at their existing lesson directories because their implementations were not sampled; their internal calls are therefore not asserted.

Main entry points: [`README.md`](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/README.md) (OS lessons), [`src/lesson01/src/mini_uart.c`](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/src/mini_uart.c) (Mini UART), [`src/lesson06`](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson06) (Virtual memory), [`exercises/lesson01/2/gcrisis/uart-boot/src/main.c`](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/exercises/lesson01/2/gcrisis/uart-boot/src/main.c) (UART kernel loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guide["Learning guide"]
  node_guide["OS lessons<br/>[README.md]"]
end

subgraph group_boot["Boot and console"]
  node_initialization["Kernel initialization"]
  node_uart["Mini UART<br/>[mini_uart.c]"]
  node_gpio["GPIO registers<br/>[gpio.h]"]
  node_uartregs["UART registers<br/>[mini_uart.h]"]
  node_uartapi["UART interface<br/>[mini_uart.h]"]
  node_uartboot["UART kernel loader<br/>[main.c]"]
  node_uartbootapi["Loader UART interface<br/>[uart.h]"]
end

subgraph group_kernel["Kernel progression"]
  node_processor["Processor setup"]
  node_interrupts["Interrupt handling"]
  node_scheduler["Process scheduler"]
  node_processes["Processes and syscalls"]
  node_memory["Virtual memory"]
end

subgraph group_runtime["Runtime support"]
  node_formatapi["Formatting interface<br/>[printf.h]"]
  node_format["Formatting runtime<br/>[printf.c]"]
  node_memorymanager["Memory manager<br/>[mm.c]"]
end

node_learner(("Learner"))

node_learner -->|"follows lessons"| node_guide
node_guide -->|"starts with"| node_initialization
node_guide -->|"covers next"| node_processor
node_guide -->|"covers next"| node_interrupts
node_guide -->|"covers next"| node_scheduler
node_guide -->|"covers next"| node_processes
node_guide -->|"covers next"| node_memory
node_uart -->|"accesses registers"| node_gpio
node_uart -->|"accesses registers"| node_uartregs
node_uartboot -->|"calls UART"| node_uartbootapi
node_format -->|"implements API"| node_formatapi
node_memory -.->|"includes implementation"| node_memorymanager

click node_guide "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/README.md"
click node_initialization "https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson01"
click node_uart "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/src/mini_uart.c"
click node_gpio "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/include/peripherals/gpio.h"
click node_uartregs "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/include/peripherals/mini_uart.h"
click node_uartapi "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/include/mini_uart.h"
click node_uartboot "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/exercises/lesson01/2/gcrisis/uart-boot/src/main.c"
click node_uartbootapi "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/exercises/lesson01/2/rs/include/uart.h"
click node_processor "https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson02"
click node_interrupts "https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson03"
click node_scheduler "https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson04"
click node_processes "https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson05"
click node_memory "https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson06"
click node_formatapi "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson02/include/printf.h"
click node_format "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson02/src/printf.c"
click node_memorymanager "https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson06/src/mm.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_guide toneBlue
class node_initialization,node_uart,node_gpio,node_uartregs,node_uartapi,node_uartboot,node_uartbootapi toneAmber
class node_processor,node_interrupts,node_scheduler,node_processes,node_memory toneMint
class node_formatapi,node_format,node_memorymanager toneRose
class node_learner toneIndigo
```

## Components

### Learning guide

- [OS lessons](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/README.md): `README.md`

### Boot and console

- [Kernel initialization](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson01): `src/lesson01`
- [Mini UART](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/src/mini_uart.c): `src/lesson01/src/mini_uart.c`
- [GPIO registers](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/include/peripherals/gpio.h): `src/lesson01/include/peripherals/gpio.h`
- [UART registers](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/include/peripherals/mini_uart.h): `src/lesson01/include/peripherals/mini_uart.h`
- [UART interface](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/include/mini_uart.h): `src/lesson01/include/mini_uart.h`
- [UART kernel loader](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/exercises/lesson01/2/gcrisis/uart-boot/src/main.c): `exercises/lesson01/2/gcrisis/uart-boot/src/main.c`
- [Loader UART interface](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/exercises/lesson01/2/rs/include/uart.h): `exercises/lesson01/2/rs/include/uart.h`

### Kernel progression

- [Processor setup](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson02): `src/lesson02`
- [Interrupt handling](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson03): `src/lesson03`
- [Process scheduler](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson04): `src/lesson04`
- [Processes and syscalls](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson05): `src/lesson05`
- [Virtual memory](https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson06): `src/lesson06`

### Runtime support

- [Formatting interface](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson02/include/printf.h): `src/lesson02/include/printf.h`
- [Formatting runtime](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson02/src/printf.c): `src/lesson02/src/printf.c`
- [Memory manager](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson06/src/mm.c): `src/lesson06/src/mm.c`

### Other components

- **Learner**

## Connections

- Learner → OS lessons: follows lessons (evidence: `README.md`)
- OS lessons → Kernel initialization: starts with (evidence: `README.md`)
- OS lessons → Processor setup: covers next (evidence: `README.md`)
- OS lessons → Interrupt handling: covers next (evidence: `README.md`)
- OS lessons → Process scheduler: covers next (evidence: `README.md`)
- OS lessons → Processes and syscalls: covers next (evidence: `README.md`)
- OS lessons → Virtual memory: covers next (evidence: `README.md`)
- Mini UART → GPIO registers: accesses registers (evidence: `src/lesson01/src/mini_uart.c`)
- Mini UART → UART registers: accesses registers (evidence: `src/lesson01/src/mini_uart.c`)
- UART kernel loader → Loader UART interface: calls UART (evidence: `exercises/lesson01/2/gcrisis/uart-boot/src/main.c`)
- Formatting runtime → Formatting interface: implements API (evidence: `src/lesson02/src/printf.c`)
- Virtual memory → Memory manager: includes implementation
