bug-grub
[Top][All Lists]
Advanced

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

Fix for El Torito bootable Grub CD bug - #8722


From: Dave Farrance
Subject: Fix for El Torito bootable Grub CD bug - #8722
Date: Thu, 12 Jun 2008 22:40:32 +0100

I followed the "Making a GRUB bootable CD-ROM" guide from gnu.org, but
booting the resultant CD on my laptop (a Centrino) gave the Grub command
line instead of the menu.  The symptoms seemed identical to bug #8722 as
discussed in the mailing list post "El Torito booting on older machine":

http://lists.gnu.org/archive/html/bug-grub/2004-04/msg00152.html

   grub> geometry ( <TAB>
   Possible disks are: fd0 hd0

Since "cd" is not listed as a visible disk, Grub can't access menu.lst.

I tried using different stage2_eltorito binaries from various linux
distributions and I found one in the Frugalware distro that worked fine:

http://www7.frugalware.org/pub/frugalware/frugalware-0.8/boot/grub/

When I looked to the source to find out why this worked correctly to make
menu.lst visible, I found  a bunch of patch files in this directory:

http://www7.frugalware.org/pub/frugalware/frugalware-0.8/source/base/grub/

The patch that made it work for me was: 02-grub-0.97-debugcdboot.patch 

That implements two extra commands for debugging the fix, cdinfodebug and
cdinfohack, each with one parameter (0 or 1) to disable or enable the
feature; the defaults being debugging disabled and the hack enabled.

By removing the debugging, I found that I could reduce the patch to the
insertion of just five lines in the source file /stage2/bios.c
which I've attached below.  With that, my bootable Grub CDs are fine.

I know that Grub-0.9x is no longer being updated, but this fix has been
known about since 2004, and yet it has remained with Frugalware, and no
other Linux distros have implemented this fix.  I've no idea how
widespread the problem is, and how many PCs fall foul of this bug -- but
I have no reason to think that there's anything unusually problematic
with my laptop, and it boots all other bootable CDs that I've tried OK.

All Linux distros are still using the 0.9x Grub, any probably will for
some time yet, so should this fix be reported somewhere?

------------ cut here ------------

--- grub-0.97.orig/stage2/bios.c      2004-03-27 16:34:04.000000000 +0000
+++ grub-0.97/stage2/bios.c      2008-06-12 20:32:09.000000000 +0100
@@ -147,6 +147,13 @@
   grub_memset (&cdrp, 0, sizeof (cdrp));
   cdrp.size = sizeof (cdrp) - sizeof (cdrp.dummy);
   err = biosdisk_int13_extensions (0x4B01, drive, &cdrp);
+
+  if (drive >= 0x88) {
+    cdrp.drive_no = drive;
+    cdrp.media_type = 0x00;
+    err = 0;
+  }
+
   if (! err && cdrp.drive_no == drive)
     {
       if ((cdrp.media_type & 0x0F) == 0)

------------ cut here ------------

-- 
Dave Farrance





reply via email to

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