1 |
/* |
/* |
2 |
* GRUB -- GRand Unified Bootloader |
* GRUB -- GRand Unified Bootloader |
3 |
* Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
* Copyright (C) 2000,2001,2005 Free Software Foundation, Inc. |
4 |
* |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
149 |
FAT_SUPER->clust_eof_marker = 0xff8; |
FAT_SUPER->clust_eof_marker = 0xff8; |
150 |
} |
} |
151 |
} |
} |
152 |
|
|
|
|
|
153 |
/* Now do some sanity checks */ |
/* Now do some sanity checks */ |
154 |
|
|
155 |
if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits) |
if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits) |
183 |
magic = 0x0f00; |
magic = 0x0f00; |
184 |
} |
} |
185 |
|
|
186 |
if (first_fat != (magic | bpb.media)) |
/* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media |
187 |
|
descriptor, even if it is a so-called superfloppy (e.g. an USB key). |
188 |
|
The check may be too strict for this kind of stupid BIOSes, as |
189 |
|
they overwrite the media descriptor. */ |
190 |
|
if ((first_fat | 0x8) != (magic | bpb.media | 0x8)) |
191 |
return 0; |
return 0; |
192 |
|
|
193 |
FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE; |
FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE; |