Loading onto ARM Hardware

The ARM platform has many ways to boot into an operating system. Typically there is some low-level ROM code (very specific to each device) that turns on RAM, and turns on enough clocks to be able to load a second-stage bootloader which does the work. Some do this in several stages, to enable Trust Zone, HYP-mode etc.

The main bootloaders after the ROM are U-Boot, UEFI, Loki (for Samsung devices) and simpleboot. Most of these provide Fastboot over USB to allow software loading.

On UEFI for arm: http://blog.hansenpartnership.com/efitools-for-arm-released/ On U-Boot for arm: http://www.denx.de/wiki/U-Boot

Load from U-Boot, from SD card or flash, or using Fastboot or TFTP. Most applications have two parts: treat the “kernel” part as a kernel, and the “application” part like an initial root disk. If there is only one part to an image (e.g., seL4test for some platforms) treat it like a kernel.

Detailed instructions differ from board to board. See The General Hardware Page for general instructions; it has links to board-specific instructions as well.

Fastboot

Most ARM platforms other than the Beagle Boards that seL4 can use support booting via Fastboot.

To boot via Fastboot, you need to convert the image file produced by the seL4 build system into a U-Boot image.

mkimage -A arm -a 0x48000000 -e 0x48000000 -C none -A arm -T kernel -O qnx -d INPUT_FILE OUTPUT_FILE

The reason we choose QNX is because we exploit the fact that, like seL4, QNX expects to be ELF-loaded. The alternative is to convert our ELF file into a binary file using objcopy. The address to use varies from board to board. Unless you change the load address, use these:

Platform Address
Arndale, Odroid-X, Odroid-XU 0x48000000
Sabre Lite 0x30000000
Panda, Panda ES 0x80000000

When you have your image, put the board into Fastboot mode (interrupt U-Boot, and type “fastboot”), then do:

fastboot boot OUTPUT_FILE

Beagle Board

You can compile a U-boot for Beagle Board that supports Fastboot, or you can use dfu-util with the standard U-Boot to transfer the image to the board.

The address that the file downloads to is controlled by the loadaddr environment variable in U-Boot. You can either download an ELF file, and then run bootelf on the U-Boot command-line, or download a U-Boot image file (created with mkimage) and use bootm to run it. You may need to take care that the ELF sections or image regions do not overlap with the location of the ELF/image itself, or loaded to non-existent memory address (0x81000000 works fine, but 0x90000000 won’t work on the original Beagle Board since there’s no RAM there).

dfu-util -D sel4test-image-arm

Booting from SD card

Pull out the SD card from your board, and put it into an SD card reader attached to your build host. Mount the (MS-DOS) filesystem on the first partition on the SD card and copy your image to it. Unmount the filesystem, and put the card back into your board. Reset the board (by power cycling, or pressing the reset button). To run the image:

mmc init
mmcinfo
fatload mmc 0 ${loadaddr} sel4test-image-arm
bootelf ${loadaddr}

You can use

fatls mmc 0

to see what is there. Most U-Boot implementations define a suitable loadaddr in their environment.

TFTP booting

Setting up a DHCP and TFTP server are out of scope for this document. Once you have done that, however, and installed a TFTP-enabled U-Boot on your board if it doesn’t already have one.

You can then power up the device and stop U-Boot’s auto boot feature if enabled by pressing a key, and do:

dhcp file address
bootelf address