一般網路上可以找到的HDD檢測程式不外乎以CrystalDiskInfo與HD Tune等為主,這兩款程式大抵以ATA Command來取得有關HDD的所有資訊,對此自己也可以寫一個專屬於檢測HDD的小程式來玩玩。
先了解如何使用ATA Command來取得HDD的相關方法,這裡將需要4份Specification來搭配著RU(目前有DOS、UEFI與Windows,有需要的請自行下載)在UEFI環境下使用,如
- Intel® 6 Series Chipset and Intel® C200 Series Chipset (可以用舊的Intel Chip或是AMD Chip皆可)
- AT Attachment 8 - ATA/ATAPI Command Set
- Serial ATA AHCI 1.3 Specification
- SATA Storage Technology
- Information Technology - AT Attachment with Packet Interface - 7 Volume 1 - Register Delivered Command Set, Logical Register Set (ATA/ATAPI-7 V1) or Information Technology - AT Attachment with Packet Interface - 6 (ATA/ATAPI-6)
DOS
|
UEFI
|
Windows
|
|
方法一
|
ATA
Command + int13
|
EFI_ATA_PASS_THRU_PROTOCOL
|
WMI
|
方法二
|
ATA
Command + IO
|
EFI_DISK_INFO_PROTOCOL
|
ATA
Command + DeviceIoControl
|
方法三
|
ATA
Command + IO
|
接下來將一步步操作RU對SATA Controller下ATA Command取得HDD與ODD的相關資訊。
在Intel® 6 Series Chipset and Intel® C200 Series Chipset 中找出需使用到的AHCI相關表格資訊如AHCI Base Address Register/Serial ATA Index Data Pair Base Address、AHCI Register Address Map與Port Registers。
在AT Attachment 8 - ATA/ATAPI Command Set中找出IDENTIFY DEVICE、IDENTIFY PACKET DEVICE。
透過AT Attachment 8 - ATA/ATAPI Command Set、Serial ATA AHCI 1.3 Specification整理出需使用到的ATA Command。
Identify
Data HDD
|
Identify
Data ODD
|
Attribute
Values
|
Attribute
Thresholds
|
Enable
SMART
|
Disable
SMART
|
SMART STATUS
|
||
Input
|
Feature
|
XX
|
XX
|
D0h
|
D1h
|
D8h
|
D9h
|
DAh
|
Sector
Count
|
01h
|
01h
|
01h
|
01h
|
XX
|
XX
|
XX
|
|
Sector
Number
|
XX
|
XX
|
XX
|
XX
|
01h
|
01h
|
XX
|
|
LBA
Low
|
XX
|
XX
|
4Fh
|
4Fh
|
4Fh
|
4Fh
|
4Fh
|
|
LBA
High
|
XX
|
XX
|
C2h
|
C2h
|
C2h
|
C2h
|
C2h
|
|
Device/Head
|
XX
|
XX
|
A0h
|
A0h
|
XX
|
XX
|
XX
|
|
Command
|
ECh
|
A1h
|
B0h
|
B0h
|
B0h
|
B0h
|
B0h
|
|
Output
|
Return
Byte
|
512
|
512
|
512
|
512
|
0
|
0
|
0
|
接續下一篇 用RU在DOS或UEFI下,對SATA Controller下ATA Command取得HDD與ODD資訊(2)
沒有留言:
張貼留言