硬盘详细资料

14 views
Skip to first unread message

my12...@gmail.com

unread,
Oct 1, 2005, 7:02:54 AM10/1/05
to java home
1F0: Read/Write: 数据端口寄存器
host和设备的数据传输通过这个寄存器进行.
也用于格式化时传输扇区表,在执行Read/Write Long
commands时传输8 bit 的ECC数据.

1F1: Read: 错误码寄存器
最后一次命令执行的状态信息.仅当状态寄存器的ERR位置位时此寄存器有效.
在加电和内部自检后此寄存器包含一个状态码.当状态寄存器的error位置位时此寄存器含义如下:


+-----+--------+-------------------------------------------------------------+
| BIT | Mnemon | Description
|
+-----+--------+-------------------------------------------------------------+
| 7 | BBK | Bad block mark detected in the requested sector's ID
field |
| 6 | UNC | Uncorrectable data error encountered
|
| 5 | | Not used
|
| 4 | IDNF | Requested sector's ID field not found
|
| 3 | | Not used
|
| 2 | ABRT | Command aborted due to drive status error or invalid
command|
| 1 | TK0NF | Track 0 not found during execution of Recalibrate
command |
| 0 | AMNF | Data address mark not found after correct ID field
found |
+-----+--------+-------------------------------------------------------------+


1F1: Write: 写补偿
驱动忽略此寄存器.

1F2: Read/Write: 扇区计数
定义数据传输的扇区数量, 后续的命令里,如果此值是0
代表 256 个扇区.
如果命令执行成功,最后在这个寄存器里的值是0.
每一个扇区传输以后,
寄存器内的值减1,寄存器内的值代表了剩余要传输的扇区数目.
如果命令执行未成功,
寄存器内包含要完成这次传输还必须要传输的扇区数目.

1F3: Read/Write: 首扇区编号
包含传输的第一个扇区的ID. 从1 到每个磁道的最大值.


1F4: Read/Write: 柱面低8位
如果访问操作跨越柱面,其值自动增1,以反映当前柱面.


1F5: Read/Write: 柱面高8位
同1f4

1F6: Read/Write: 驱动器/磁头选择
数据格式如下:

+-----+----------+---------------------------------------------------------+
| BIT | Mnemonic | Description
|
+-----+----------+---------------------------------------------------------+
| 7 | Reserved | 恒为 1
|
| 6 | Reserved | 恒为 0
|
| 5 | Reserved | 恒为 1
|
| 4 | DRV | 0 to select primary drive, 1 to select secondary
drive. |
| 3 | HS3 | MSB of head number.
|
| 2 | HS2 |
|
| 1 | HS1 |
|
| 0 | HS0 | LSB of head number.
|
+-----+----------+---------------------------------------------------------+

Upon command completion this register is updated to refplect the head
number currently selected.


1F7: Read: 状态寄存器
在每一个命令执行完成之后驱动器更新这个寄存器反映当前设备状态.
如果busy bit 置位,
其他位都是无效的.如果没有置位其格式如下:


