ATA和ATAPI类型硬盘区别方法

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

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值