Floppy driver problems

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
deathangel
Member
Member
Posts: 31
Joined: Thu Apr 14, 2005 11:00 pm
Location: Planet Earth
Contact:

Floppy driver problems

Post 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?
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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
Lon
Posts: 4
Joined: Fri Oct 20, 2006 8:14 am

Post 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
User avatar
ces_mohab
Member
Member
Posts: 77
Joined: Wed Oct 18, 2006 3:08 am

Post 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:
deathangel
Member
Member
Posts: 31
Joined: Thu Apr 14, 2005 11:00 pm
Location: Planet Earth
Contact:

Post 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!!! ;)
Post Reply