programming floppy
programming floppy
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...
Re:programming floppy
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.
I recommend you get hold of the sources to Fabian Nunez' floppy driver (via http://www.execpc.com/~geezer/os/) and read through it.
Re:programming floppy
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?
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?
Re:programming floppy
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).
Re:programming floppy
i have heard that on newer PC's that the DMA is not present so i dont want to rely on it....
Re:programming floppy
Its the other way around. Everyone uses DMA for the floppy drive, so some newer drives have stopped supporting direct port I/O.slacker wrote: i have heard that on newer PC's that the DMA is not present so i dont want to rely on it....
You wouldn't want to use port I/O anyway, you'd have to do polling which would freeze up your kernel.