Booting Barrelfish on PandaBoard

If you are building Barrelfish for the first time, please have a look at the README file.

Toolchain

For cross-compiling to arm we are using the Mentor / codesourcery toolchain (v 2012.03):

$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Sourcery CodeBench Lite 2012.03-57) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Building a Barrelfish PandaBoard image

We need to build for armv7 and then run make pandaboard_image:

$ mkdir build; cd build
$ ../tip/hake/hake.sh -i . -s ../tip/ -a armv7

After running hake.sh edit the Config.hs file in the hake subdirectory of your build directory and modify the armv7_platform setting as follows:

armv7_platform = "pandaboard"

Then run the following:

$ make -j4 pandaboard_image
...
OK - pandaboard boot image is built.
If your boot environment is correctly set up, you can now:
usbboot ./pandaboard_image

Building usbboot

To boot pandaboard_image we need usbboot You can get usbboot source code from: https://github.com/swetland/omap4boot.git, but you will have to apply a patch:

$ git log -n 1 --pretty=short
commit b6c998113173e38655c8c9b40d88776992bdcd78
Author: Dan Murphy <dmurphy@ti.com>

    OMAP4: Remove dummy writes to SDRC
$  git diff
diff --git a/aboot.c b/aboot.c
index 6c12694..126e40a 100644
--- a/aboot.c
+++ b/aboot.c
@@ -34,7 +34,7 @@
 
 #define WITH_MEMORY_TEST       0
 #define WITH_FLASH_BOOT                0
-#define WITH_SIGNATURE_CHECK   1
+#define WITH_SIGNATURE_CHECK   0
 
 #if WITH_MEMORY_TEST
 void memtest(void *x, unsigned count) {
diff --git a/boot.c b/boot.c
index 743e2e8..98ed777 100644
--- a/boot.c
+++ b/boot.c
@@ -42,8 +42,8 @@ int boot_image(unsigned machtype, unsigned image, unsigned len)
                if (x[n] != "ANDROID!"[n]) break;
 
        if (n != 8) {
-               printf("jumping to 0x%x...\n", CONFIG_ADDR_DOWNLOAD);
-               entry = CONFIG_ADDR_DOWNLOAD;
+               entry = CONFIG_ADDR_DOWNLOAD + 0x1000;
+               printf("jumping to 0x%x...\n", entry);
                entry(0, cfg_machine_type, CONFIG_ADDR_ATAGS);
                for (;;);
        }

Building usbboot:

$ TOOLCHAIN=arm-none-linux-gnueabi- make
...
link out/panda/usbboot
...

Booting barrelfish

Connect to the serial:

$ picocom -b 115200 /dev/ttyUSB0

And boot PandaBoard using usbboot

$ usbboot pandaboard_image
using built-in 2ndstage.bin
reading ASIC ID
CHIP: 4440
...
sending image to target...

You should see barrelfish booting on your picocom window:

MMU enabled
paging_arm_reset: base: 0x80000000, length: 0x40000000.
invalidate cache
invalidate TLB
startup_early
kernel_startup_early done!
paging_map_device_section: 0x8400c000, 0xffe00000, 0x48020000.
omap serial_init[2]: base = 0xffe00000 0xffe20000
omap serial_init[2]: done.
Barrelfish CPU driver starting on ARMv7 OMAP44xx Board id 0x000008e0
...