[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub-install

From: Marco Gerards
Subject: Re: grub-install
Date: Mon, 25 Jul 2005 18:35:55 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

Hollis Blanchard <address@hidden> writes:

>> In case others don't know the reason for "31KB":
>> As can be seen in the attached common linux disk layout diagram,
>> the optional DOS compatability region used by stage 1.5 is added by
>> default by most partition managers, and is there so that partitions
>> start on a cylinder boundry. Therefore its size is determined by the
>> number of sectors (512 bytes) per cylinder. The maximum sectors per
>> cylinder is 64, and so the largest size available for grub's stage 1.5
>> is 63 * 512, or 32256 bytes.
> This is for GRUB Legacy, right? There is no "stage 1.5" In GRUB2? What
> is the new layout?

You are right.  In GRUB 2 there is no stage 1.5 and stage2.  In GRUB 2
there is a core image.  It mainly consists of the stuff in kern/, some
stuff from disk/i386/pc, term/i386/pc.  Using that is can load

The core image with some modules replace stage 1.5.  So the main core
of GRUB together with some important modules are stored in this 31KB.
Because this space is limited not every module can fit in there.  Most
importantly is the filesystem module.  It is used to load other
modules from that filesystem.

So an example of a boot process is:

- The BIOS loads the GRUB2 (boot.img) as it is stored in the MBR

- GRUB2 in the MBR loads that 31KB into memory and jumps to it

- That 31KB consists of the kernel (kernel.img) and some raw modules

- The kernel (rescue mode) starts and loads every module

- Rescue mode tries to load normal.mod

- If normal.mod can be found on the prefix path it is loaded

- Normal mode looks for grub.cfg on the prefix path and loads it

- The menu is shown and the user can choose an OS to boot

It is possible to load additional modules so other filesystems can be
accessed, other loaders can be used, etc.  On the PC a nice set of
modules is: pc.mod (for partition access), _chain.mod (rescue mode
chainloader), ext2.mod.  Of course ext2.mod is for the case that you
want to load normal.mod and other modules from an ext2 filesystem.

I hope this e-mail made clear how GRUB 2 basically works on the PC.
I am not a PC expert and my English is not that good.  Hopefully
someone can and will correct me if I was wrong so I will understand
things better.  Hopefully Hollis' question is answered.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]