[Top][All Lists]

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

[bug #29464] util/i386/pc/grub-setup: fails to write Buggy BIOS boot-sec

From: TJ
Subject: [bug #29464] util/i386/pc/grub-setup: fails to write Buggy BIOS boot-sector drive-number detection in boot.img
Date: Thu, 08 Apr 2010 02:39:11 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100404 Ubuntu/10.04 (lucid) Firefox/3.6.3

Follow-up Comment #2, bug #29464 (project grub):

After adding several debugging fprintf statements the reason for this problem
seems to become clear. grub-setup calls grub_disk_open() which in turn calls
an open() function via an array of pointers. Here's the source-code peppered
with my debug print statements from kern/disk.c::grub_disk_open():

  grub_dprintf("disk", "grub_disk_dev_list %sn", raw);
  for (dev = grub_disk_dev_list; dev; dev = dev->next)
      grub_dprintf("disk", "dev->open (%p)n", (void *) dev->open);
      if ((dev->open) (raw, disk) == GRUB_ERR_NONE) {
       grub_dprintf("disk", "%sn", "GRUB_ERR_NONE");
      else if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE) {
 grub_errno = GRUB_ERR_NONE;
       grub_dprintf("disk", "%sn", "GRUB_ERR_UNKNOWN_DEVICE");
 goto fail;

Running grub-setup with extra debug info output to stdout:

sudo ./grub-setup -vvv '(hd0)' >grub-setup.log 2>grub-setup.stderr.log


grub-setup: opening destination 'hd0'
/home/all/SourceCode/grub/grub2-1.98/kern/disk.c:245: Opening `hd0'...
/home/all/SourceCode/grub/grub2-1.98/kern/disk.c:268: grub_disk_dev_list hd0
/home/all/SourceCode/grub/grub2-1.98/kern/disk.c:271: dev->open (0x80754f7)
/home/all/SourceCode/grub/grub2-1.98/kern/disk.c:271: dev->open (0x80740b0)
/home/all/SourceCode/grub/grub2-1.98/kern/disk.c:271: dev->open (0x804b6d6)
i=0 hd0
find_grub_drive(hd0) returned 0
setting disk->id=0
/home/all/SourceCode/grub/grub2-1.98/kern/disk.c:273: GRUB_ERR_NONE
grub-setup: testing: disk->id = 0

So find_grub_drive() is the function returning 0.

That function simply iterates through an array called 'map' that contains the
contents of /boot/grub/device.map. The first entry in 'map' (map[0])
represents the first line in the device.map file.

>From that it is now possible to see why the id is set to 0 and therefore why
the buggy BIOS work-around never gets applied to the boot sector.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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