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.
i'm writing a floppy driver.but when i execute reset command and read value in data register
it returns 128 which i think is not correct.
please tell me what's causing problem.
whats the correct value that i should recieve;
here is output of my code
interrupt recieved
controller is ready to accept commands
status1=128
The reset "command" isnt really a command so much... there is no command/result phase. If you reset the controller by not maintaining the NOT-RESET bit, then the controller resets. Because it is not a command and has no result, the status register will not contain any meaningful information about the reset, only the default values loaded when the controller initializes (which wil probably say something about abormal termination or something). Also, there is no real need to see if the reset works, since it is a hard reset, the controller will reset no matter what.
There isn't anything at that port address, which is why it's safe to use as a delay. The delay happens because, like all port I/O, the processor must wait for the motherboard hardware to finish the IN operation before continuing. One cycle on, say, the PCI bus might take fifty or a hundred CPU cycles.
However, there are more reliable methods for introducing delays. For short, accurate delays, I would poll on the real-time clock.