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.
Does dma_read_transfer contain a value that means "write to memory" instead of read? It's easy to get them mixed up. Also make sure the floppy density is correct. Do you get an error status from the FDC? Do the DMA's address and count registers change?
dma_read_transfer, and others are constant. My "select_driver" function loads it.
Before read function, i read main status register. It is suitable for command. But read function isn't do something. I changed sector count to 50. Nothing changed. Because it doesn't do something with floppy. So i understand that error isn't about dma.
Hello..
What are you doing in prepare_driver() function? I dont know whether your code is correct or not but I see many breakpoints in it. You are not waiting for interrupts.
First of all I would suggest you to use sendData(), getData() functions specified in Intels manuals, instead of normal outport,inport. These functions are nothing but wrapers around out,in with some looping.
Second thing whenever you initialize your floppy driver you have to give a "reset" command to fdc(dont know whether you are doing it or not). Once the initialization is done, every read/write command can follow these sequences:
1. Turn ON the fdc motor (and wait for interrupt).
2. Send Recalibration command (and wait for interrupt).
* if head is allready on desired cylinder then simulate sense_interrupt command.
* else send "seek" command wait for int(do sense_interrupt in ISR).
3. Send Read/Write commands with all arguements(and wait for interrupt).
4. Get status of the operation and copy the content from DMA buffer to desire buffer and turn off the motor.
I am doing this way and my driver is working properly..
Hi. Floppy read error still continuing. I'm writing my processes:
1. Reset Controller (In this, occuring IRQ 6)
-> send 0x00 to DOR (Disable Everythink)
-> send 0x0C to DOR (Enable DMA & Controller)
-> wait some
-> send sense command and read results
-> send recalibarate command
2. Read Disk
-> Turn on Motor
-> Wait some
-> Send commands (Read Command and other bytes)
But after i sent second command for read operation, occuring int 0. I don't understand. What can i do? ???
I think you need to also execute the SPECIFY command with the proper values and set the FDC to the proper data rate for the media density you're expecting. Page 41 of this document gives a flowchart of what you need to do to reset.
I notice in the code you posted you are not waiting for things to happen (either way "scripted waits" or by waiting for the interrupt). Floppy drives can take a long time to do things.
Now i added "wait for interrupt". I still writing codes. But i will send configure command. In this command, there is STR. I found a document about this. But i think document wrong.