title: AHCI Driver for own OS
body: <p>I have been programming a little AHCI driver for two weeks. I have read <a href="http://wiki.osdev.org/AHCI" rel="nofollow">this article</a> and <a href="http://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/serial-ata-ahci-spec-rev1_1.pdf" rel="nofollow">Intel's Serial ATA Advanced Host Controller Interface (AHCI) 1.3.</a> There is an example, which shows how to read sectors via DMA mode (osdev.org). I have done this operation (<strong>ATA_CMD_READ_DMA 0xC8</strong>) successfully, but when i tried to write sectors (<strong>ATA_CMD_WRITE_DMA 0xCA</strong>) to the device, the HBA set the error</p>
  
  <pre><code>Offset 30h: PxSERR – Port x Serial ATA Error - Handshake Error
  </code></pre>
  
  <p>(this is decoding from Intel AHCI specification). I don't understand why it happened. Please, help me.</p>
  
  <p>In addition, I have tried to issue the command <strong>IDENTIFY 0xEC</strong>, but not successfully...</p>