+2003-09-05 KB Sriram <mail_kb@yahoo.com>
+
+ * stage2/fsys_fat.c: Fix missdetection of ext2fs as fatfs.
+
2003-09-05 Robert Millan <robertmh@gnu.org>
* docs/menu.lst (GNU/Linux): Add commented initrd command, which is
fat_mount (void)
{
struct fat_bpb bpb;
+ __u32 magic, first_fat;
/* Check partition type for harddisk */
if (((current_drive & 0x80) || (current_slice != 0))
> FAT_SUPER->fat_length))
return 0;
+ /* kbs: Media check on first FAT entry [ported from PUPA] */
+
+ if (!devread(FAT_SUPER->fat_offset, 0,
+ sizeof(first_fat), (char *)&first_fat))
+ return 0;
+
+ if (FAT_SUPER->fat_size == 8)
+ {
+ first_fat &= 0x0fffffff;
+ magic = 0x0fffff00;
+ }
+ else if (FAT_SUPER->fat_size == 4)
+ {
+ first_fat &= 0x0000ffff;
+ magic = 0xff00;
+ }
+ else
+ {
+ first_fat &= 0x00000fff;
+ magic = 0x0f00;
+ }
+
+ if (first_fat != (magic | bpb.media))
+ return 0;
+
FAT_SUPER->cached_fat = - 2 * FAT_CACHE_SIZE;
return 1;
}