FreeBSD on Pi: more stuff

November 29, 2012 — 24 Comments

Long overdue update on how the things are going with FreeBSD on Raspberry Pi. We’ve made some good progress so far:

  • Hans Petter Selasky fixed low-speed interrupt endpoints problem which means we have working USB keyboard now
  • GPIO driver by Luiz Otavio O Souza. So now you can blink OK LED (gpioctl -f /dev/gpioc0 -t 16). Not the most productive activity though.
  • Kernel now obtains information about display resolution, memory layout, MAC address from firmware
  • Framebuffer/syscons support added
  • Some stability fixes for SDHCI/li>
  • Initial port of VCHIQ interface (vchiq-freebsd)
  • Port of userland libraries (userland)

Overall stability and performance is still a problem, but it’s what we’re going to work on next.

And if you missed previous post: freebsd-pi is no more, use HEAD from FreeBSD subversion repository.

Boot process has been changed and now it looks like: firmware → uboot → ubldr → kernel. So old script for building image is no longer relevant. Here is new one. Tim Kientzle’s scripts collection for building images for BeagleBone, Pandaboard and RPi uses more systematic approach but RPi part hasn’t caught up to latest boot chain changes yet. Once it is up to date I suggest using Tim’s scripts.

Building FreeBSD does not require any additional tools but if you want VideoCore bits you’ll need following packages installed:

  • devel/cmake
  • devel/git
  • devel/gmake

If you don’t need VideoCore binaries, just comment build_videocore and install_videocore calls. This script will also install OpenGL ES hello_triangle demo to /root folder. To run it run perform following steps:

# cd /root
# kldload vchiq
# ./hello_triangle.bin

I tried to build Qt5 with OpenGL ES support, but build choked on compile-time assert triggered by FreeBSD using OABI. Good news though: EABI work is almost done, so there is a fat chance we’ll see Qt5 with eglfs backend running on FreeBSD in near future.

You can try pre-built image (124Mb, MD5 sums). Login is “root”, no password. Use dd to write it to SD card. U-Boot seems to be somewhat finicky about SD cards, so if you get “** Unrecognized filesystem type **” message try another card. First boot might take some time because sshd will generate keys. U-Boot output goes to serial port and monitor, FreeBSD console messages go only to monitor, but by the end of boot sequence you should get login prompt on serial.

This image is a snapshot of work in progress and by no means a production system.

UPDATE

** Unrecognized filesystem type ** U-Boot issue seems to be more widespread then I thought. I’m working on it.

gonzo

Posts

24 responses to FreeBSD on Pi: more stuff

  1. Great!!! Thanks a lot, but how to build R-PI without videocore. I want to use it for web-server with SSH only

  2. Great work thx :)

  3. U-Boot 2013.01-rc1-g6709570-dirty (Nov 27 2012 – 19:41:07)

    DRAM: 384 MiB
    WARNING: Caches not enabled
    MMC: bcm2835_sdhci: 0
    Using default environment

    In: serial
    Out: lcd
    Err: lcd
    mbox: Timeout waiting for response
    bcm2835: Could not set USB power state
    Net: Net Initialization Skipped
    No ethernet found.
    Hit any key to stop autoboot: 0
    ** Unrecognized filesystem type **
    ** Unrecognized filesystem type **
    U-Boot>

    Can’t boot to FreeBSD.

  4. I was getting problems with u-boot.bin before (see elsewhere on kernelnomicon) not being able to even read the boot.scr file. The Nov 27 version in the tar ball in the new build scripts has fixed the issue I was having before.

    Also the: init_emmc_clock=50000000 to config.txt has fixed the Bad CRC errors on the MMC device and I’ve finally been able to boot the SD card (albeit with a Nov 2nd kernel – I am now building an up to date one). (SanDisk Branded 2GB and 8GB SD cards).

    Looking very good from here now – will build an up-to-date kernel and image with the new build scripts and report if there are any problems…

  5. WARNING: Caches not enabled
    MMC: bcm2835_sdhci: 0
    Using default environment
    In: serial
    Out: lcd
    Err: lcd
    mbox: Timeout waiting for response
    bcm2835: Could not set USB power state
    Net: Net Initialization Skipped
    No ethernet found.
    Hit any key to stop autoboot: 0
    ** Unrecognized filesystem type **
    ** Unrecognized filesystem type **
    U-Boot>

    Can’t boot to FreeBSD. +1. sd card 16gb Transcend. Raspberry 512mb, model B.
    When you plan to fix?

  6. pls, write root password, this not blank :(

Trackbacks and Pingbacks:

  1. Тестирование порта FreeBSD для Raspberry Pi и гипервизора BHyVe | AllUNIX.ru — Всероссийский портал о UNIX-системах - December 4, 2012

    [...] Опубликован отчёт об успехах по созданию порта FreeBSD для одноплатного ПК Raspberry Pi. В настоящее время разработка порта перемещена в ветку FreeBSD HEAD. Из последних изменений отмечается добавление драйвера для GPIO, обеспечение поддержки Framebuffer/syscons, начальная реализация интерфейса VCHIQ и портирование библиотек, работающих в пространстве пользователя. Для тестирования подготовлен первый прототип загрузочного образа (124 Мб), работающего с SD-карты. В настоящее время ещё не решены все проблемы с производительностью и стабильностью, тем не менее, проект ощутимо продвигается вперёд. [...]

  2. Raspberry Pi向けFreeBSD移植プロジェクトの情報更新 USBキーボードが利用可能 « PCIアイオス株式会社 - December 6, 2012

    [...] 元記事URL : http://kernelnomicon.org/?p=185 Tweet {lang: 'ja'} (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if [...]

  3. ..:.:.:: Ufa FreeBSD News][ ::.:.:.. - December 9, 2012

    [...] Опубликован отчёт об успехах по созданию порта FreeBSD для одноплатного ПК Raspberry Pi. В настоящее время разработка порта перемещена в ветку FreeBSD HEAD. Из последних изменений отмечается добавление драйвера для GPIO, обеспечение поддержки Framebuffer/syscons, начальная реализация интерфейса VCHIQ и портирование библиотек, работающих в пространстве пользователя. Для тестирования подготовлен первый прототип загрузочного образа (124 Мб), работающего с SD-карты. В настоящее время ещё не решены все проблемы с производительностью и стабильностью, тем не менее, проект ощутимо продвигается вперёд. [...]

  4. FreeBSD auf dem Raspberry Pi — Kopfkino - December 9, 2012

    [...] Pi läuft. Ist zwar noch alles im Experimentierstadium, aber wer gerne experimiert, der sei auf diese Seite und diese Skripts [...]

  5. ทดลอง FreeBSD บน Raspberry Pi | Raspberry Pi Thailand - December 10, 2012

    [...] มาให้และอาจใช้งานได้แค่พื้นฐาน แต่ท้ายที่สุดก็มีแจก image ให้แล้วครับ มาลองของจริงกัน ใช้ image [...]

  6. VCHI driver, part 2 « FreeBSD developer's notebook - January 8, 2013

    [...] time ago I announced port of VCHI driver to FreeBSD. Since then it was re-licensed as BSD/GPL and I had high hopes for [...]

Leave a Reply

*

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>