9bootfat: only check for fat at block 0 on floppy drives (thanks aap)

smart boot manager has a "FAT" signature in its mbr causing
9bootfat to "detect" it as a fat filesystem and then fails
to find plan9.ini.

there shouldnt be a fat filesystem on harddrives at block 0, only
on floppy drives. but some bioses use floppy drive numbers
for usb harddrives so still check for a partition table.

thanks aap for debugging this.
This commit is contained in:
cinap_lenrek 2013-09-23 21:12:41 +02:00
parent b4cdfc6c55
commit 365fd745d6

View file

@ -339,7 +339,7 @@ findfat(Fat *fat, int drive, ulong xbase, ulong lba)
return -1;
if(buf[0x1fe] != 0x55 || buf[0x1ff] != 0xAA)
return -1;
if(lba == 0){
if(lba == 0 && (drive & 0x80) == 0){ /* floppy */
fat->drive = drive;
fat->partlba = 0;
if(!conffat(fat, buf))