From: ehem+grub@m5p.com
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Two Small Patches (x86 VolId & Sun Label Checking)
Date: Sun, 26 Dec 2010 13:15:51 -0800 (PST) [thread overview]
Message-ID: <201012262115.oBQLFpQL072419@m5p.com> (raw)
In-Reply-To: <4D171BBC.9000506@gmail.com>
>From: Vladimir '?-coder/phcoder' Serbinenko <phcoder@gmail.com>
> On 12/26/2010 06:29 AM, ehem+grub@m5p.com wrote:
> > I will in fact be implementing breaking detection functions into distinct
> > functions uniformly,
> I'm not fond of "let's change it just because we can". There are much
> more real tasks on the project. Come to #grub and I'm sure will find
> something for you.
> > because there is a deeper issue lurking here. Looks
> > to be pure luck no one ran into an unpleasant bug lurking in the existing
> > design.
> >
> >
> Please show me the real problem then.
Quite simple, the disk slice scheme detection routines vary in the
quality of their detection. In particular, the MSDOS-style detection is
*extremely* brittle. The only even mildly distinguishing characteristic
it finds is ensuring only the msb of the boot-flag byte is set. The other
thing it looks for is the 0xAA55 signature, but that is merely a signal
to PC-BIOSes that the disk is bootable; as such *any* bootable disk for a
IBM-PC will have that signature, whether or not it is actually using the
MSDOS-style header. A 1 in 65536 chance of a false positive is bad.
Whereas most of the other schemes have actual magic numbers for the
disk-slice scheme, that is *not* merely a flag for whether it is okay to
boot from or not (plus checksums, which push them to 1 in 2^32 chance of
incorrect detection).
Take a look at the attached file, it is ment as a header for a 512KB
image (`dd if=/dev/zero count=1023 2>/dev/null | cat sample /dev/stdin >
full_sample`). The only reason it will be correctly detected as a
SunOS-style disk label is that routine gets tried first, the MSDOS-style
detection would take it as valid.
I do have a specific goal in mind. Perhaps oddball, but a definite goal.
--
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/)
\BS ( | EHeM@gremlin.m5p.com PGP F6B23DE0 | ) /
\_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/
2477\___\_|_/DC21 03A0 5D61 985B <-PGP-> F2BE 6526 ABD2 F6B2\_|_/___/3DE0
next prev parent reply other threads:[~2010-12-26 21:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-17 5:19 Two Small Patches (x86 VolId & Sun Label Checking) ehem+grub
2010-12-25 17:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-12-26 5:29 ` ehem+grub
2010-12-26 10:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-12-26 21:15 ` ehem+grub [this message]
2010-12-26 21:17 ` ehem+grub
2010-12-26 21:55 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-12-29 6:25 ` ehem+grub
2010-12-29 8:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-12-30 7:11 ` ehem+grub
2010-12-29 19:54 ` Brendan Trotter
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=201012262115.oBQLFpQL072419@m5p.com \
--to=ehem+grub@m5p.com \
--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.