Tools for hard drive diagnostics, repair, and data recovery
Post a reply

How to get the information about HDD

April 19th, 2015, 10:00

I need to get the information about HDD (device id, manufacturer, etc). I can't use WinAPI functions. I installed a driver, that provides direct access to system ports, so I can read a value from ata state register 0x1F7 (channel 0). In WinXP everything works fine, but on Win 7 the value from this port is FF every time. Note: I have no IDE devices in my laptop, just SATA (DVD and HDD). How can I get the information about the HDD drives?

Re: How to get the information about HDD

April 19th, 2015, 10:31

If you have direct I/O access sissue the standard ATA command EC :
~

00 00 00 00 00 00 ec 00 00

~

Be aware that you will need to replace the most significant bytes by the least significant bytes on your "EC" reading and decode the obtained data.

Re: How to get the information about HDD

April 19th, 2015, 11:04

Now i'm confused.

If your driver is correctly working and providing direct access to the SATA drive channel you can write some software to issue the EC command, this if you want to do-if-yourself.

Example, using this IDE drive :

1.png
1.png (9.39 KiB) Viewed 6644 times


If you issue the "EC" you get this (by swapping the most significant bytes by the least significant bytes). :

2.png
2.png (13.13 KiB) Viewed 6644 times


3.png


You can "decode" the data that you get from the drive by standard ATA commands and get usefull info like this (for my drive) :

Code:
Default logical cylinders=16383
Default number of logical heads=16
Default number of logical sectors per track=63
Serial number=692125230553       
Buffer type=3
Buffer size in 512-byte increments=3804
Number of ECC bytes passed on READ/WRITE LONG commands=4
Firmware revision=A2R.0600
Model number=QUANTUM FIREBALLP AS20.5               
Maximum number of sectors that can be transferred on Multiple commands=16
Cannot perform double word I/O=0
I/O Ready is supported=Yes
I/O Ready can be disabled=Yes
LBA supported=Yes
DMA supported=Yes
Capabilities=16384
PIO data-transfer cycle timing mode=2
Number of current cylinders=16383
Number of current heads=16
Number of current sectors per track=63
Current capacity in sectors (CHS mode only)=64528
Multiple sector setting is valid=Yes
Current setting for number of sectors that can be transferred per interrupt on R/W Multiple commands=0
Total number of User Addressable Sectors (LBA Mode only)=40132503
Multiword DMA transfer mode active=4
Multiword DMA transfer modes supported=7
Advanced PIO Mode is supported=3
Minimum multiword DMA transfer cycle time (ns) per word=120
Manufacturer_s recommended multiword DMA cycle time (ns)=120
Manufacturer_s PIO cycle time (ns) without flow control=120
Manufacturer_s PIO cycle time (ns) with flow control=120
Major version number=62
Minor version number=21
NOP command supported=No
READ BUFFER command supported=Yes
WRITE BUFFER command supported=Yes
Host Protected Area feature set supported=Yes
DEVICE RESET command supported=No
SERVICE interrupt supported=No
RELEASE interrupt supported=No
LOOK AHEAD supported=Yes
WRITE CACHE supported=Yes
PACKET Command feature set supported=No
Power management feature set supported=Yes
Removable feature set supported=No
Security feature set supported=Yes
SMART feature set supported=Yes
Removable Media Status Notification feature supported=No
Advanced Power management feature set supported=No
CFA feature set supported=No
READ/WRITE DMA QUEUED supported=No
DOWNLOAD MICROCODE command supported=Yes
NOP command enabled=No
READ BUFFER command enabled=Yes
WRITE BUFFER command enabled=Yes
Host Protected Area feature set enabled=Yes
DEVICE RESET command enabled=No
SERVICE interrupt enabled=No
RELEASE interrupt enabled=No
LOOK AHEAD enabled=Yes
WRITE CACHE enabled=Yes
PACKET Command feature set enabled=No
Power management feature set enabled=Yes
Removable feature set enabled=No
Security feature set enabled=No
SMART feature set enabled=Yes
Removable Media Status Notification feature enabled=No
Advanced Power management feature set enabled=No
CFA feature set enabled=No
READ/WRITE DMA QUEUED enabled=No
DOWNLOAD MICROCODE command enabled=No
Ultra DMA transfer mode 2 supported=Yes
Ultra DMA transfer mode 1 supported=Yes
Ultra DMA transfer mode 0 supported=Yes
Ultra DMA transfer mode 2=Not Active
Ultra DMA transfer mode 1=Not Active
Ultra DMA transfer mode 0=Not Active


4.png
4.png (14.19 KiB) Viewed 6644 times

Re: How to get the information about HDD

April 19th, 2015, 11:08

If you need something more practical get a free copy of victoria for windows :

http://www.hddoracle.com/viewtopic.php?f=36&t=36

And the extended passport information will provide this sort of STANDARD info :

5.png
5.png (7.96 KiB) Viewed 6643 times

Re: How to get the information about HDD

April 19th, 2015, 11:11

If you send the 00 00 00 00 00 00 ec 00 00 standard ata command to the drive the drive will fall intro the "DRQ" state, meaning it will put a sector of data on the buffer that you will need to retrieve to get the information posted above (assuming you are coding your own software).
If you don't swap the bytes you will see something like this by applying the ec command and reading the buffer from the drive :

6.png

Re: How to get the information about HDD

April 22nd, 2015, 2:14

Spildit, I'll try it and tell you the result, thanks!

Re: How to get the information about HDD

April 22nd, 2015, 7:21

sashadereh wrote:Spildit, I'll try it and tell you the result, thanks!


Ok !
Please let us know how well it went.
Post a reply