+-----+----------+----------------------------------------------------------+
| BIT | Mnemonic | Description
|
+-----+----------+----------------------------------------------------------+
| 7 | BUSY | Busy bit. Set by the controller logic of the drive
when |
| | | ever the drive has access to and the host is locked
out |
| | | of the Command Block Registers. Set under the
following |
| | | conditions:
|
| | | o Within 400 nsec after the negation of RESET or
after |
| | | SRST is set in the Device Control Register. After
a |
| | | reset it is recomended that BUSY be set no more
than |
| | | 30 seconds.
|
| | | o Within 400 nsec of a host write to the Command
|
| | | Register with a Recalibrate, Read Long, Read
Buffer, |
| | | Read, Read Verify, Initialize Drive Parameters,
Seek |
| | | Identify Drive, or Execute Drive Diagnostic
command. |
| | | o Within 5 microseconds following the transfer of
512 |
| | | bytes of data during the execution of a Write,
Write |
| | | Buffer or Format Track command; or 512 bytes of
data |
| | | and the appropriate number of ECC bytes during
the |
| | | execution of a Write Long command.
|
| | | When BUSY is set no Command Block Register can be
|
| | | written too and a read of any Command Block
Register |
| | | returns the contents of the Status Register.
|
| | |
|
| 6 | DRDY | Drive Ready bit. Indicates that the drive is ready
to |
| | | accept commands. When and error occurs, this bit
stays |
| | | unchanged until the host reads the Status Register
then |
| | | again indicates that hte drive is ready. On power
up, |
| | | this bit should be cleared and should remain cleared
|
| | | until the drive is up to speed and ready to accept a
|
| | | command.
|
| | |
|
| 5 | DWF | Drive Write Fault bit. When an error occurs, this
bit |
| | | remains unchanged until the host reads the Status
|
| | | Register, then again indicates the current write
fault |
| | | status.
|
| | |
|
| 4 | DSC | Drive Seek Complete bit. This bit is set when a seek
|
| | | operation is complete and the heads are settled over
a |
| | | track. When an error occurs, this bit remains
unchanged |
| | | until the host reads the Status Register, then again
it |
| | | indicates the current seek complete status.
|
| | |
|
| 3 | DRQ | Data Request bit. When set it indicates that the
drive |
| | | is ready to transfer a word or byte of data between
the |
| | | host and the data port.
|
| | |
|
| 2 | CORR | Corrected Data bit. When a correctable data error
has |
| | | been encountered and the data has been corrected,
this |
| | | bit is set. This condition does not terminate a
multi |
| | | sector read operation.
|
| | |
|
| 1 | INDEX | Index bit. Set when the index mark is detected once
per |
| | | disk revolution.
|
| | |
|
| 0 | ERROR | Error bit. When set indicates that the previous
command |
| | | ended in an error. The other bits in the Error
Register |
| | | and Status Register contain additional information
about |
| | | the cause of the error.
|
+-----+----------+----------------------------------------------------------+


1F7: Write: 命令寄存器
一旦命令写入寄存器,设备就开始执行这个命令.下面的表是各种命令和命令参数.

+--------+---------------------------------+-----------------+
| Command| Command Description | Parameters Used |
| Code | | PC SC SN CY DH |
+--------+---------------------------------+-----------------+
| 98h @ | Check Power Mode | V D |
| E5h @ | Check Power Mode (same as 98h) | V D |
| 90h | Execute Drive Diagnostic | D+ |
| 50h | Format Track | V V |
| ECh @ | Identify Drive | D |
| 97h @ | Idle | V D |
| E3h @ | Idle (same as 97h) | V D |
| 95h @ | Idle Immediate | D |
| E1h @ | Idle Immadiate (same as 95h) | D |
| 91h | Initialize Drive Parameters | V V |
| E4h @ | Read Buffer | D |
| C8h @ | Read DMA With Retry | >> Unknown << |
| C9h @ | Read DMA | >> Unknown << |
| C4h @ | Read Multiple | V V V V |
| 20h | Read Sectors With Retry | V V V V |
| 21h | Read Sectors | V V V V |
| 22h | Read Long With Retry | V V V V |
| 23h | Read Long | V V V V |
| 40h | Read Verify Sectors With Retry | V V V V |
| 41h | Read Verify Sectors | V V V V |
| 1Xh | Recalibrate | D |
| 7Xh | Seek | V V |
| EFh @ | Set Features | V D |
| C6h @ | Set Multiple Mode | V D |
| 99h @ | Set Sleep Mode | D |
| E6h @ | Set Sleep Mode (same as 99h) | D |
| 96h @ | Standby | V D |
| E2h @ | Standby (same as 96h) | V D |
| 94h @ | Standby Immediate | D |
| E0h @ | Standby Immediate (same as 94h) | D |
| 8Xh | Vendor Unique | >> Unknown << |
| 9Ah | Vendor Unique | >> Unknown << |
| C0h | Vendor Unique | >> Unknown << |
| C1h | Vendor Unique | >> Unknown << |
| C2h | Vendor Unique | >> Unknown << |
| C3h | Vendor Unique | >> Unknown << |
| F5h | Vendor Unique | >> Unknown << |
| F6h | Vendor Unique | >> Unknown << |
| F7h | Vendor Unique | >> Unknown << |
| F8h | Vendor Unique | >> Unknown << |
| F9h | Vendor Unique | >> Unknown << |
| FAh | Vendor Unique | >> Unknown << |
| FBh | Vendor Unique | >> Unknown << |
| FCh | Vendor Unique | >> Unknown << |
| FDh | Vendor Unique | >> Unknown << |
| FEh | Vendor Unique | >> Unknown << |
| FFh | Vendor Unique | >> Unknown << |
| E8h @ | Write Buffer | D |
| CAh @ | Write DMA With Retry | >> Unknown << |
| CBh @ | Write DMA | >> Unknown << |
| C5h @ | Write Multiple | V V V V |
| E9h @ | Write Same | >> Unknown << |
| 30h | Write Sectors With Retry | V V V V |
| 31h | Write Sectors | V V V V |
| 32h | Write Long With Retry | V V V V |
| 33h | Write Long | V V V V |
| 3Ch @ | Write Verify | V V V V |
+--------+---------------------------------+-----------------+

