chain.c32: add support for loading GRUB stage2
authorPaul Bolle <pebolle@tiscali.nl>
Fri, 4 Jun 2010 12:14:49 +0000 (14:14 +0200)
committerH. Peter Anvin <hpa@linux.intel.com>
Mon, 7 Jun 2010 21:53:00 +0000 (14:53 -0700)
commita3bc7cc0cd20a133a6f11537eb51b0dc252fefc0
tree4c4b82e2cbef39b6aae8362fc6201a845b33f855
parent4d66117c87409691ddf1501c17d1642040414a7c
chain.c32: add support for loading GRUB stage2

This adds (basic) support for GRUB stage2 image files.

Loading a stage2 image will probably give you a GRUB prompt, with GRUB's
"root" set at "(hd0)" (ie, entire first disk). Maybe the "root" will
differ in less common setups. (One can of course select another disk
and/or partition with GRUB's "root" command.)

This has only been tested with version 3.2 stage2 images (as used by
GRUB 0.97). I'm not familiair with differences with other versions.

GRUB's loading mechanism allows to somehow provide stage2 with the
selected disk and partition, BSD slice, etc. (ie, to tell stage2 what
it's "root" is). I don't yet understand the notation used in that
mechanism. Besides, since stage2 images will not necessarily be loaded
from the disk (and partition, etc.) they were installed to, it seems
best to just use the first disk.

GRUB stage1_5 image files load quite similarly. However, for some
reason, a short test only got those images to print an error ("Error
17"). This could be related to the partition info these images are
provided with when they're loaded. I have never used stage1_5 images,
and do not know how to properly use and configure those, so my test
stopped there, and stage1_5 images are not supported.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
com32/modules/chain.c