Greetings!
I have a problem reading ATA drive in PIO mode.
After IDENTIFY command, i get correct status (ready to read, not busy, no error), but every byte from 0x1f0 is 0xFF.
This is a minimal code, i wrote for you:
OutPortByte(0x1f6,0xa0); // Drive select
OutPortByte(0x1f7,0xEC); // Identify
InPortByte(0x1f7); // Delay
InPortByte(0x1f7);
InPortByte(0x1f7);
InPortByte(0x1f7);
DirectPrintDecimal(InPortByte(0x1f7)); // prints 90 -- 0b1011010
DirectNewLine();
DirectPrintDecimal(InPortByte(0x1f0)); // prints 255 -- 0xFF
DirectNewLine();
DirectPrintDecimal(InPortByte(0x1f0)); // prints 255 -- 0xFF
DirectNewLine();
DirectPrintDecimal(InPortByte(0x1f0)); // prints 255 -- 0xFF
DirectNewLine();
and so on...
It does the same while read operation too.
Could not find any articles about this problem (or mistake).
Thank you.
P.S. I am coding the driver by osdev wiki topics.
0xFF from ATA Data port
Re: 0xFF from ATA Data port
Is this on real hardware or on an emulator? You need to be reading WORDS (not bytes!) from port 0x1f0 for one thing.
-
- Posts: 8
- Joined: Tue Apr 14, 2009 2:14 am
Re: 0xFF from ATA Data port
Oops! stupid mistake!
Problem solved.
Thank you very much!
I use Bochs emulator with correct configuration.
Problem solved.
Thank you very much!
I use Bochs emulator with correct configuration.