From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] Workaround for usb boot failure on some mainboards
Date: Thu, 23 Sep 2010 01:08:22 +0200 [thread overview]
Message-ID: <4C9A8C66.7050003@gmail.com> (raw)
In-Reply-To: <4C9A249E.2060100@miray.de>
[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]
On 09/22/2010 05:45 PM, Thomas Frauendorfer | Miray Software wrote:
> Hi,
>
> On some boards, like the AsRock K7S41GX, Grub fails to boot from
> superfloppy fat32 formated usb sticks.
>
This config isn't recommended in first place. You should really create
partitions on the USB disk and leave some space between MBR and
partition, then there will be no problem with this on-the-fly
replacement. As an alternative you can use grub-mkrescue.
As for your patch it may break in case when only backup is damaged. The
correct algorithm would be sth like
if (!consistent (bpb))
{
err = read_backup_bpb (bpb);
if (err)
return err;
if (!consistent (bpb))
return grub_error (...);
}
Function consistent would contain all current checks (minus perhaps
"FAT" string checking) plus the checks that e.g. number of fat entries
and fat sectors is consistent.
> The reason for the boot failure is that the bios of the mentioned
> board replaces byte 0x24 of the bpb with the value 0x00 when it's
> read through the bios function.
> In fat16 this byte contains the Disc unit number, so this causes no
> real harm there.
> In fat32 this byte is part of the sectors per FAT information, so by
> modifying this value the bios makes Grub unable to read the fat system.
>
> The attached workaround reads the backup bpb information on fat32
> filesystems and uses the sectors per fat information stored there.
>
> PS: I'm sorry if this mail is a duplicate, but I sent it before but I
> wasn't subscribed so it might have been blocked/dropped before
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
next prev parent reply other threads:[~2010-09-22 23:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-22 15:45 [PATCH] Workaround for usb boot failure on some mainboards Thomas Frauendorfer | Miray Software
2010-09-22 16:14 ` Lennart Sorensen
2010-09-22 16:52 ` Thomas Frauendorfer
2010-09-22 17:45 ` Lennart Sorensen
2010-09-22 19:54 ` Thomas Frauendorfer
2010-09-22 23:08 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-22 9:07 Thomas Frauendorfer | Miray Software
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=4C9A8C66.7050003@gmail.com \
--to=phcoder@gmail.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.