---
This page covers the host toolchain, the SD-card layout the Raspberry
Pi 4 expects, the serial console, QEMU, and the test runner.
Reference:
[BCM2711 ARM Peripherals (RPi 4)](https://pip-assets.raspberrypi.com/categories/545-raspberry-pi-4-model-b/documents/RP-008248-DS-1-bcm2711-peripherals.pdf?disposition=inline).
## Contents
1. [Host toolchain](#1-host-toolchain)
2. [Building](#2-building)
3. [Running under QEMU](#3-running-under-qemu)
4. [SD-card layout](#4-sd-card-layout)
5. [Serial console](#5-serial-console)
6. [Helper shell functions](#6-helper-shell-functions)
7. [Host-side unit tests](#7-host-side-unit-tests)
## 1. Host toolchain
| Tool | Minimum version | Purpose |
| :------------------------- | :-------------- | :---------------------------------------- |
| Zig | 0.16.0 | Compile Zig + assembly, run `build.zig` |
| `flashc` | pinned | Transpile Flash (`.flash`) sources to Zig |
| `aarch64-elf-objcopy` | 2.40+ | ELF → raw binary |
| `aarch64-elf-nm` | 2.40+ | Symbol extraction for `populate-syms` |
| `qemu-system-aarch64` | 11.0.0+ | Run the kernel under QEMU |
| `screen` (or equivalent) | – | Serial console for the Pi |
On macOS:
```bash
brew install zig aarch64-elf-binutils qemu
```
### Flash compiler (`flashc`)
FlashOS's source modules are written in
[Flash](https://github.com/ajhahnde/Flash) and transpiled to Zig at
build time. `build.zig` resolves the `flashc` binary at
`~/Flash/zig-out/bin/flashc-stage1` by default; override the path with
`-Dflashc=