FreeBSD on RPi 4
As of now, the prebuilt SD card image for RPI (3/4) of FreeBSD 13.0 doesn't run out of the box on RPi 4 due to an issue with the bootloader and requires replacing the bootloader binary on the SD card. If you have a Raspberry PI OS installation and want to try FreeBSD on RPi 4, you can follow these steps:
-
Download and flash FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img.xz to an SD card.
-
Build U-Boot from recent checkout. Ref
# Install prerequisite packages
sudo apt-get install \
gcc \
gcc-aarch64-linux-gnu \
bc bison build-essential \
device-tree-compiler \
dfu-util \
efitools \
flex
git clone https://source.denx.de/u-boot/u-boot.git
cd u-boot
git checkout v2021.04
make rpi_4_defconfig
CROSS_COMPILE=aarch64-linux-gnu- make -j4
- Mount the boot partition of the SD card and copy u-boot.bin built from previous step.
sudo mount /dev/sda1 /mnt
sudo cp u-boot.bin /mnt/u-boot.bin
sudo umount /mnt
EDIT: The system booted this way recognizes only one CPU core out of the 4 cores available on the chip, for reason beyond my knowledge. So once booted, replace u-boot.bin on the SD card with the one from the sysutils/u-boot-rpi4 package, and then reboot.
pkg install sysutils/u-boot-rpi4
cp /usr/local/share/u-boot/u-boot-rpi4/u-boot.bin /boot/msdos/u-boot.bin
Refs.