Disk I/O (ATA IDE) problem
Posted: Wed Jun 15, 2011 12:00 am
Hi guys,
I'm using bochs and have been trying my hands on writing a interrupt based disk I/O transfer mechanism. I'm really stuck and can't figure out what's happening and more importantly why its happening. So here's what i did and my problems and questions
Help me out guys plz...
I'm using bochs and have been trying my hands on writing a interrupt based disk I/O transfer mechanism. I'm really stuck and can't figure out what's happening and more importantly why its happening. So here's what i did and my problems and questions
Currently i'm not using any DMA. So What i've right now is that the IDE drive will interrupt my kernel after command and my ISR will then read data using PIO. I will move to DMA but i must first get this working.
- The first thing i was able to do IDENTIFY and my ISR got called and I was able to read data. OK, now at the end of ISR i read from port 0x1f7 because I read on the ATA PIO page on this website that you gotta read it to clear the INTR signal from the device. This reports that Status register has value of 0x50 which means that DRDY is set so i can issue other commands correct?
- Second, I try to do READ SECTOR(0x20) and while checking the status register in this function i get the value as 0x00. So that means Drive isn't BUSY but drive isn't READY too. When can this happen?
- Now I remove the IDENTIFY COMMAND routine and only use READ SECTOR function. This time it works. SO i'm guessing there's something about IDENTIFY which i don't know yet.
Help me out guys plz...