X3T9.2/91-75 May 28, 1991 [ Note from John Lohmeyer: This file contains the Proposed additions/changes ] [ to the ATA Document Rev 2.3 to support removable ] [ media drives from Patrick Manley, SyQuest ] [ Technology. This file does not include Patrick's ] [ cover letter, which describes these proposed ] [ changes further--I didn't receive an electronic ] [ copy of the cover letter. ] Changes to the ATA document Section 7.2.9 7.2.9 Error Register This register contains status from the last command executed by the drive or a Diagnostic Code. At the completion of any command except Execute Drive Diagnostic, the contents of this register are valid when ERR=1 in the Status Register. Following a power on, a reset, or completion of an Execute Drive Diagnostic command, this register contains a Diagnostic Code (see Table 9-2). 7 6 5 4 3 2 1 0 +-------+-------+-------+-------+-------+-------+-------+-------+ | BBK | UNC | MC | IDNF | MCR | ABRT | TK0NF | AMNF | +-------+-------+-------+-------+-------+-------+-------+-------+ - BBK (Bad Block Detected) indicates a bad block mark was detected in the requested sector's ID field. - UNC (Uncorrectable Data Error) indicates an uncorrectable data error has been encountered. -MC(Media Changed)indicates that the media has been changed. A transition from Media not ready to ready. - IDNF (ID Not Found) indicates the requested sector's ID field could not be found. -MCR(Media Change Requested) The Door button on a Removable Media Drive has been pressed. Indicating the operator's wish to remove the Media. This may require some program to issue a Media eject command or a door unlock command. - ABRT (Aborted Command) indicates the requested command has been aborted due to a drive status error (Not Ready, Write Fault, etc.) or because the command code is invalid. - TK0NF (Track 0 Not Found) indicates track 0 has not been found during a Recalibrate command. - AMNF (Address Mark Not Found) indicates the data address mark has not been found after finding the correct ID field. .RM 78 8.4 Error Posting The errors that are valid for each command are defined in Table 8-1. It is not a requirement that all valid conditions be implemented. See 7.2.9 and 7.2.13 for the definition of the Error Register and Status Register bits. TABLE 8-2: REGISTER CONTENTS +----------------------------------+---------------------+ | Error Register TK0 AM | Status Register | |BBK|UNC|MC |IDNF|MCR|ABRT| NF| NF |DRDY|DWF|DSC|CORR|ERR| +----------------------+---+---+---+----+---+----+---+----+----+---+---+----+---+ |Check Power Mode | | | | | | V | | | V | V | V | | V | |Execute Drive Diags | See 9.2 | | | | | | V | |Format Track | | | V | V | | V | | | V | V | V | | V | |Identify Drive | | | | | | V | | | V | V | V | | V | |Idle | | | | | | V | | | V | V | V | | V | |Idle Immediate | | | | | | V | | | V | V | V | | V | |Initialize Drive Parms| | | V | | | | | | V | V | V | | | |Recalibrate | | | V | | | V | V | | V | V | V | | V | |Read Buffer | | | V | | | V | | | V | V | V | | V | |Read DMA | V | V | V | V | | V | | V | V | V | V | V | V | |Read Long | V | V | V | V | | V | | V | V | V | V | V | V | |Read Multiple | V | V | V | V | | V | | V | V | V | V | V | V | |Read Sector(s) | V | V | V | V | | V | | V | V | V | V | V | V | |Read Verify Sector(s) | V | V | V | V | | V | | V | V | V | V | V | V | |Seek | | | V | V | | V | | | V | V | V | | V | |Set Features | | | | | | V | | | V | V | V | | V | |Set Multiple Mode | | | V | | | V | | | V | V | V | | V | |Sleep | | | | | | V | | | V | V | V | | V | |Standby | | | V | | | V | | | V | V | V | | V | |Standby Immediate | | | V | | | V | | | V | V | V | | V | |Write Buffer | | | V | | | V | | | V | V | V | | V | |Write DMA | V | | V | V | | V | | | V | V | V | | V | |Write Long | V | | V | V | | V | | | V | V | V | | V | |Write Multiple | V | | V | V | | V | | | V | V | V | | V | |Write Same | V | | V | V | | V | | | V | V | V | | V | |Write Sector(s) | V | | V | V | | V | | | V | V | V | | V | |Write Verify | V | V | V | V | | V | | V | V | V | V | V | V | |Acknowledge Media Chng| | | | | | V | | | | | | | | |Pre boot command | | | | | | V | | | | | | | | |Door unlock | | | | | | V | | | | | | | | |Door lock | | | | | V | V | | | V | | | | | |Post boot | | | | | | V | | | | | | | | +----------------------+---+---+---+----+---+----+---+----+----+---+---+----+---+ |Invalid Command Code | | | | | V | V | | | V | V | V | | V | +----------------------+---+---+---+----+---+----+---+----+----+---+---+----+---+ | V = valid on this command | +-------------------------------------------------------------------------------+ 9. Command Descriptions Commands are issued to the drive by loading the pertinent registers in the command block with the needed parameters, and then writing the command code to the Command Register. The manner in which a command is accepted varies. There are three classes (see Table 9-1) of command acceptance, all predicated on the fact that to receive a command, BSY=0: - Upon receipt of a Class 1 command, the drive sets BSY within 400 nsec. - Upon receipt of a Class 2 command, the drive sets BSY within 400 nsec, sets up the sector buffer for a write operation, sets DRQ within 700 usec, and clears BSY within 400 nsec of setting DRQ. - Upon receipt of a Class 3 command, the drive sets BSY within 400 nsec, sets up the sector buffer for a write operation, sets DRQ within 20 msec, and clears BSY within 400 nsec of setting DRQ. NOTE: DRQ may be set so quickly on Class 2 and Class 3 that the BSY transition is too short for BSY=1 to be recognized. The drive shall implement all mandatory commands as identified by an M, and may implement the optional commands identified by an O, in Table 9-1. V indicates a Vendor Specific command code. If a new command is issued to a drive which has an uncompleted command (subsequently referred to as Old_Command) in progress, the drive shall immediately respond to the new command (Subsequently referred to as New_Command), even if execution of the Old_Command could have been completed. There shall be no indication given to the system as to the status of the Old_Command which was being executed at the time the New_Command was issued. TABLE 9-1: COMMAND CODES AND PARAMETERS +-------+-------------------+ +-----+ |Command| Parameters Used | |Class| | Code |FR SC SN CY DH | +-----+----------------------------------+---+-------+---+---+---+---+---+ | 1 | Check Power Mode | O |98h E5h| | y | | | D | | 1 | Execute Drive Diagnostic | M | 90h | | | | | D*| | 2 | Format Track | M | 50h | * | y | | y | y | | 1 | Identify Drive | O | ECh | | | | | D | | 1 | Idle | O |97h E3h| | y | | | D | | 1 | Idle Immediate | O |95h E1h| | | | | D | | 1 | Initialize Drive Parameters | M | 91h | | y | | | y | | 1 | Recalibrate | M | 1xh | | | | | D | | 1 | Read Buffer | O | E4h | | | | | D | | 1 | Read DMA (w/retry) | O | C8h | | y | y | y | y | | 1 | Read DMA (w/o retry) | O | C9h | | y | y | y | y | | 1 | Read Multiple | O | C4h | | y | y | y | y | | 1 | Read Sector(s) (w/retry) | M | 20 | | y | y | y | y | | 1 | Read Sector(s) (w/o retry) | M | 21 | | y | y | y | y | | 1 | Read Long (w/retry) See 9.13 | M | 22 | | y | y | y | y | | 1 | Read Long (w/o retry) See 9.13 | M | 23 | | y | y | y | y | | 1 | Read Verify Sector(s) (w/retry) | M | 40 | | y | y | y | y | | 1 | Read Verify Sector(s) (w/o retry)| M | 41 | | y | y | y | y | | 1 | Seek | M | 7xh | | | y | y | y | | 1 | Set Features | O | EFh | y | | | | D | | 1 | Set Multiple Mode | O | C6h | | y | | | D | | 1 | Set Sleep Mode | O |99h E6h| | | | | D | | 1 | Standby | O |96h E2h| | y | | | D | | 1 | Standby Immediate | O |94h E0h| | | | | D | | 2 | Write Buffer | O | E8h | | | | | D | | 3 | Write DMA (w/retry) | O | CAh | | y | y | y | y | | 3 | Write DMA (w/o retry) | O | CBh | | y | y | y | y | | 3 | Write Multiple | O | C5h | * | y | y | y | y | | 3 | Write Same | O | E9h | y | y | y | y | y | | 2 | Write Sector(s) (w/retry) | M | 30 | * | y | y | y | y | | 2 | Write Sector(s) (w/o retry) | M | 31 | * | y | y | y | y | | 2 | Write Long (w/retry) | M | 32 | * | y | y | y | y | | 2 | Write Long (w/o retry) | M | 33 | * | y | y | y | y | | 3 | Write Verify | O | 3Ch | * | y | y | y | y | | | Vendor Unique | V | 9Ah | | | | | | | | Vendor Unique | V | C0-C3h| | | | | | | | Acknowledge Media Change | O | DBh | | | | | D | | | Pre boot command | O | DCh | | | | | D | | | Door unlock | O | DDh | | | | | D | | | Door lock | O | DEh | | | | | D | | | Post boot | O | DFh | | | | | D | | | Vendor Unique | V | 8xh | | | | | | | | Vendor Unique | V |F0h-FFh| | | | | | | | Reserved: All remaining codes | | | | | | | | ------+----------------------------------+---+-------+---+---+---+---+---+ | | CY = Cylinder Registers SC = Sector Count Register | | | DH = Drive/Head Register SN = Sector Number Register | | | FR = Features Register (see command descriptions for use) | | | y - the register contains a valid parameter for this command. | | | For the Drive/Head Register, y means both the drive and | | | head parameters are used. | | | D - only the drive parameter is valid and not the head parameter.| | | D* - Addressed to Drive 0 but both drives execute it. | | | * - Maintained for compatibility (see 7.2.9) | +-----+------------------------------------------------------------------+ 9.4 Identify Drive The Identify Drive command enables the host to receive parameter information from the drive. When the command is issued, the drive sets BSY, stores the required parameter information in the sector buffer, sets DRQ, and generates an interrupt. The host then reads the information out of the sector buffer. The parameter words in the buffer have the arrangement and meanings defined in Table 9-3. All reserved bits or words shall be zero. +-------+ TABLE 9-3: IDENTIFY DRIVE INFORMATION | Word | +-------+------------------------------------------------------------------+ | 0 | General configuration bit-significant information: | | | 15 0 reserved for non-magnetic drives | | | 14 1=format speed tolerance gap required | | | 13 1=track offset option available | | | 12 1=data strobe offset option available | | | 11 1=rotational speed tolerance is > 0.5% | | | 10 1=disk transfer rate > 10 Mbs | | | 9 1=disk transfer rate > 5Mbs but <= 10Mbs | | | 8 1=disk transfer rate <= 5Mbs | | | 7 1=removable cartridge drive | | | 6 1=fixed drive | | | 5 1=spindle motor control option implemented | | | 4 1=head switch time > 15 usec | | | 3 1=not MFM encoded | | | 2 1=soft sectored | | | 1 1=hard sectored | | | 0 0=reserved | | 1 | Number of cylinders | | 2 | reserved | | 3 | Number of heads | | 4 | Number of unformatted bytes per track | | 5 | Number of unformatted bytes per sector | | 6 | Number of sectors per track | | 7-9 | Vendor Unique | | 10-19 | Serial number (20 ASCII characters, 0000h=not specified) | | 20 | Buffer type | | 21 | Buffer size in 512 byte increments (0000h=not specified) | | 22 | # of ECC bytes passed on Read/Write Long cmds (0000h=not spec'd) | | 23-26 | Firmware revision (8 ASCII characters, 0000h=not specified) | | 27-46 | Model number (40 ASCII characters, 0000h=not specified) | | 47 | 15-8 Vendor Unique | | | 7-0 00h = Read/Write Multiple commands not implemented | | | xxh = Maximum number of sectors that can be transferred | | | per interrupt on Read and Write Multiple commands | | 48 | 0000h = cannot perform doubleword I/O | | | 0001h = can perform doubleword I/O | | 49 | Capabilities | | | 15-9 0=reserved | | | 8 1=DMA Supported | | | 7-0 Vendor Unique | | 50 | reserved | | 51 | 15-8 PIO data transfer cycle timing mode | | | 7-0 Vendor Unique | | 52 | 15-8 DMA data transfer cycle timing mode | | | 7-0 Vendor Unique | | 53-127| reserved | |128-159| Vendor Unique | |160-255| reserved | +-------+------------------------------------------------------------------+ 9.4.1 Number of cylinders The number of translated cylinders in the default translation mode. 9.28 Acknowledge Media Change command (NEW)(Command code DBh) If the drive is operating in SAFE mode, this command clears the media change error so normal operation can resume. If the drive is not in SAFE mode, this command returns with abort error. 9.29 Pre boot command (NEW) ( Command code DCh ) This command is issued by the device driver or operating system prior to reboot of the system.This command will switch any removable drive ( master or slave ) from the normal operating mode to the boot response mode. If the boot mode switch jumper is not installed this command will return an error of ABRT. 9.30 Door unlock command (NEW) ( Command code DDh ) Command returns drive not ready if drive is not ready. It unlocks door if drive is ready and locked. 9.31 Door lock command (NEW) ( Command code DEh ) Command returns drive not ready if drive is not ready. It locks door if drive is ready and not locked. If drive is ready and locked, the BIOS shall check the door button and return a MRR(media removal requested) error if the button is pressed. This command provides a method of polling door button activity while the door is locked. 9.32 Post boot command (NEW) ( Command code DFh ) Basically the drives may need to send false information to the BIOS if they are in a pre bootmode to pass the diagnostics. See attached for further explanation. IDE Interface Supplement SyQuest has defined a few new IDE DISK COMMANDS, ERROR CODES and DRIVE MODE SWITCHES to support removable IDE drive(s). 1. New error code MEDIA CHANGE DETECTED (NEW) Bit 5 of the error register will be used to indicate this condition. This bit should be returned with the result of any drive command. If the drive is operating in SAFE mode (to be explained later),this error will not be cleared until a special command is send to the drive. It is posted only once if the drive is not in SAFE mode. 2. New error code MEDIA CHANGE REQUESTED (NEW) Bit 3 of the error register will be used to indicate this condition. This bit is set when the Door button is pressed and certain other conditions are met. 1. In response to a door lock command on a drive with the door already locked. 2. If by a Vendor Unique command the drive is told to interrupt when the door button is pressed. (this mode requires an interrupt handler ) See below for when this bit is set. 3. Door lock command (NEW) ( Command code DEh ) Command returns drive not ready if drive is not ready. It locks door if drive is ready and not locked. If drive is ready and locked, the BIOS shall check the door button and return a MRR(media removal requested) error if the button is pressed. This command provides a method of polling door button activity while the door is locked. 4. Door unlock command (NEW) ( Command code DDh ) Command returns drive not ready if drive is not ready. It unlocks door if drive is ready and locked. 5. Identify Drive Command SyQuest would like Word 2 renamed from Number of Fix cylinders to Number of cylinders and use bit 7 of Word 1 = 1 to indicate this is a removable drive. For BIOS vendor who would like to modify their code to accommodate a removable media IDE drive,they should incorporate the above commands in the INT13 interface. In addition, they should change the FIX DISK diagnostic to allow for not installing the cartridge at boot time. For customers who use BIOS that do not support removable drives they can either use a device driver to handle the removable drives, or they can use a removable drive the same way as a fix drive. That is, they have to reboot after changing media. In addition to the above, and because of the way existing BIOSs diagnose the drives, if a user does not install his media at boot time, he will normally get a 178x error, and he may need to press the F1 key in order to continue booting. This can be avoided if two more commands are implemented by the drives and used by a device driver. The two commands are: 6. Pre boot command (NEW) ( Command code DCh ) See Definitions below 7. Post boot command (NEW) ( Command code DFh ) Basically the drives may need to send false information to the BIOS if they are in a pre bootmode to pass the diagnostics. See Definitions below 8. Acknowledge Media Change command (NEW)(Command code DBh) If the drive is operating in SAFE mode, this command clears the media change error so normal operation can resume. If the drive is not in SAFE mode, this command returns with abort error. Definitions 1. Boot Mode Switch A removable jumper or other means must be provided on the drive to indicate to the local microprocessor whether the drive will be booted with the preboot and postboot modes enabled. This feature is for systems with mother board BIOS's which do not support removable drives.This modifies the sequences of drive letters installed under DOS. 2. Safe Mode Switch A removable jumper or other means will be provided on the drive to make it operating in SAFE mode. When the drive is in safe mode, media change must be acknowledged by the operating system.in other words, after a media change took place, the drive will not allowed any reads or writes until a acknowledge command is received by the drive. 3. Post Boot Mode A new drive command needs to be defined to allow a device driver or operating system to notify the drive that the boot sequence has been completed. The drive initially resets in the " Boot Response Mode" if the DOS jumper (described in 1 above) is present. This allows the installed drive to provide the necessary responses to be properly installed by DOS. After the drive has been installed by DOS and control passed to the device driver or operating system this enables the drive to respond normally to subsequent commands. If the boot mode switch jumper is not installed this command will return an error of ABRT. 4. Pre Boot (PB) Mode This command is issued by the device driver or operating system prior to reboot of the system.This command will switch any removable drive ( master or slave ) from the normal operating mode to the boot response mode. If the boot mode switch jumper is not installed this command will return an error of ABRT. 5. DOS Boot Response It is possible for a removable media drive(s) to either have media installed or not have media installed in both the master or slave drives at boot time. If the media is not installed at boot time this will cause the drive not to be recognized by DOS or result in DOS assigning an incorrect drive letter. These difficulties are avoided if the removable drive provides the proper "BootResponse". The following table provides the correct drive response to a read for variables such as master/slave, disk installed and Postboot (PB) command received. Master/ PB Media Appropriate Slave Received Installed Response ----------------------------------------------------------- Master no no Send false sector data Master no yes Send actual sector data Master yes no Send drive not ready Master yes yes Send actual sector data Slave no no Send false sector data Slave no yes send false sector data Slave yes no Send drive not ready Slave yes yes Send actual sector data Note: False Sector Data refers to any data pattern of the correct length that does not end with 55AA hex (i.e. all zeros). This is interpreted as a valid read by the host. Other commands such as Read Verify must also return a correct response, even with no media installed,until the "PB" command is received.