Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jll1C-0002dH-DM for mharc-grub-devel@gnu.org; Tue, 15 Apr 2008 09:16:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jll19-0002aS-RQ for grub-devel@gnu.org; Tue, 15 Apr 2008 09:16:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jll18-0002Z9-NS for grub-devel@gnu.org; Tue, 15 Apr 2008 09:16:11 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jll18-0002Yw-FP for grub-devel@gnu.org; Tue, 15 Apr 2008 09:16:10 -0400 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jll17-0000mc-V3 for grub-devel@gnu.org; Tue, 15 Apr 2008 09:16:10 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Jll15-0004lO-3R for grub-devel@gnu.org; Tue, 15 Apr 2008 15:16:07 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Jll0l-0005g4-CY for grub-devel@gnu.org; Tue, 15 Apr 2008 15:15:47 +0200 Date: Tue, 15 Apr 2008 15:15:47 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080415131547.GB21548@thorin> References: <200804131734.50447.Chris.Knadle@coredump.us> <20080414120742.GB24443@thorin> <200804141021.49995.Chris.Knadle@coredump.us> <1208193649.4027.19.camel@dv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1208193649.4027.19.camel@dv> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: grub-probe fails to find PC partition due to Apple disklabel X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2008 13:16:12 -0000 On Mon, Apr 14, 2008 at 01:20:49PM -0400, Pavel Roskin wrote: > On Mon, 2008-04-14 at 10:21 -0400, Chris Knadle wrote: > > > Instead of probing for partmaps in a particular order, it seems that > > solving for this might best be done by probing for all of the possible > > partmaps for the architecture and trying to figure out which one best fits. > > grub2's grub-probe is clearly already doing this; _however_, somehow the PC > > partmap probe is subtly different depending on whether partmap/apple.c is > > included in the search. > > Apple and PC partition maps can coexist. The place occupied by the PC > partition and the PC magic is not used by the Apple partition. > > The way to differentiate them would be to check at the first sector. If > it starts with 0x45 0x52, then it's an Apple partition. A PC partition > would have an executable entry there. The Apple magic would decode to: > > inc %bp > push %dx > > It's highly unlikely to be used in the first two instructions of the PC > boot code. > > partmap/apple.c starts reading with the second sector (unsigned pos = > GRUB_DISK_SECTOR_SIZE). Perhaps it should read the first sector to > check the magic. Are you sure checking for the code part would be a good idea? One could be using i8088 bootstrap code in an Apple first sector, or vice-versa. Btw, how does Linux handle this? Maybe this issue has been beaten to death already. -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)