FDC read problem on real hardware.
Posted: Mon Jul 07, 2014 1:12 pm
Hi all,
I've recently added FDC and FAT12 support to my OS.
The problem I'm facing is reading floppy on real hardware.
My routine for reading is quite simple:
1) Turn motors on
2) Wait ~400ms
3) Search for certain sector
4) Check if success
5) Yes? -> turn motor off and return pointer to data
6) No? -> GOTO 3
Everything works under bochs, but on real hardware it looks like floppy has some problems detecting sectors.
Generally when I want to have good read I have to first "jump" to distant sector (~250 from what I want to read) and then come back.
Doing this I ALWAYS get good read. Any consecutive read is also good but only if I decide to read the same sector.
If I decide to read next one, the floppy sometimes can't find sector (after 10th try routine returns with error - "Can't find sector") or it looks like it didn't transfer data.
Could this be caused by old hardware?
(Probably not because under linux I also have some errors reading floppy but in the end it always manages to succeed and everything works.
On the other hand from time to time it shows I/O error or /dev/fd0 not found but usually on second try it finds it).
I've recently added FDC and FAT12 support to my OS.
The problem I'm facing is reading floppy on real hardware.
My routine for reading is quite simple:
1) Turn motors on
2) Wait ~400ms
3) Search for certain sector
4) Check if success
5) Yes? -> turn motor off and return pointer to data
6) No? -> GOTO 3
Everything works under bochs, but on real hardware it looks like floppy has some problems detecting sectors.
Generally when I want to have good read I have to first "jump" to distant sector (~250 from what I want to read) and then come back.
Doing this I ALWAYS get good read. Any consecutive read is also good but only if I decide to read the same sector.
If I decide to read next one, the floppy sometimes can't find sector (after 10th try routine returns with error - "Can't find sector") or it looks like it didn't transfer data.
Could this be caused by old hardware?
(Probably not because under linux I also have some errors reading floppy but in the end it always manages to succeed and everything works.
On the other hand from time to time it shows I/O error or /dev/fd0 not found but usually on second try it finds it).