KEY FOR SYMBOLS IN ABOVE TABLE:


PC Register 1F1: Write Precompensation
SC Register 1F2: Sector Count
SN Register 1F3: Sector Number
CY Register 1F4+1F5: Cylinder low + high
DH Register 1F6: Drive / Head

@ These commands are optional and may not be supported by some
drives.
D Only DRIVE parameter is valid, HEAD parameter is ignored.
D+ Both drives execute this command regardless of the DRIVE
parameter.
V Indicates that the register contains a valid paramterer.

Commands with >> Unknown << Parameters are not described in this
document.
If a parameter is blank, then the command does not require the contents
of that register.


3F6: Read: Alternate Status Register
Contains the same information as the Status Register in the Command
Block. Reading the Alternate Status Register does not imply an
interrupt acknowledge from the host or clear a pending interrupt. See
the description of the Status Register above for a definition of bits
in this register.

3F6: Write: Device Control Register
The bits in the Device Control Register are lister in the table below:

+-----+----------+----------------------------------------------------------+
| BIT | Mnemonic | Description
|
+-----+----------+----------------------------------------------------------+
| 7 | Reserved |
|
| 6 | Reserved |
|
| 5 | Reserved |
|
| 4 | Reserved |
|
| 3 | 1 | Always set.
|
| 2 | SRST | Host Software Reset bit. When this bit is set the
drive |
| | | is held reset. If two drives are daisy chained on
the |
| | | interface, this bit resets both drives
simultaneously. |
| | |
|
| 1 | nIEN | Drive Interrupt Enable bit. The enable bit for the
drive |
| | | interrupt to the host. When nIEN is 0 or the drive
is |
| | | selected the host interrupt signal INTRQ is enabled
|
| | | through a tri state buffer to the host. When nIEN is
1 |
| | | or the drive is not selected the host interrupt
signal |
| | | INTRQ is in a hig himpedance state regardless of the
|
| | | presence or absence of a pending interrupt.
|
| | |
|
| 0 | 0 | Always clear.
|
+-----+----------+----------------------------------------------------------+

3F7: Read: 驱动器地址状态寄存器
含有当前选择的驱动器和磁头的值. 含义如下:

+-----+----------+------------------------------------------------------+
| BIT | Mnemonic | Description
|
+-----+----------+------------------------------------------------------+
| 7 | HiZ | This bit is in high impedance when read.
|
| 6 | nWTG | Write Gate bit. When a write to the hard drive is in
|
| | | progress, nWTG is 0
|
| 5 | nHS3 | Negated MSB of head number
|
| 4 | nHS2 |
|
| 3 | nHS1 |
|
| 2 | nHS0 | Negated LSB of head number.
|
| 1 | nDS1 | Drive 1 Select bit. When 0, Drive 1 is selected.
|
| 0 | nDS0 | Drive 0 Select bit. When 0, Drive 0 is selected.
|
+-----+----------+------------------------------------------------------+

my12...@gmail.com

unread,
Oct 1, 2005, 7:04:32 AM10/1/05
to java home
Reply all
Reply to author
Forward
0 new messages