Diving into the soul of NetBSD: architecture support like arm64, riscv, and evbarm, cross-arch building for embedded devices, and use on SBCs, routers, and legacy hardware.

In episode 19 we optimized NetBSD's performance. Now we return to the root of its identity: portability. In this episode we'll dive into embedded, ARM, and a portability deep-dive — exploring architecture support like arm64, riscv, and evbarm, building systems cross-arch for embedded devices, and real-world application on SBCs, routers, and legacy hardware revival.
This is the episode that answers the question "why NetBSD?" — because not many operating systems can run smoothly on a Raspberry Pi, on a small router, and on old server hardware, all from the same source tree. Let's dissect how this portability magic works.
NetBSD's strength lies in its broad architecture support. Each architecture has a "port" — a directory in the source tree containing CPU, platform, and device support. See for yourself:
ls /usr/src/sys/archamd64 arm arm64 evbarm evbmips m68k mips powerpc riscv sparc64 vax ...| Port | Architecture/Devices | Category |
|---|---|---|
amd64 | Modern x86_64 PCs | Desktop/server |
arm64 | Generic 64-bit ARM | Modern/embedded |
evbarm | Evaluation ARM boards (RPi, Pine64) | Embedded/SBC |
riscv | RISC-V CPUs | Emerging |
evbmips | MIPS boards | Embedded |
sparc64 | Sun workstations | Legacy |
vax | VAX machines | Legacy/archaeology |
evbarm and evbmips are examples of NetBSD's port design: one port for "various boards", where each board is configured via kernel configs and device trees.
You don't need to own a device to build its system — that's the power of cross-building from episode 10. Let's build a kernel for the Raspberry Pi (aarch64/evbarm) from an x86 machine:
cd /usr/src
./build.sh -m evbarm-aarch64 toolsBuilding tool: nbtoolchain-gcc-...tools builds the toolchain for the target architecture — here evbarm-aarch64.
./build.sh -m evbarm-aarch64 kernel=GENERIC64...
copying netbsd to .../evbarm-aarch64/obj/release/kernels/GENERIC64/netbsd./build.sh -m evbarm-aarch64 -u distribution# build.sh: Building the distribution
...
# Creating release setsOne source set, many targets. This is the flow projects use to provide images for hundreds of devices from a handful of build servers.
Info
The machine name for build.sh follows the platform-arch format — for example evbarm-aarch64, evbarm-eb (big-endian), and riscv64. See the full list with ./build.sh -m x params (it will print an error listing the valid machines) or from the NetBSD Guide documentation.
NetBSD supports the Raspberry Pi from the early generations up to the Pi 4 and Pi 5 via the evbarm port. Once the kernel and world are ready, the SD image is prepared with a FAT partition for the firmware plus an FFS partition for root:
# FAT (boot) + FFS (root) partitions, then copy files:
cp -r evbarm/obj/distrib/evbarm/raw/ .
# follow the instructions to copy to the /mnt boot and root partitionsBooting a Pi with NetBSD gives you a full UNIX system on a device drawing less than 5 watts — ideal for a small personal server, DNS, or gateway managed with sysctl hw.model.
The Pine64 — a family of 64-bit ARM boards — is also well supported by NetBSD. For devices with more RAM and storage, the Pine64 is often chosen to run home servers: use pkgsrc to install nginx, and you have an ARM web server.
One of NetBSD's most popular embedded use cases is the router/gateway — because everything you need is already in the base system: npf (firewall + NAT), routing, IPv6, and bridging. The concepts from episodes 8, 12, and 16 come together:
ifconfig_wm0="inet 192.168.1.1 netmask 255.255.255.0"
ifconfig_re0="inet 203.0.113.5 netmask 255.255.255.0"
defaultroute="203.0.113.1"sysctl -w net.inet.ip.forwarding=1
npfctl startnet.inet.ip.forwarding=1With this combination, a small board (or an old PC) becomes a full NAT router with a firewall — lightweight, stable, and securely manageable over SSH.
NetBSD's portability also means bringing old hardware back to life. Sun workstations with sparc64, old PowerPC Macs, even VAX machines — NetBSD makes them useful again. The value is twofold:
sysctl hw.machine
sysctl hw.modelhw.machine = sparc64
hw.model = SUNW,UltraSPARC-IIi (1000MHz)| Need | NetBSD Choice |
|---|---|
| Small power-efficient server | Raspberry Pi, Pine64 |
| Home router/gateway | ARM board or old x86 PC |
| Multi-architecture homelab | x86 server + several SBCs |
| Preservation | Sparc64, PowerPC, VAX |
In this episode 20, you've dived into the soul of NetBSD: the architecture port map like arm64, riscv, and evbarm, the cross-build flow for embedded devices, and real-world use on SBCs (Raspberry Pi, Pine64), routers/gateways, and legacy hardware revival.
Key takeaways:
./build.sh -m <platform-arch> builds a kernel/world without the physical device.In the next episode, episode 21, we'll look at the current state of things: NetBSD 11.0 and the roadmap — the latest release features, the modern toolchain, RISC-V/ARM improvements, and the branch support lifecycle. See you in episode 21!