5. IDE Command Descriptions
31
Read Sector(s) (2xh)
This command reads from 1 to 256 sectors as specified in the command block,
beginning at the specified sector (sector count equal to zero requests 256 sectors).
When the command register is written, the drive sets the BSY bit and begins execution
of the command. An aborted command is set if bits 2 and 3 are not equal to zero. An ID
Not Found error is returned if incorrect command block parameters are passed. If the
drive is not already on the desired track, an implied seek is performed. Once at the
desired track, the drive searches for the appropriate ID field. If the ID is read correctly,
the data field is read into the sector buffer, error bits are set if an error was encountered,
the DRQ bit is set, and an interrupt is generated. The DRQ bit is always set regardless
of presence or absence of an error condition at the end of the sector.
Upon command completion, the command block registers contain the cylinder, head,
and sector number of the last sector read. The sector count is zero after successful
execution of the command. Multiple sector reads set DRQ and generate an interrupt
when the sector buffer is filled at the completion of each sector, and the drive is ready
for the data to be read by the host. DRQ is reset and BSY is set immediately when the
host empties the sector buffer.
If an error occurs during a multiple sector read, the read terminates at the sector where
the error occurs. The command block registers contain the cylinder, head, and sector
number of the sector where the error occurs. The host then reads the command block to
determine what error has occurred, and on which sector. The flawed data, whether a
correctable or non-correctable error, is loaded into the sector buffer. The read does not
terminate if the error is correctable. If no error is detected, the cylinder, head, and sector
registers are updated to point to the next sequential sector.
A read long may be executed by setting the long bit in command code. The read long
command returns the data and the ECC bytes contained in the data field of the desired
sector. During a read long, the drive does not check the ECC bytes to determine if there
has been any type of data error. Data bytes are 16-bit transfers and ECC bytes are 8-bit
transfers.
Write Sector(s) (3xh)
This command writes from 1 to 256 sectors as specified in the command block,
beginning at the specified sector (a sector count equal to zero requests 256 sectors).
When the command register is written, the drive waits for the host to fill the sector buffer
with data to be written. No interrupt is generated to start the first buffer fill operation.
Once the buffer is full, the drive sets BSY and begins command execution.
If bits 2 and 3 are on, the command terminates with Aborted Command. An ID Not
Found error is returned if incorrect command block parameters are passed.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com