1.96 / February 3, 2008
|License||GNU General Public License|
GNU GRUB ("GRUB" for short) is a boot loader package from the GNU Project. GRUB is the main example of the Multiboot Specification, which allows a user to have more than one operating systems on their computer at once, and to choose which one to run when the computer starts. GRUB can be used to select from different kernel images available on a particular operating system's partitions, as well as to pass boot-time parameters to such kernels.
Functioning[change | change source]
When a computer is turned on, the computer's BIOS finds the primary bootable device (usually the computer's hard disk) and loads the initial bootstrap program from the master boot record (MBR), the first 512 bytes of the hard disk, and then transfers control to this code.
The MBR contains GRUB stage 1. Because of the small size of the MBR, Stage 1 just loads the next stage of GRUB (which may be physically elsewhere on the disk). Stage 1 can either load Stage 2 directly, or it can load stage 1.5: GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2.
When GRUB Stage 2 receives control, it presents an interface to the user in order to select which operating system to boot. This normally takes the form of a graphical menu, although if this is not available or the user wishes further control, GRUB has its own command prompt, where the user can manually specify the boot parameters. GRUB can also be set to automatically load a particular kernel after a timeout period.
Once boot options have been selected, GRUB loads the selected kernel into memory and passes control on to the kernel, which then continues to start itself. At this stage GRUB can also pass control of the boot process to another loader, using chain loading, for operating systems such as Windows that do not support the Multiboot standard. In this case, copies of the other system's boot programs have been saved by GRUB; instead of a kernel, the other system is loaded as though it had been started from the MBR. This may be yet another boot manager, such as the Microsoft boot menu, allowing further selection of non-Multiboot operating systems. (This behavior is often automatic when modern Linux distributions are installed "on top of" existing Windows systems, allowing the user to retain the original operating system without changes, including systems that contain multiple versions of Windows.)
Related pages[change | change source]
- Comparison of boot loaders
- Das U-Boot Universal Bootloader
- Ncurses and Ncurses package for Windows in GnuWin32
- xOSL Extended Operating System Loader
Other websites[change | change source]
- Official GNU GRUB project
- Documentation for forks:
- Grub tutorial for beginners Archived 2009-04-15 at the Wayback Machine
- GNU GRUB (0.97) Simplified for Newbies Archived 2009-04-17 at the Wayback Machine
- Structure at the start of a hard disk in a PC and how GRUB fits into that structure.
- WINGRUB: a GRUB installer for Windows Archived 2005-04-14 at the Wayback Machine
- LILO and GRUB: Boot Loaders Made Simple by Judith Myerson
- Boot with GRUB, Linux Journal - A good tutorial
- How to install and boot 145 OS in a PC (using GRUB)
- How to add GRUB to your USB thumb drive. Archived 2009-03-18 at the Wayback Machine