Page 1 of 1

IDE programming bugs

Posted: Tue Sep 27, 2005 11:00 pm
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.

Re: IDE programming bugs

Posted: Wed Oct 05, 2005 11:00 pm
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)...

Re: IDE programming bugs

Posted: Fri Nov 04, 2005 12:00 am
by kataklinger
You must read ATA status register to re-enable iterrupts.