[Top][All Lists]

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

Re: grub-probe fails to find PC partition due to Apple disklabel

From: Pavel Roskin
Subject: Re: grub-probe fails to find PC partition due to Apple disklabel
Date: Mon, 14 Apr 2008 13:20:49 -0400

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.

Pavel Roskin

reply via email to

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