HDD answer with 0xFF

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
User avatar
noro
Posts: 2
Joined: Tue Nov 30, 2010 2:42 am
Location: Germany

HDD answer with 0xFF

Post by noro »

Hi,

I am new here and I must tell that I am very impressed to see how many smart guys are here and writting
high quality posts! =D>. Congratulations also on moderators and the forum-creators!

Briefly, I'm writting a kernel (pmode 32bit, GRUB boot-loader) and I got a problem when writting a HDD-driver (PIO-Mode)

So, when I send the IDENTIFY DEVICE, some HDD answered with 0xFF and these cannot be identified.
In BIOS the SATA are emulated as IDE. On Bochs, Qemu, VirtualBox works. Work also on some PC (Intel).


What cann be? Can anyone help me?

Cheers,

Noro
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: HDD answer with 0xFF

Post by bewing »

0xff is a completely illegal status. But it's hard to tell exactly where the illegal thing is happening. If code works in an emulator (and on some PCs), but fails on other real hardware, then the problem is almost always timing. Try adding 400ns delays in many places. If you already have 400ns delays, try making them 1 or 2 microseconds instead. Make sure that you set all the IO ports (except DRIVE_SEL and CMD) to 0 before you do your identify. Make sure your test for STATUS=BSY has no bugs.
User avatar
noro
Posts: 2
Joined: Tue Nov 30, 2010 2:42 am
Location: Germany

HDD answer with 0xFF - Solution

Post by noro »

Hello,

Thank you very much for your rush answer. I found in BIOS an Option, Main->IDE Configuration->SATA Configuration. I turned this setting into 'Compatible' from
'Enhanced/Configure SATA as IDE' and... it works. Now I can see the serial of HDD, firmware, etc.

The problem PC has an ASUS P5B Motherboard with AMI BIOS and Intel ICH8, JMicron JMB363 PATA/SATA controllers.


Thank you again!

Cheers,

Noro
Post Reply