EFI

It is important to distinguish between the EFI system that starts when you power on the Joggler, and the boot loader that then goes on to load your chosen OS. It may be useful to read the EFI page on Wikipedia for a grounding.

When power is applied to a Joggler the firmware starts the EFI environment, which has been preprogrammed from the factory to look for devices to boot from. This includes USB-attached devices, which allows for recovery in case of damage to the native operating system.

Although USB devices appear to be booted in preference to the internal flash, it is often the case that the internal flash simply redirects to the external device should one be present (hence the two entries in startup.nsh, explained below). This allows us to start an alternative OS without altering the internal one. Happily, should the internal flash fail (which is a common fault) the EFI environment simply moves on to the next available storage device.

Boot Components
In order to boot, the first partition of any storage device must be FAT formatted (officially FAT16 is preferred) and around 64MB in size. Smaller sizes work reliably, while larger partitions (eg. 128MB) have been reported to fail. The files startup.nsh and boot.nsh are then used to control what happens next. By convention, startup.nsh is executed first.

startup.nsh
When creating your own system running from a USB device, the following contents are recommended:

fs1:boot fs0:boot

This is identical to the native operating system.

Should your startup.nsh be called (usually only happens if the internal flash is damaged) this will attempt to call boot on fs1, which would be the normal location for an external device. It will then attempt boot on fs0 should the previous command fail.

If you were creating your own system running from the internal 1GB of flash storage, the following is more appropriate (assuming the use of grub on the internal memory):

fs1:boot fs0:grub

This continues to prefer an external USB device to boot from for recovery purposes, but uses grub on the internal memory should no USB device be present. Remember that in this instance a boot.nsh file is not required on the internal flash memory, but is required on the USB device boot partition.

boot.nsh
The boot.nsh file identifies which EFI application is to be loaded. This must be a binary compiled specifically for the EFI environment; most commonly the GRUB bootloader is executed, although there are alternatives such as rEFIt.

Your boot file has been selected from the two possibilites in startup.nsh, but as we don't know for sure whether we're fs0 or fs1, it is best to specify both:

fs1:grub fs0:grub

These examples execute grub.efi on the root of the boot partition. If necessary you can move into subdirectories as follows:

fs1: cd \efi grub

In reality, the boot.nsh file is optional; startup.nsh is entirely capable of executing an EFI binary directly (which is what happens on the native operating system). However, using it allows for a predictable calling point, regardless of whether your Joggler has booted from internal or external storage. Any boot environment can call boot and be redirected to an appropriate binary.

grub.cfg
From this point your EFI-compiled bootloader takes over, loading an operating system on whichever partition you require. To illustrate, this is an example of the grub.cfg file from Jools Wills' Ubuntu 10.10 image:

set timeout=10 menuentry "Ubuntu 10.10 (Maverick) - 2.6.37.3joggler2" { set root=(hd0,1) linux /vmlinuz-2.6.37.3joggler2 root=/dev/sda3 ro quiet splash initrd /initrd.img-2.6.37.3joggler2 }

As you can see, this is a perfectly standard grub.cfg file, referencing vmlinuz-2.6.37.3joggler2 and initrd.img-2.6.37.3joggler2 for the 2.6.37.3joggler2 kernel. A convenient way to ensure that these files are concurrent with your Linux operating system (as they must be, otherwise it will fail to boot) is to mount the FAT16 partition as /boot in your operating system's /etc/fstab file.

Boot Loaders
The boot loader page contains information on pre-made boot loaders that can be used to start alternative operating systems. You should be aware that your kernel versions will need to match in order for these to be of use.