programming floppy

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
slacker

programming floppy

Post by slacker »

i have read every piece of documentation available on the internet about the floppy controller and still dont understand how it works. what port is actually used to write data to and from it since i dont want to program DMA. also if anyone knows or has any source that is well documented i would appreciate it...
Tim

Re:programming floppy

Post by Tim »

You mean to say that no document on the Internet tells you what port to write to? I don't think you've looked at every document.

I recommend you get hold of the sources to Fabian Nunez' floppy driver (via http://www.execpc.com/~geezer/os/) and read through it.
slacker

Re:programming floppy

Post by slacker »

ok let me see if this is right...

by writing to port 0x3f5 you gain access to more registers like the ones the allow you to write to disk, read from disk etc?

so if you wanted to write a sector:

portout(0x3f5, 0x0x5)

//0x05 is function to write sector

so then you can set up the write register
and output the settings for that register to 0x3f5.

then finally you can send that byte to 0x3f5 and it will write to disk...

is this right?
Jamethiel

Re:programming floppy

Post by Jamethiel »

Fair warning: Some of us have discovered the hard way that some PCs don't work right when you try and run the floppy controller in non-DMA mode. You may have to set up DMA after all (which isn't hard, really).
slacker

Re:programming floppy

Post by slacker »

i have heard that on newer PC's that the DMA is not present so i dont want to rely on it....
Nairou

Re:programming floppy

Post by Nairou »

slacker wrote: i have heard that on newer PC's that the DMA is not present so i dont want to rely on it....
Its the other way around. Everyone uses DMA for the floppy drive, so some newer drives have stopped supporting direct port I/O.

You wouldn't want to use port I/O anyway, you'd have to do polling which would freeze up your kernel.
Post Reply