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:
1. Coreboot has made a great job in freeing x86-based mobos. You can consult their list here: http://www.coreboot.org/Supported_Motherboards
2. Touchbook by always innovating http://alwaysinnovating.com/home/index.htm claims to use U-Boot and supply the complete sources. I haven't checked this claim however
3. Yeeloong by Lemote http://www.lemote.com/english/yeeloong.html. It uses PMON, soon GRUB will work as firmware on it too (big parts are done)
If for any reason you're stuck with buggy BIOS continue reading.
- 1. Hanging at "GRUB " message. This often happens if BIOS passes incorrect boot device. This can be workarounded by following patch
=== 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.
- 2. Early hang at "Welcome to GRUB message". This may be due to several reasons. Most common is actually GRUB being overwritten by something else and not a firmware bug. To check dump the space preceding your first partition (usually 63 sectors) and compare before and after running grub-install. Secondly this problem may be due to some commands in your grub.cfg. Try to delete it and see if you're correctly dropped into a prompt. IF you're modifying grub.cfg should help. The most likely reason is buggy video support. To use text mode uncomment the following line in grub.cfg:
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);