All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: grub-probe fails to find PC partition due to Apple disklabel
Date: Mon, 14 Apr 2008 13:20:49 -0400	[thread overview]
Message-ID: <1208193649.4027.19.camel@dv> (raw)
In-Reply-To: <200804141021.49995.Chris.Knadle@coredump.us>

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.

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2008-04-14 17:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-13 21:34 grub-probe fails to find PC partition due to Apple disklabel Chris Knadle
2008-04-14 12:07 ` Robert Millan
2008-04-14 14:21   ` Chris Knadle
2008-04-14 17:20     ` Pavel Roskin [this message]
2008-04-15 13:15       ` Robert Millan
2008-04-15 15:17         ` Pavel Roskin
2008-04-15 14:06       ` Chris Knadle
2008-07-23  2:53       ` Chris Knadle
2008-07-23  3:48         ` Pavel Roskin
2008-07-23 19:10           ` Chris Knadle
2008-07-23 20:47             ` Chris Knadle
2008-07-25 20:27               ` Robert Millan
2008-07-25 23:09                 ` Chris Knadle
2008-07-27 19:53                   ` Felix Zielcke
2008-07-27 20:33                     ` Felix Zielcke
2008-07-28 18:41                     ` Chris Knadle
2008-07-28 18:55                       ` Felix Zielcke
2008-07-28 19:25                         ` Chris Knadle
2008-07-28 21:20                           ` Robert Millan
2008-07-28 22:38                             ` Robert Millan
2008-07-29  2:25                             ` Chris Knadle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1208193649.4027.19.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.