Page 1 of 1

Floppy driver problems

Posted: Tue Oct 24, 2006 10:00 am
by deathangel
Okay, I guess I probably could start posting here again, no reason not to. I am writing a floppy driver for my OS, and I'm having problems with the interrupts. My OS handles interrupt perfectly, I have never had problems with interrupts in any other part of it.

When I start writing my floppy driver, I follow examples of what other people have done, and do basically the exact same thing as they do (seeing as there's limited ways to do the same thing). I get an interrupt signaled when I reset the floppy disk, but never at any other time such as a seek command or a recalibrate. Anybody have any clues?

Posted: Tue Oct 24, 2006 11:06 am
by Dex
See my driver in this post and see if you have miss some thing
http://www.osdev.org/phpBB2/viewtopic.php?t=12041

Posted: Wed Oct 25, 2006 10:01 am
by Lon
I had exactly the same problem and it nearly drove me to the point of insanity!!! the solution for me was a really n00b coding error when sending commands to the floppy controller in my sendbyte and getbyte functions.

Before you send a command e.g. seek, recalibrate etc you must make sure the main status register is in the correct mode i.e. RQM and DIO are set to either 1,0 for writing and 1,1 for reading.

Also after you have recieved an interrupt dont forget to send the sense interrupt command to acknowledge it. Check the intel floppy datasheet diagrams at the bottom for more details on doing that 4 times to clear flags for each drive.

Hope that helps,
Lon

Posted: Wed Oct 25, 2006 10:08 am
by ces_mohab
you probably havn't a goot initialization function for floopy. or you may send an EOI to IRQ.
Also after you have recieved an interrupt dont forget to send the sense interrupt command to acknowledge it.
this problem already faced me too.
:roll:

Posted: Wed Oct 25, 2006 2:31 pm
by deathangel
I figured it out. I was testing for when it was ready to read in the wrong way, testing the wrong bits etc... Tnx for all your help!!! ;)