The boot loader is the first piece of code which is run when a processor comes out of reset. It is responsible for the low-level initialisation of the hardware, after which it will load and transfer control to the operating system. Boot loaders can be very simple, doing very little initialisation before passing control to the operating system, or highly complex: providing functionality such as LCD display or booting from USB devices.
Choosing a Boot Loader
Some common embedded system boot loaders are:
E-Boot () is the Windows CE boot loader. E-Boot is a good choice as a boot loader for an embedded device designed only to run Windows CE. E-Boot has the following advantages:
- Normally supplied with the Windows CE Board Support Package.
- Network support for communication with development tools.
- Quick to develop with Microsoft's helper libraries.
Some disadvantages of E-Boot are:
- No direct support for booting Linux.
- Closed source.
RedBoot (http://ecos.sourceware.org/redboot/) is a boot loader for embedded systems. It is based on the hardware abstraction layer from the eCos operating system. Redboot has the following advantages:
- Compact. RedBoot is smaller than many other popular boot loaders.
- Portable. RedBoot supports a wide range of embedded processors.
- RedBoot can use the GNU Debugger (GDB) to debug applications via serial or ethernet.
Redboot also has the following disadvantages:
- Not as fully featured as some other popular boot loaders.
- Complex. RedBoot is almost a full operating system in its own right, and as a result has a reasonably high level of complexity.
Das U-Boot (http://www.denx.de/wiki/UBoot) is the Universal Boot loader, commonly abbreviated as U-Boot. U-Boot has been specifically designed as a boot loader for embedded systems, and closely follows the development of Linux, with some code shared between both projects. U-Boot has the following advantages:
- Well established architecture.
- Initialisation for many CPU's already provided.
- Support for display, file system, network, and external.
- Can be used to boot any operating system.
- Benefit from the huge Open Source community.
- Fully customisable, including boot scripts.
- Open source/GPL.
- Relatively simple architecture.
Some disadvantages of U-Boot are:
- Due to the large number of included features U-Boot is larger and slower to load than some other available boot loaders.
Custom Boot Loaders
In some situations a custom boot loader may be the best option. Custom boot loaders provide the following advantages over other common boot loaders:
- Smaller and faster than more flexible boot loaders.
- Not constrained by multi-platform compatibility.
- Source model and license can be customised to suit the project.
However they also have the following disadvantages:
- Requirements must be set in stone before development starts.
- All components must be created from scratch adding to the development time.
Bluewater Systems recommends using U-Boot as the boot loader for most embedded devices because it is cross platform, open source, fully featured and easily extensible. Even if a custom boot loader is required for performance reasons, we recommend using U-Boot during development.
Bluewater Systems Experience
At Bluewater Systems we use U-boot as our primary boot loader for embedded platforms. We maintain a modified version of the U-Boot v1.1.6 source code which is available via anonymous ftp from ftp://bluewatersys.com/. The Snapper and Rig products are supplied with custom U-Boot scripts to simplify common booting options such as: Booting from a DHCP server, loading a kernel/root file system via TFTP, NFS or from NAND flash, and easily configuring the Linux kernel boot arguments.
We significantly improved the boot time of the DDS-XM100 series by adding code to U-Boot to enable the data cache while U-Boot is running on the Snapper 255. This code works for all Snapper 2xx products.