I'm trying to start writing FAT12 implementation,any way I wrote a FDC driver
and it works fine on bochs and on real pc and I can write/read to 1.44 floppy using CHS,
but when I tried to write/read using LBA I got two "getbyte time out",and
after that got my data,and all this happen on real pc,but on bochs it
worked fine.
here's my code:
Code: Select all
void floppy_read(word lba)
{
word track = (lba /(18 * 2 ) );
word head = (lba / 18) % 2;
word sector= (lba % 18) + 1;
track=(track & 0xFFF);
head =(head & 0xFFF);
sector=(sector & 0xFFF);
f_read(head,track,sector);
delay(500);
}
void floppy_write(word lba)
{
word track = (lba /(18 * 2 ) );
word head = (lba / 18) % 2;
word sector= (lba % 18) + 1;
track=(track & 0xFFF);
head =(head & 0XFFF);
sector=(sector & 0xFFF);
f_write(head,track,sector);
delay(500);
}