IDE programming bugs

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
Tyler Durden
Posts: 4
Joined: Fri Jan 14, 2005 12:00 am
Location: Odessa
Contact:

IDE programming bugs

Post by Tyler Durden »

Hi, i'm writing an IDE subsystem (PIO with interrupts) to my OS... It works perfectly under MSVirtual PC, but when i started to test it on real hardware, i found some strange "bugs" :( E.G. When i set DEV bit to 1 (selecting "1" device) with only "0" device present on the channel, DRQ and BSY bits is seted like that ("1") device is actually present (the "0" device sets them instead). Then interrupt is called (with cleared error flag). Ok, i'm just test the sector count port, and if there is no sectors processed (sc port remains the same as i set it during command send operations) i send an error to the user. But, in some cases (i don't know what this "cases" actually are) during read/write operations with claster (32 sectors in my case) the device start to send me int's with sectors count port decrementing by 1 each time. I think it process' sector by sector each time and just send "op. complete" message to user when all sectors in request are "processed" but... then another one int called... WTF ?! Error bit haven't set in any of this cases... Someone've got that problems ? Help me pls. Thanks.

P.S. Sorry of my bad english - I'm from Ukraine.
Last edited by Tyler Durden on Tue Sep 27, 2005 11:00 pm, edited 1 time in total.
<a href="http://www.tylerdurden.net.ru/"><img src="http://www.tylerdurden.net.ru/images/banner.gif"></a>
Tyler Durden
Posts: 4
Joined: Fri Jan 14, 2005 12:00 am
Location: Odessa
Contact:

Re: IDE programming bugs

Post by Tyler Durden »

The problem is in interrupts... If ide ints masked, and i work just with ide flags, it works perfectly... But when i unmask ide ints (which is just with EOI sending to APIC and IDE) the drive stops to clear BSY flag (after the execution of the command)...
<a href="http://www.tylerdurden.net.ru/"><img src="http://www.tylerdurden.net.ru/images/banner.gif"></a>
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re: IDE programming bugs

Post by kataklinger »

You must read ATA status register to re-enable iterrupts.
Post Reply