9.1 Bootloaders Galore

As I said above, many bootloaders can be used with Linux on various hardware. In this section, I will introduce the most popular and most versatile open source bootloaders for each architecture. Some architectures, such as the MIPS and the m68k, have no standard bootloaders at all. If your target is based on an MIPS or m68k processor, refer to the documentation provided by the manufacturer for instructions on how to set up and boot your hardware.

Also, some publications make a distinction between "bootloader" and "monitor." In those cases, the bootloader is just the component that boots a device and launches the main software, whereas a monitor provides, in addition to booting capabilities, a command-line interface that can be used for debugging, reading/writing memory, flash reprogramming, configuring, etc. In this chapter, I will refer to both types of software as "bootloaders," while explicitly mentioning a bootloader's monitor capabilities when available.

In comparing bootloaders, keep in mind that the availability and extent of monitor capabilities are important during development. Once development is over, however, these capabilities may become a liability, because the priority is to ensure that the user cannot inadvertently enter the monitor mode. Some bootloaders, such as U-Boot for example, can be reconfigured to allow or disallow access to monitor features. Your production hardware may also be built to prevent physical access to the serial port.

Table 9-1 presents the open source bootloaders that can be used with Linux and the architectures they support. For each bootloader, the table also indicates whether the bootloader provides monitor capabilities, and provides a short description of the bootloader. Use this table as a starting point for identifying which bootloader is best for your embedded system.

Table 9-1. Linux-capable open source bootloaders and the architectures they support
     

Architectures

Bootloader

Monitor

Description

x86

ARM

PowerPC

MIPS

SuperH

m68k

LILO

No

The main disk bootloader for Linux

X

         

GRUB

No

GNU's successor to LILO

X

         

ROLO

No

Loads Linux from ROM without a BIOS

X

         

Loadlin

No

Loads Linux from DOS

X

         

Etherboot

No

ROMable loader for booting systems through Ethernet cards

X

         

LinuxBIOS

No

Linux-based BIOSreplacement

X

         

Compaq's bootldr

Yes

Versatile loader mainly intended for Compaq iPAQ

 

X

       

blob

No

Loader from the LART hardware project

 

X

       

PMON

Yes

Loader used in Agenda VR3

     

X

   

sh-boot

No

Main loader of the LinuxSH project

       

X

 

U-Boot

Yes

Universal loader based on PPCBoot and ARMBoot

X

X

X

     

RedBoot

Yes

eCos-based loader

X

X

X

X

X

X

In addition to the above table, there are a few observations to be made regarding the various bootloaders available for each architecture:

x86

There are two main bootloaders used for the x86: LILO and GRUB. LILO is the mainstream bootloader for most x86 workstation and server distributions. On Red Hat's distribution, however, GRUB has replaced LILO. There are other, less known bootloaders, such as Rolo and EtherBoot, which you may be interested in using under certain circumstances.

As you can see, few x86 bootloaders currently provide monitor capabilities. The most glaring limitation of x86 bootloaders is that most require an x86-based host for your development. The Makefiles of LILO and GRUB, for example, are not built to allow cross-compilation. Moreover, it is difficult to install either LILO or GRUB from a non-x86 host on storage media designated for an x86 target. Hence, even if you carry out all your development on a non-x86 host, you may need to use an x86 host to compile and install the x86 bootloader you select.

ARM

Though U-Boot aims at becoming the standard ARM bootloader, there is no standard bootloader for ARM-based systems at the time of this writing. There are, nevertheless, a couple of ARM bootloaders as shown in Table 9-1, each supporting a different set of hardware. There are also many other bootloaders that can be used to boot Linux on an ARM system. Some of these bootloaders are outdated or haven't been updated for a long time, others are particular to one type of board or are not available under an open source license.

PowerPC

The main bootloader found in most PPC systems is U-Boot (formerly known as PPCBoot.)

MIPS

There is no standard bootloader for MIPS-based embedded Linux systems. Though PMON may be useful as an initial codebase, you will most probably need to port it to your target before using it. At the time of this writing, efforts are underway to add MIPS support to U-Boot.

SuperH

Though sh-boot is the main bootloader for SH-based embedded Linux systems, you may find other bootloaders, such as RedBoot, better adapted to your system.

M68k

Though RedBoot supports some m68k-based systems, there is no standard bootloader for m68k-based embedded Linux systems.

Now that I've introduced the various bootloaders and outlined the bootloader support for each architecture, let's take a closer look at each bootloader.

