ATA和ATAPI类型硬盘区别方法
2010-05-21 17:48

目前,计算机主板IDE控制器连接的硬盘有ATAAT Attachment)类型和ATAPIAT Attachment Packet Interface)类型。那么,软件程序BIOS或者Linux内核是如何才能识别出硬盘是那种类型的呢?

在参考文档[1]中,定义了识别硬盘类型的方法,如下所示:

A device not implementing the PACKET command feature set shall place the signature in the Command Block registers listed below for power-on reset, hardware reset, software reset, and the EXECUTE DEVICE DIAGNOSTIC command.

If the device does not implement the PACKET command feature set, the signature shall be:

Sector Count 01h

LBA Low               01h

LBA Mid               00h

LBA High              00h

Device                  00h

A device implementing the PACKET command feature set shall place the signature in the Command Block registers listed below for power-on reset, hardware reset, software reset, the EXECUTE DEVICE DIAGNOSTIC command, and the DEVICE RESET command.

If the device implements the PACKET command feature set, the signature shall be:

Sector Count 01h

LBA Low               01h

LBA Mid               14h

LBA High              EBh

Device                  000x0000b where x equals 0 except when responding to a

DEVICE RESET, IDENTIFY DEVICE, or READ SECTOR(S)

command. For a DEVICE RESET, IDENTIFY DEVICE, or

READ SECTOR(S) command the value of x is not changed

from that existing when the command is written to the

Command register.

在经过软件复位或者硬件复位等操作后,比较LBA MidLBA High寄存器中的值是否分别是14hEBh,就可知连接的硬盘是ATAAT Attachment)类型还是ATAPIAT Attachment Packet Interface)类型。

参考文档:

[1]. Information Technology – AT Attachment with Packet Interface – 6(ATA /ATAPI-6)

http://hi.baidu.com/linuxcasting/blog/item/3b04d7383e78f4ff3b87ce39.html

GitHub 加速计划 / li / linux-dash
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