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
Sonarqube Does Not Come Back Up After I Enable Postgres and Set Sonar.Properties
Run Random Command in Bash Script
How to Print Multiple Variables Using Printf
Why Is Running Node.Js on Port 80 Might Not Be Safe
Grep If The Next X Lines Doesn't Contain a Specific String
How to Save State When Preempted on a Google Preemptible Instance
Linux Intel 64Bit Assembly Division
What's The Best Way to Move a Directory into Place in a Makefile Install
How to Cross-Compile a Autotools Project for Arm
Reducing Privileges of a Process on Unix or Gnu/Linux
Make Install Error 'Nothing to Be Done'
How Is The Linux Calculating Memfree
How to Create Files with Special Characters in Linux
Removing First 3 Characters of File Names in Linux
Phony Targets for Parallel Execution of Make
Why Are Several Signal Numbers Architecture-Dependent on Linux