9.1.1 LILO

The LInux LOader (LILO) was introduced by Werner Almesberger very early in Linux's history. Now, LILO is maintained by John Coffman and the latest releases are available from http://brun.dyndns.org/pub/linux/lilo/. LILO is a very well documented bootloader. The LILO package, for instance, includes a user manual and an internals manual. The LILO mini-HOWTO available from the LDP completes this documentation by answering some of the most common questions about LILO's use. In addition, Running Linux contains a "Using LILO" section in Chapter 5.

9.1.2 GRUB

The GRand Unified Bootloader (GRUB) is the main bootloader for the GNU project. GRUB was originally written by Erich Boleyn in the course of finding an appropriate bootloader for what would later be known as GNU Mach. Eric's work was later picked up by Gordon Matzigkeit and Okuji Yoshinori, who currently continue to maintain and develop GRUB. The GRUB project's web site is located at http://www.gnu.org/software/grub/. There, you will find the GRUB manual, which discusses the package's use extensively. One aspect of GRUB's capabilities you may find helpful during development is its ability to boot over the network using TFTP, and BOOTP or DHCP. Though GRUB's code can be retrieved using CVS, the latest stable releases are tar-gzipped and made available for download through the project's web site.

9.1.3 ROLO

The ROmable LOader (ROLO) was written and is being maintained by Robert Kaiser from Sysgo Gmbh. as part of Sysgo's ELinos distribution. ROLO can boot Linux directly from ROM without requiring any BIOS. ROLO is available from ftp://ftp.elinos.com/pub/elinos/rolo/. Though the package contains little documentation, Vipin Malik has written a thorough article on the use of ROLO in an embedded system at http://www.embeddedlinuxworks.com/articles/rolo_guide.html.

9.1.4 loadlin

loadlin is a DOS utility to load Linux maintained by Hans Lermen at http://elserv.ffm.fgan.de/~lermen/. Though you should avoid building your system in a way that requires DOS to be loaded first, there are cases where such a utility can be very handy. One case where it can be useful, for example, is if you want to use M-Systems's DOS tools to boot from a DOC device. In that case, you can write an autoexec.bat file that uses the loadlin utility to load Linux. As we will see below, however, you can boot Linux directly from a DOC device using GRUB.

9.1.5 EtherBoot

Many NICs are shipped with a socket for inserting ROM chips. When present and properly signed, these ROM chips are recognized as BIOS extensions and executed during startup. EtherBoot uses this capability to support the booting of diskless systems through the network. EtherBoot has been used in many environments, including X-terminals, routers, and clusters. It is available with complete documentation from http://etherboot.sourceforge.net/. The web site provides links to manufacturers who sell EPROMs preloaded with EtherBoot.

9.1.6 LinuxBIOS

LinuxBIOS is a complete BIOS replacement that boots Linux from ROM at startup. LinuxBIOS was developed as part of clustering research conducted at the Los Alamos National Laboratory and has gathered support from many hardware manufacturers. The LinuxBIOS package and documentation are available at http://www.linuxbios.org/.

9.1.7 Compaq's bootldr

Though initially developed for the Compaq iPAQ only, Compaq's bootldr currently supports Intel's Assabet and HP's Jornada 720. Though it is limited in the range of hardware it supports, bootldr provides a very rich command set and is capable of loading kernels directly from JFFS2 MTD partitions. Bootldr is part of the software collection maintained by http://www.handhelds.org/ and is available for download from ftp://ftp.handhelds.org/bootldr/.

9.1.8 blob

blob was introduced as the bootloader for the LART hardware project.[1] Since its introduction, blob has been ported to many other ARM-based systems, including Intel's Assabet and Brutus, Shannon, and Nesa boards. Unlike ARMBoot and Compaq's bootldr, blob does not provide monitor capabilities, though it can be used to reprogram the flash and can load kernels directly from JFFS2 MTD partitions. blob is available from the LART web site along with documentation at http://www.lart.tudelft.nl/lartware/blob/.

[1] See LART description in Appendix B.

9.1.9 PMON

