FreeBSD on Zynq-7000 / Zybo / Zedboard

This page describes running FreeBSD on the Zedboard and other Xilinx Zynq-7000 platforms. The Zynq-7000 is an interesting platform combing a Xilinx 7-series FPGA fabric with a dual-core ARM Cortex-A9 based Application Processor Unit (System-on-a-Chip).

The Zedboard is an evaluation board for the Zynq-7000. It is manufactured by Digilent. More information on the Zedboard can be found at

The information on this page is migrating to the FreeBSD wiki at

Pre-built SD card image

An SD card image for the Zedboard is available here: FreeBSD-armv6-11.0-ZEDBOARD-290769.img.bz2.

MD5 (FreeBSD-armv6-11.0-ZEDBOARD-290769.img) = 2078ef3591b3a6d9d3d44db2491f5681
MD5 (FreeBSD-armv6-11.0-ZEDBOARD-290769.img.bz2) = 76e41d3dc993c212f516e3f0c544a25c

If you'd like to test-drive FreeBSD on a Zedboard, download the bzip2 compressed SD card image. Uncompress and copy the image to the SD card. On my machine, the SD card shows up as /dev/da0. Be sure that is the same on your machine before cut and pasting this.

bunzip2 FreeBSD-armv6-11.0-ZEDBOARD-290769.img.bz2
dd if=FreeBSD-armv6-11.0-ZEDBOARD-290769.img of=/dev/da0 bs=1M

Boot It

Power down the Zedboard. Insert the SD card in the SD slot and be sure the Zedboard's configuration mode jumpers are set for booting from the SD card before powering up. (If you've already been booting the Linux image from the SD card shipped with the Zedboard, you shouldn't need to change anything.)

The USB-UART connected to connector J14 acts as the FreeBSD console (device uart1). This is the same console as the stock Linux image. The Zedboard should automatically boot U-boot and then the FreeBSD kernel.

The FreeBSD kernel has drivers for the UARTs, SDHCI, Gig Ethernet, and a USB host driver for the USB OTG connected at J13. There is also a GPIO driver which allows reading of switches and buttons and controlling the LEDs.

Note: Booting this pre-built image will not display "FreeBSD" on the OLED display as shown in the picture. It was a separate C program I wrote and it needs some tweaking before I can release it.

Please send any feedback to me via E-mail


FreeBSD now runs on the Zybo! The Zybo from Digilent Inc. is a lower cost board than the Zedboard.

Here is a pre-built SD card image for Zybo: FreeBSD-armv6-11.0-ZYBO-290769.img.bz2.

MD5 (FreeBSD-armv6-11.0-ZYBO-290769.img) = 980168e474cb275a82045f32efcb81bd
MD5 (FreeBSD-armv6-11.0-ZYBO-290769.img.bz2) = db588d3df44d45f63d858d0b9e69a827
Follow the instructions above in the Zedboard section to uncompress and copy the image to an SD card. To boot the image on Zybo, don't forget to set the mode jumper (JP5) to boot from SD.

The following describes how I modified the Zedboard SD image for Zybo.

To run FreeBSD on a Zybo, start with the Zedboard SD image but a few files need to be changed. Download zybo_extrafiles.tgz and extract the files. Then mount the SD card partitions on your machine and copy the files over:

mkdir /mnt/boot /mnt/armroot
mount -t msdosfs /dev/da0s1 /mnt/boot
mount /dev/da0s2a /mnt/armroot

tar xzvf zybo_extrafiles.tgz
cd zybo_extrafiles
cp boot.bin u-boot.img /mnt/boot
cp rc.conf /mnt/armroot/etc/rc.conf
cp board.dtb /mnt/armroot/boot/kernel

umount /mnt/boot
umount /mnt/armroot


To run this image on a MicroZed, start with the Zedboard SD image but a few files need to change. Download microzed_extrafiles.tgz and extract the files. Then mount the SD card partitions on your machine and copy the files over:
mkdir /mnt/boot /mnt/armroot
mount -t msdosfs /dev/da0s1 /mnt/boot
mount /dev/da0s2a /mnt/armroot

