Go to the first, previous, next, last section, table of contents.


Introduction

This part documents the user-visible aspect of GRUB. If you are looking for the information on the internals, see the Programmer Reference Manual (see section Implementation details).

History of GRUB

GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU Hurd with the University of Utah's Mach 4 microkernel (now known as GNU Mach). Erich and Brian Ford designed the Multiboot Specification (see section `Motivation' in The Multiboot Specification), because they were determined not to add to the large number of mutually-incompatible PC boot methods.

Erich then began modifying the FreeBSD boot loader so that it would understand Multiboot. He soon realized that it would be a lot easier to write his own boot loader from scratch than to keep working on the FreeBSD boot loader, and so GRUB was born.

Erich added many features to GRUB, but other priorities prevented him from keeping up with the demands of its quickly-expanding user base. In 1999, Gordon Matzigkeit and OKUJI Yoshinori adopted GRUB as an official GNU package, and opened its development by making the latest sources available via anonymous CVS. See section How to obtain and build GRUB, for more information.

GRUB features

The primary requirement for GRUB is that it be compliant with the Multiboot Specification, which is described in section `Motivation' in The Multiboot Specification.

The other goals, listed in approximate order of importance, are:

Except for specific compatibility modes (chain-loading and the Linux piggyback format), all kernels will be started in much the same state as in the Multiboot Specification. Only kernels loaded at 1 megabyte or above are presently supported. Any attempt to load below that boundary will simply result in immediate failure and an error message reporting the problem.

In addition to the requirements above, GRUB has the following features (note that the Multiboot Specification doesn't require all the features that GRUB supports):

Multiple Executable Formats
Supports many of the a.out variants plus ELF. Symbol tables are also loaded.
Support Non-Multiboot Kernels
Supports many of the various free 32-bit kernels that lack Multiboot compliance (primarily FreeBSD, NetBSD, OpenBSD, and Linux). Chain-loading of other boot loaders is also supported.
Load Multiples Modules
GRUB fully supports the Multiboot feature of loading multiple modules.
Configuration File
Supports a human-readable text configuration file with preset boot commands. The list of commands (see section The list of available commands) are a superset of those supported on the command line. An example configuration file is provided in section Configuration.
Menu Interface
A menu interface listing the preset boot commands, with a programmable timeout, is available. There is no fixed limit on the number of boot entries, and the current implementation has space for several hundred.
Flexible Command Line Interface
A fairly flexible command line interface, accessible from the menu, is available to edit any preset commands, or write a new boot command set from scratch. If no configuration file is present, GRUB drops to the command line. The list of commands (see section The list of available commands) are a subset of those supported for configuration files. Editing commands closely resembles the Bash command line (see section `Command Line Editing' in Bash Features), with TAB-completion of commands, devices, partitions, and files in a directory depending on context.
Multiple Filesystem Types
Supports multiple filesystem types transparently, plus a useful explicit blocklist notation. The currently supported filesystem types are BSD FFS, DOS FAT16 and FAT32, Minix fs, Linux ext2fs, and ReiserFS. See section Filesystem syntax and semantics, for more information.
Decompression Support
Can decompress files which were compressed by gzip. This function is both automatic and transparent to the user (i.e. all functions operate upon the uncompressed contents of the specified files). This greatly reduces file size and loading time, a particularly major benefit for floppies.(4) It is conceivable that some kernel modules should be loaded in a compressed state, so a different module-loading command can be specified to avoid uncompressing the modules.
Access Data on Any Installed Device
Supports reading data from any or all floppy or hard disk(s) recognized by the BIOS, independent of the setting of the root device.
Independent of Drive Geometry Translation
Unlike many other boot loaders, GRUB makes the particular drive translation irrelevant. A drive installed and running with one translation may be converted to another translation without any adverse effects or changes in GRUB's configuration.
Detect All Installed RAM
GRUB can generally find all the installed RAM on a PC-compatible machine. It uses an advanced BIOS query technique for finding all memory regions (see section How to detect all installed RAM). As described on the Multiboot Specification (see section `Motivation' in The Multiboot Specification), not all kernels make use of this information, but GRUB provides it for those who do.
Support Logical Block Address Mode
In traditional disk calls (called CHS mode), there is a geometry translation problem, that is, the BIOS cannot access over 1024 cylinders, so the accessible space is limited to at least 508 MB and to at most 8GB. GRUB can't universally solve this problem, as there is no standard interface used in all machines. However, several newer machines have the new interface, Logical Block Address (LBA) mode. GRUB automatically detects if LBA mode is available and uses it if available. In LBA mode, GRUB can access the entire disk.
Network support
GRUB is a disk-based boot loader but also has network support. You can load OS images from a network by using the TFTP protocol.

Future directions might include an internal programming language for supporting richer sets of boot options with control statements (which would make GRUB its own kind of kernel). Support for non-PC hardware architectures is also planned.(5)

The role of a boot loader

The following is a quotation from Gordon Matzigkeit, a GRUB fanatic:

Some people like to acknowledge both the operating system and kernel when they talk about their computers, so they might say they use "GNU/Linux" or "GNU/Hurd". Other people seem to think that the kernel is the most important part of the system, so they like to call their GNU operating systems "Linux systems."

I, personally, believe that this is a grave injustice, because the boot loader is the most important software of all. I used to refer to the above systems as either "LILO"(6) or "GRUB" systems.

Unfortunately, nobody ever understood what I was talking about; now I just use the word "GNU" as a pseudonym for GRUB.

So, if you ever hear people talking about their alleged "GNU" systems, remember that they are actually paying homage to the best boot loader around... GRUB!

We, the GRUB maintainers, do not (usually) encourage Gordon's level of fanaticism, but it helps to remember that boot loaders deserve recognition. We hope that you enjoy using GNU GRUB as much as we did writing it.


Go to the first, previous, next, last section, table of contents.