Floppy Driver ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
amirsadig

Floppy Driver ?

Post 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 "
Slasher

Re:Floppy Driver ?

Post 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.
amirsadig

Re:Floppy Driver ?

Post by amirsadig »

I have set those value and I mentioned the seek command work, only read and write does not work!!!!
amirsadig

Re:Floppy Driver ?

Post 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?? ???
amirsadig

Re:Floppy Driver ?

Post 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)
Therx

Re:Floppy Driver ?

Post 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?
amirsadig

Re:Floppy Driver ?

Post 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.
Slasher

Re:Floppy Driver ?

Post by Slasher »

Some Floppy controllers do not work in NON-DMA mode. Programming DMA is not difficult, try it.
amirsadig

Re:Floppy Driver ?

Post by amirsadig »

I have programed it before, but with DMA or without it, it does not work!
Slasher

Re:Floppy Driver ?

Post 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.
amirsadig

Re:Floppy Driver ?

Post by amirsadig »

no problem,
here is the first file

[attachment deleted by admin]
amirsadig

Re:Floppy Driver ?

Post by amirsadig »

second one

[attachment deleted by admin]
amirsadig

Re:Floppy Driver ?

Post by amirsadig »

third one,


[attachment deleted by admin]
amirsadig

Re:Floppy Driver ?

Post 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.
Post Reply