tar xzvf microzed_extrafiles.tgz
cd microzed_extrafiles
cp boot.bin u-boot.img /mnt/boot
cp rc.conf /mnt/armroot/etc/rc.conf
cp board.dtb /mnt/armroot/boot/kernel

umount /mnt/boot
umount /mnt/armroot

Note: At boot-up, the USB-Host interface on MicroZed is held in reset by a Zynq GPIO signal (PS_MIO7). The quick-and-dirty way to release it from reset is as follows:

gpioctl -c 7 OUT
gpioctl 7 1
I haven't yet come up with a start-up script for /etc/rc.d to automate this.

Building an SD Image

Note: Tim Kientzle's crochet-freebsd tool can build ZedBoard images.

Here's how I create the SD image from the source.

Building boot files for Zedboard

The Zynq chip needs several files in an msdos boot partition to boot FreeBSD:

The boot.bin and u-boot.img files are built from Xilinx sources located at

To cross-compile these on FreeBSD requires ports devel/arm-none-eabi-gcc. You should be able to install this with pkg:

pkg install arm-none-eabi-gcc

You will also need Python:

pkg install python2

Fetch the Xilinx sources with git:

git clone u-boot-xlnx
cd u-boot-xlnx
git checkout -b xilinx-v2015.3

Build u-boot.img and boot.bin:

gmake CROSS_COMPILE=arm-none-eabi- distclean
gmake CROSS_COMPILE=arm-none-eabi- zynq_zed_config
gmake CROSS_COMPILE=arm-none-eabi- HOSTCC=cc
The bootfiles boot.bin and u-boot.img will be located in the top directory.

Note, if you are building boot files for the MicroZed, you'll need to patch include/configs/zynq_microzed.h to set CONFIG_ZYNQ_BOOT_FREEBSD:

  --- include/configs/zynq_microzed.h.orig2015-09-30 20:33:29 UTC
+++ include/configs/zynq_microzed.h
@@ -19,6 +19,7 @@

Next, we need ubldr:

cd /usr/src
make TARGET_ARCH=armv6 buildenv
Entering world for armv6:arm
cd sys/boot/arm
make UBLDR_LOADADDR=0x80000
ubldr will be in /usr/obj/arm.armv6/usr/src/sys/boot/arm/uboot/ubldr.

Finally, we need uEnv.txt in the boot partition. It looks like this:

uenvcmd=echo Booting FreeBSD from SD Card: ; mmcinfo && fatload mmc 0 ${loadaddr} ${bootfile} && bootelf

Build world and kernel

Next, we need to build world for armv6 and a kernel for Zedboard:

From the directory /usr/src:

make TARGET_ARCH=armv6 KERNCONF=ZEDBOARD buildworld buildkernel

Create an SD card image

The following creates SD card image with an msdos boot partition.
dd if=/dev/zero of=SDCARD.img count=1048576
mdconfig -f SDCARD.img -u 0

gpart create -s MBR md0
gpart add -s64m -t \!14 md0
gpart set -a active -i 1 md0
newfs_msdos -F 16 /dev/md0s1

gpart add -t freebsd md0
gpart create -s BSD md0s2
gpart add -t freebsd-ufs md0s2
newfs /dev/md0s2a
tunefs -n enable /dev/md0s2a

Mount SD card partitions

mkdir /mnt/boot /mnt/armroot
mount -t msdosfs /dev/md0s1 /mnt/boot
mount /dev/md0s2a /mnt/armroot

Populate root and boot partitions

From within the source directory:
make TARGET_ARCH=armv6 KERNCONF=ZEDBOARD DESTDIR=/mnt/armroot installworld distribution installkernel
Copy these files generated above to the boot partition:
cp boot.bin u-boot.img ubldr /mnt/boot

Final tweaks

Copy a couple more files:
cp board.dtb /mnt/armroot/boot/kernel
cp fstab rc.conf /mnt/armroot/etc

Create a mount point for the boot partition:

mkdir /mnt/armroot/boot/msdos

Unmount file systems

umount /mnt/boot
umount /mnt/armroot
mdconfig -d -u 0

Copy to an SD card

dd if=SDCARD.img of=/dev/da0 bs=1m

Thomas Skibo

E-mail Me