Page 1 of 1

SATA problem

Posted: Sun May 31, 2009 6:34 pm
by hesperus
Hi!
I'm trying to write disk driver. I have problem with SATA disk in PCI mode.
I've read BARs #0 and #1 (primary command/control blocks), with values EC01 and E881.
Then I have two approaches:
1. clearing lowest bit (so it gives EC00 and E880)
2. shifting by 3 and 2 (according to this spec http://www.intel.com/Assets/PDF/datasheet/313056.pdf - this is a controller I have - adress of command block starts at 4th bit and control at 3rd bit)-1D80 and 3A20
Then I'm using this values as normal registers (e.g. when normally 0x1F0 goes I put EC00 in first or 1D80 in second method).
The first one hangs identify function (I think the BSY never gets cleared), the second tells me there is no drive on bus (0xFF on every reads on every ports).
Is there any major mistake in my method? And which values should I use? Shifted or just with cleared bit?

PS. This is my first post so hello to everybody and sorry for any language mistakes :)

Re: SATA problem

Posted: Mon Jun 01, 2009 5:54 am
by Combuster
You shouldn't shift BAR addresses. the "missing" bits are zero, and indicate that they are not checked when the processor accesses that address. See PCI