grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Workaround for usb boot failure on some mainboards


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] Workaround for usb boot failure on some mainboards
Date: Thu, 23 Sep 2010 01:08:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100805 Icedove/3.0.6

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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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