When the computer powers up the first program to be executed is called (main) firmware. On most desktop and laptop computers firmware is BIOS. Companies creating BIOS in most of the cases care only about Windows support. This results in a condition when using interface in a way slightly different from Windows results in hitting bugs. Even worse this firmware is often closed-source, so we're unable to fix these bugs. The best solution is to avoid buying such hardware altogether. Free firmware I'm aware of are:

If for any reason you're stuck with buggy BIOS continue reading.

=== modified file 'util/i386/pc/grub-setup.c'
--- util/i386/pc/grub-setup.c   2009-11-24 14:00:25 +0000
+++ util/i386/pc/grub-setup.c   2009-12-20 13:34:14 +0000
@@ -401,7 +401,7 @@
     grub_util_error ("%s", grub_errmsg);
 
   /* FIXME: can this be skipped?  */
-  *boot_drive = 0xFF;
+  *boot_drive = 0x80;
 
   *kernel_sector = grub_cpu_to_le64 (embed_region.start);
 
@@ -537,7 +537,7 @@
   *kernel_sector = grub_cpu_to_le64 (first_sector);
 
   /* FIXME: can this be skipped?  */
-  *boot_drive = 0xFF;
+  *boot_drive = 0x80;
 
   *install_dos_part = grub_cpu_to_le32 (dos_part);
   *install_bsd_part = grub_cpu_to_le32 (bsd_part);


This patch has a drawback of not allowing to boot from second drive. If you're able to figure out what value of %dl your BIOS passes we can add a check in boot.img to ignore that value.

GRUB_TERMINAL=console

If not you'll need to debug what the problem. The easiest way to obtain more insight is to issue a command "set debug=all". But in this case you have no command prompt. So your only option is to apply following patch:

=== modified file 'kern/misc.c'
--- kern/misc.c 2010-02-06 23:36:18 +0000
+++ kern/misc.c 2010-02-22 15:05:07 +0000
@@ -186,12 +186,12 @@
                   const char *fmt, ...)
 {
   va_list args;
-  const char *debug = grub_env_get ("debug");
+  /*const char *debug = grub_env_get ("debug");
 
   if (! debug)
     return;
 
-  if (grub_strword (debug, "all") || grub_strword (debug, condition))
+    if (grub_strword (debug, "all") || grub_strword (debug, condition))*/
     {
       grub_printf ("%s:%d: ", file, line);
       va_start (args, fmt);

GrubWiki: BIOSBugs (last edited 2010-02-22 15:15:22 by VladimirSerbinenko)