Ata Trusted Commands in Linux

How to Read particular sector of a disk using ATA command?

Thankyou everyone for your help. I got the solution. A little bit thing that i have not noticed. That is Ata Flags. I have to send multiple flags. Eg.

pATAData->ataFlags = ATA_FLAGS_48BIT_COMMAND | ATA_FLAGS_DRDY_REQUIRED | ATA_FLAGS_DATA_IN

and also send the ATA command Opcode in PreviousTaskFile[6] also.
And the few things to be noticed is
What is the block size of the HDD? It could be more than 512 bytes, especially if it is a large disk like(1TB...4TB). As such, you'll need to adjust the sizes accordingly. You can see what the size is by doing the EC identify ATA command, and then look at the resulting data structure.

48bit and 28bit ATA commands with ioctl

During the research it was found that every controller has its own specificities depending on the driver. That is why implementation of ATA PASS THROUGH commands are so difficult work.

Through reading the Linux driver and checking what structures are sent with ioctl it is possible to figure out if it is 28 or 48 bit command.

Moreover, it is also quite important to check how new is the software, because 48-bit Logical Block Addressing (LBA) was introduced in 2006 in ATA-6 standard. Most probably nowadays all the controllers supports 48-bit command set, but still you should check if the controller supports it.

So, the answer to this question strongly depends on the using controller.



Related Topics



Leave a reply



Submit