mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-22 07:12:39 +00:00
2005-03-15 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/fsys_fat.c (fat_mount): Ignore the 3rd bit of a media descriptor, because some BIOSes overwrite this value, according to the storage mode (e.g. USB Floppy or USB HDD).
This commit is contained in:
1 parent
257fff664f
commit
f307cbf7c6
4 files changed
+15
-6
No files matched your search
+7
-4
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2000,2001,2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -149,8 +149,7 @@ fat_mount (void)
|
||||
FAT_SUPER->clust_eof_marker = 0xff8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Now do some sanity checks */
|
||||
|
||||
if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits)
|
||||
@@ -184,7 +183,11 @@ fat_mount (void)
|
||||
magic = 0x0f00;
|
||||
}
|
||||
|
||||
if (first_fat != (magic | bpb.media))
|
||||
/* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media
|
||||
descriptor, even if it is a so-called superfloppy (e.g. an USB key).
|
||||
The check may be too strict for this kind of stupid BIOSes, as
|
||||
they overwrite the media descriptor. */
|
||||
if ((first_fat | 0x8) != (magic | bpb.media | 0x8))
|
||||
return 0;
|
||||
|
||||
FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE;
|
||||
|
||||
Reference in new issue
Block a user