Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Nzd21-0000Jw-Kr for mharc-grub-devel@gnu.org; Wed, 07 Apr 2010 17:43:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nzd20-0000Jr-Ev for grub-devel@gnu.org; Wed, 07 Apr 2010 17:43:28 -0400 Received: from [140.186.70.92] (port=59173 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nzd1y-0000IV-9V for grub-devel@gnu.org; Wed, 07 Apr 2010 17:43:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nzd1w-0006lC-R6 for grub-devel@gnu.org; Wed, 07 Apr 2010 17:43:26 -0400 Received: from phwoarrr.net ([109.74.197.121]:42602 helo=tjworld.net) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nzd1w-0006l0-Mc for grub-devel@gnu.org; Wed, 07 Apr 2010 17:43:24 -0400 Received: from [10.254.252.6] (hephaestion.lan.tjworld.net [10.254.252.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tjworld.net (Postfix) with ESMTPSA id 2BA6F1813A for ; Wed, 7 Apr 2010 22:43:23 +0100 (BST) From: TJ To: grub-devel@gnu.org Content-Type: text/plain; charset="UTF-8" Organization: TJworld Date: Wed, 07 Apr 2010 22:43:22 +0100 Message-ID: <1270676602.16363.5.camel@hephaestion> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [bug #29464] util/i386/pc/grub-setup: fails to write Buggy BIOS boot-sector drive-number detection in boot.img X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2010 21:43:28 -0000 I wonder if someone that is familiar with the setting of disk->id for pc could take a look at this bug. Although I think I've found the reason for the bug I'm not clear on what the correct solution would be. In summary: disk->id has not been set by the time util/i386/pc/grub-setup.c does the buggy BIOS test: /* If DEST_DRIVE is a hard disk, enable the workaround, which is for buggy BIOSes which don't pass boot drive correctly. Instead, they pass 0x00 or 0x01 even when booted from 0x80. */ if (dest_dev->disk->id & 0x80) /* Replace the jmp (2 bytes) with double nop's. */ *boot_drive_check = 0x9090; and as a result the system fails to boot on PCs where the BIOS provides the wrong drive number. I'm not sure quite what is missing - I see several functions that do set disk->id but cannot be sure which, if any, would be an appropriate call from grub-setup.c or one of the function calls it relies upon.