The Prom Monitor (PMON) was written by Phil Bunce to support LSI LOGIC's MIPS boards. It is distributed under a very simplistic license, which stipulates that PMON comes with no warranty and that you are free to redistribute it without any restriction. Though Phil's PMON has not been updated since 1999, it is still available at http://www.carmel.com/pmon/. Others have nevertheless used PMON for more recent projects. It was ported to the now discontinued Agenda VR3 Linux PDA by Bradely LaRonde. That version is available from the AGOS SourceForge workspace at http://agos.sourceforge.net/ and information on its use is available from the Agenda Wiki site at http://agendawiki.com/. It remains that there is no central authority or roadmap for PMON, and few boards are actually supported. As I said earlier, you may find the PMON codebase a good starting point, but you will most probably need to port it to your system to use it.

9.1.10 sh-Boot

sh-boot is developed as part of the Linux SH project on SourceForge. Unfortunately, sh-boot has not been updated for a while, so you may need to evaluate its usability for your system. Also, sh-boot is a simple bootloader and does not provide any monitor capabilities. The bootloader is available using CVS through the Linux SH project site at http://linuxsh.sourceforge.net/.

9.1.11 U-Boot

Though there are quite a few other bootloaders, "Das U-Boot," the universal bootloader, is arguably the richest, most flexible, and most actively developed open source bootloader available. It is currently maintained by Wolfgang Denk of DENX Software Engineering, and is contributed to by a wide range of developers. U-Boot is based on the PPCBoot and ARMBoot projects. PPCBoot was itself based on 8xxrom sources, and ARMBoot was an ARM port of PPCBoot done by Sysgo Gmbh. At the time of this writing, U-Boot supports around 100 different PPC-based boards, more than a dozen ARM-based boards, and a handful of x86-based boards. U-Boot's success in scaling to a wide range of hardware has prompted developers to continue porting it to even more new boards and architectures.

Among other things, U-Boot is capable of booting a kernel through TFTP, from an IDE or SCSI disk, and from a DOC. Also, it includes read-only support for JFFS2. Besides having an extensive command set and quite a few capabilities, it is also fairly well documented. The README included with the package provides an in-depth discussion of the use of U-Boot. The doc directory in the package's source includes any extra instructions required for certain boards. In addition to the instructions found in the package, Wolfgang wrote the DENX PPCBoot and Linux Guide, available at http://www.denx.de/re/DPLG.html, which provides many practical examples of the use of PPCBoot with Linux on a TQM8xxL board. Though the discussion assumes that you are using PPCBoot and DENX's Embedded Linux Development Kit (ELDK) distribution,[2] the sections relating to the use of PPCBoot apply with little or no changes to U-Boot, and are helpful regardless of whether you use any distribution.

[2] The ELDK is an open source development and target distribution.

The U-Boot project workspace is located at http://sourceforge.net/projects/u-boot. The U-Boot package is available from that site. If you intend to use U-Boot often, you will find it useful to subscribe to the very active U-Boot users mailing list at that site. Though there is no on-site documentation for U-Boot at the time of this writing, you can still rely on the documentation and background provided by the two projects on which U-Boot is based, PPCBoot and ARMBoot. PPCBoot's web site is located at http://ppcboot.sourceforge.net/, and ARMBoot's project web site is located at http://armboot.sourceforge.net/. We will explore U-Boot's use later in this chapter.

9.1.12 RedBoot

RedBoot is supposed to be a next generation bootloader from Red Hat, replacing CygMon and GDB stubs with a firmware supporting a very wide range of hardware. Although Red Hat has stopped active development of eCos, the OS on which RedBoot is based, eCos has now been relicensed under the GPL and continues to be maintained by some of the Red Hat core eCos developers. eCos' future, and RedBoot's as well, is therefore in the hands of those developers.

Despite its dependency on eCos,[3] RedBoot remains a very powerful bootloader. It is, for instance, the only open source bootloader that currently supports all the architectures presented in depth in Chapter 3 and a wide range of boards based on these architectures. Also, the RedBoot package is fairly well documented, including a RedBoot User's Guide that provides actual examples of its use on more than a dozen different systems. RedBoot's web site is located at http://sources.redhat.com/redboot/ and its sources are available with the rest of the eCos sources using CVS. Lately, eCosCentric Ltd., the company formed by the core eCos developers from Red Hat, has been providing CVS snapshots at http://www.ecoscentric.com/snapshots/.

[3] RedBoot is part of the eCos source code tree and requires some of the code provided by that OS to provide its own services. Hence, RedBoot's development is tied to, but not entirely dependent on, eCos' development. Some platforms supported by RedBoot, for example, aren't supported by eCos.



     
    ASPTreeView.com
     
    Evaluation has УОКµ·ЛИјРНЪexpired.
    Info...