AHCI DRIVER FOR OWN OS
===

I speak english a litle, but i need to your help. I have been already programming a litle ahci driver for two weeks. I have read the article from http://wiki.osdev.org/AHCI and intel specification Serial ATA Advanced Host Controller Interface (AHCI) 1.3. There is an example, which shows how to read sectors via DMA mode (osdev.org). I have done this operation (**ATA_CMD_READ_DMA 0xC8**) successfully, but when i tried to write sectors (**ATA_CMD_WRITE_DMA 0xCA**) to the device, the HBA set the error

Offset 30h: PxSERR – Port x Serial ATA Error - Handshake Error

(this is decoding from intel AHCI specification). I don't understand why it is happened... Please, help me... 

In addition, I have tried to issue the command **IDENTIFY 0xEC**, but not successfully...