Page 1 of 1
Floppy Driver ?
Posted: Sat Mar 08, 2003 7:38 am
by amirsadig
sorry that I repeat this post, because my floppy disk driver does not work.
when I try to read a sector, I send all requested data ( command, track, head, ...) but after that I floppy does not send Interrupt, so that we know that the command has been done and I have read the MSR register, it has the value 16, that mean "command busy". you could see I have a wrong timeout counter. but that is not the problem, because when I try to read the floppy as 1.68MB it return from command with an error reading sector and I have test it with big timeout and with loop util the floppy send interrupt. but it still not work.
have an idea where the problem could be?
note :
seek and recalibrate work fine " bit 7 in MSR is one "
Re:Floppy Driver ?
Posted: Sat Mar 08, 2003 12:50 pm
by Slasher
Before and read or write or even using the controller, you need to set the specification. ie head load, head unload, etc. I think its command 0x03, read the docs. there is a disk parameter table in bios that specifies these timing values. I think ralf's int docs can help.
Re:Floppy Driver ?
Posted: Sat Mar 08, 2003 5:16 pm
by amirsadig
I have set those value and I mentioned the seek command work, only read and write does not work!!!!
Re:Floppy Driver ?
Posted: Sat Mar 08, 2003 6:46 pm
by amirsadig
another note:
after sending the last command byte ( for reading, DTL is 0xff) the controller run in execution phase and thus it set bit 4 with 1 - command busy in MSR- . this bit will not change until the command finished and result phase also finished, but nothing happend, it still working in the command phase.
That what I do not understand.
I ask me, is there no one accept Therx has implement a floppy disk driver?? ???
Re:Floppy Driver ?
Posted: Sat Mar 08, 2003 7:19 pm
by Tim
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 5:01 am
by amirsadig
I have read it and it is good organized.
your setting is exactly like mine, therefor I don't understand why it does not work.
the controller go in command phase but it is not come back. note that I have deactivate DMA, so that I can receive the interrupt after FIFO is full, but nothing happend :-[, it still in command busy ( MSR = 16)
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 5:11 am
by Therx
I don't recommend not using DMA. This is similar to why you don't use polling for the keyboard driver. Speed.
As to why your code doesn't work. The code you sent me had the line to program the Data Rate commented out. Why?
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 5:14 am
by amirsadig
I have disamble DMA only for test purpose, so that I receive interrupt very soon as FIFO full is.
Data rate I have uncomment it, because DSR was not supported by buchs, thus I use CCR instead, but it still not working.
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 12:20 pm
by Slasher
Some Floppy controllers do not work in NON-DMA mode. Programming DMA is not difficult, try it.
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 2:09 pm
by amirsadig
I have programed it before, but with DMA or without it, it does not work!
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 2:28 pm
by Slasher
We can't help you until you post every line of code that related to your floppy driver. Until then, We are all guessing in the DARK.
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 3:25 pm
by amirsadig
no problem,
here is the first file
[attachment deleted by admin]
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 3:26 pm
by amirsadig
second one
[attachment deleted by admin]
Re:Floppy Driver ?
Posted: Sun Mar 09, 2003 3:27 pm
by amirsadig
third one,
[attachment deleted by admin]
Re:Floppy Driver ?
Posted: Mon Mar 10, 2003 3:26 am
by amirsadig
thanks for all who has helped me to solve this problem.
I have change the Fabian Code so that it could compiled
under linux and with my kernel.
and finaly it work.