DOCUMENT STATUS Revision 0-18 March 1997 - Ron Stephens Revision 1-21 May 1997 - Terry Miller and Christopher Mayne American National Standard for Information Systems Removable Media Feature Set (Changes and additions to ATA/ATAPI-4) *** PROPOSAL ONLY *** Secretariat Information Technology Industry Council Approved mm dd yy American National Standards Institute, Inc. 1
Abstract This document describes two methods for securing the media in removable media storage devices using the ATA/ATAPI interface protocols. Method one is intended for use in both ATA and ATAPI devices. Method two is intended for use in ATA devices only. Method1: The preferred method uses the SET FEATURES command to enable Media Status Notification. Media Status Notification gives the host system maximum control of the media. The host system determines media status by issuing the GET MEDIA STATUS command and controls the drive eject mechanism via the MEDIA EJECT command (ATA devices) or the START/STOP UNIT command (ATAPI devices). While Media Status Notification is enabled ATA devices execute MEDIA LOCK and MEDIA UNLOCK commands without changing the media lock state (no-operation). While Media Status Notification is enabled the eject button does not eject the disk. Media Status Notification is persistent through medium removal and insertion and is only disabled via the SET FEATURES command, HARD RESET, SOFT RESET (ATA - SRST), DEVICE RESET (ATAPI - 0x08 command), EXECUTE DRIVE DIAGNOSTICS, or power-on-reset. Method 2: The secondary method is intended for ATA devices only. This method operates with Media Status Notification disabled. The MEDIA LOCK and MEDIA UNLOCK commands are used to secure the media and the MEDIA EJECT command is used to remove the media. While the media is locked the eject button does not eject the disk. Media status is determined by checking the media status bits supported by the MEDIA LOCK and MEDIA UNLOCK commands. The GET MEDIA STATUS command executes but always returns zero in the media status bits when Media Status Notification is disabled Reasons for the Removable Media Feature Set: The reasons for implementing the Removable Media Feature set are: to prevent data loss caused by writing to new media while still referencing the previous media s information to prevent data loss by locking the media until completion of a cached write to prevent removal of the media by unauthorized persons Note for ATA devices: When Media Status Notification is enabled the interpretation of the returned error bits for all task file media access commands, i.e.; READ, WRITE, etc. change. The new error bits are: No Media (NM), Media Changed (MC), Media Change Requested (MCR), Media Write Protected (WP), and Media Read Protected (RP). Removable Media Feature Set The following task file commands are defined to implement the ATA and the ATAPI removable media feature sets. ATA Removable Media Feature Set GET MEDIA STATUS MEDIA EJECT MEDIA LOCK MEDIA UNLOCK SET FEATURES (ENABLE MEDIA STATUS NOTIFICATION) 2
SET FEATURES (DISABLE MEDIA STATUS NOTIFICATION) ATAPI Removable Media Feature Set GET MEDIA STATUS SET FEATURES (ENABLE MEDIA STATUS NOTIFICATION) SET FEATURES (DISABLE MEDIA STATUS NOTIFICATION) Note for ATAPI devices: ATAPI devices control the media eject mechanism via the START/STOP UNIT packet command. The preferred sequence of events to use Media Status Notification is as follows: 1. Host system checks the device type, ATA or ATAPI, via the device signature in the task file registers. 2. Host system checks for MSN capability through the Identify Device command (word 127, bits 0,1) for ATA devices and through the Identify Packet Device command (word 127, bits 0,1) for ATAPI devices. 3. Host system uses the Set Features command to enable MSN which gives control of the media to the host. At this time the host system checks the Cylinder High register to determine if : a. the device is capable of locking the media b. the device is capable of power ejecting the media c. MSN was already enabled when this command was received 4. Host system periodically checks media status using the Get Media Status command to determine if any of the following events occurred: d. media is present in the device (NM) e. media was changed since the last command (MC) f. a media change request has occurred (MCR) g. media is write protected (WP) h. media is read protected (RP) The preferred sequence of events to use method 2 of the Removable Feature Set is as follows: 1. Host system checks for device type ATA via the device signature in the task file registers. 2. Host system checks for a minimum of ATA-3 capability through the Identify Device command word 80 (Major Version Number) and word 81 (Minor Version Number) 3. Host system periodically issues MEDIA LOCK commands to determine if: c. media is present in the device (NM) - media locked if present d. a media change request has occurred (MCR) 3
x.xx GET MEDIA STATUS x.xx.x Command code DAh x.xx.x Feature set Removable Media feature set Mandatory if the Removable Media feature set is implemented. x.xx.x Protocol Non-data protocol, see section 9.9. x.xx.x Inputs Features na na na na na na na na Command DAh x.xx.x Normal outputs Error na Status 0 1 0 na 0 na na 0 Status register - BSY - shall be cleared to zero, indicating the command is complete. ERR - shall be cleared to zero. x.xx.x Error outputs If the device does not support this command, the device shall return a Command Abort error. 4
Error RP WP MC 0 MCR ABRT NM 0 Status 0 1 0 na 0 na na 1 Error register - ABRT - This bit shall be set to one if the device does not support this command. NM to MCR by STATUS device and WP RP media one the - only This - device. for shall This read write set command bit each bit bit reset the shall protected. shall The execution bit this be again device and be set bit set only to after for of to shall to one GET subsequent set one each for reset when the if MEDIA if no each the execution bit this media the eject again execution media STATUS bit device is button after for of present insertions. the subsequent detects each until of is GET pressed execution the media MEDIA drive. eject is by has inserted the of button STATUS This the been user GET bit into presses. inserted. command shall while MEDIA the detected be drive. the set The x.xx.x Prerequisites DRDY set equal to one. x.xx.x Description This Media returns WP, button executed MC, command Status pressed, zeros MCR periodically Notification in returns and the etc. NM RP, media to are WP, is determine enabled. valid MC, status only MCR bits if When while media and RP, Media NM WP, status bits. MC, Status has The MCR changed, Notification definitions and NM, e.g.; of is as new enabled. media disabled defined media status This above, this inserted, bits command when RP, eject 5
x.xx MEDIA EJECT x.xx.x Command code EDh x.xx.x Feature set Removable Media feature set - Optional for devices implementing the Removable Media feature set. - Prohibited for devices implementing the PACKET Command feature set. x.xx.x Protocol Non-data protocol, see section 9.9. x.xx.x Inputs x.xx.x Normal outputs Features na Device/Head obs na obs DE na na na na V Command EDh Error na Status 0 1 0 na 0 na na 0 Error outputs If the device does not support this command, the device shall return a Command Abort error. 6
Error na na na na na ABRT NM na Status 0 1 DF na 0 na na ERR Error register - ABRT - This bit shall be set to one if the device does not support this command. NM - This bit shall be set to one if no media is present. Status register - DF - This bit shall be set to one if a device fault occurred. ERR - This bit shall be set to one if any Error register bit is set to one. x.xx.x Prerequisites DRDY set equal to one. x.xx.x Description This unlocks command the media causes if locked, any pending and ejects operations the media. to complete, spins down the device if needed, 7
x.xx MEDIA LOCK x.xx.x Command code DEh x.xx.x Feature set Removable Media feature set - Optional for devices implementing the Removable Media feature set. - Prohibited for devices implementing the PACKET Command feature set. x.xx.x Protocol Non-data command, see 9.9. x.xx.x Inputs x.xx.x Normal outputs Features na Device/Head obs na obs DE na na na na V Command DEh Error na Status 0 1 0 na 0 na na 0 x.xx.x Error outputs If the device does not support this command, the device shall return a Command Abort error. 8
Error na na na na MCR ABRT NM na Status 0 1 DF na 0 na na ERR Error register - ABRT - This bit shall be set to one if the device is not capable of locking the media. NM MCR been - detected - This bit bit by shall the be be device. set set to to one one if if no the media device is present. is locked and a media change request has Status register - DF - This bit shall be set to one if a device fault occurred. ERR - This bit shall be set to one if any Error register bit is set to one. x.xx.x Prerequisites DRDY set equal to one. x.xx.x Description This command no If been Error When button, until the Error the command register detected by media register will setting and return locked, unlocked by LOCKED can bit the be shall good MCR device. LOCKED ERR the used and condition be status bit set to media If in lock state, a to the returned (no media one. is is the Status Error ERR cleared. the present, device, change shall register bit in the if indicate the shall request MSN media and Status shall respond is whether disabled has be shall ERR register) set been to to bit a the set. media one. detected, in and If media to the MSN the perform Status is LOCKED change the enabled, register no MCR action. request state bit this to has in and one, the Note: Some caching controllers not reporting ATA-3 or later capability hang if issued this command. 9
x.xx MEDIA UNLOCK x.xx.x Command code DFh x.xx.x Feature set Removable Media feature set - Optional for devices implementing the Removable Media feature set. - Prohibited for devices implementing the PACKET Command feature set. x.xx.x Protocol Non-data command, see 9.9. x.xx.x Inputs x.xx.x Normal outputs Features na Device/Head obs na obs DE na na na na V Command DFh Error na Status 0 1 0 na 0 na na 0 x.xx.x Error outputs If the device does not support this command, the device shall return a Command Abort error. 10
Error na na na na na ABRT NM na Status 0 1 DF na 0 na na ERR Error register - ABRT - This bit shall be set to one if the device does not support this command. NM - This bit shall be set to one if no media is present. Status register - DF - This bit shall be set to one if a device fault occurred. ERR - This bit shall be set to one if any Error register bit is set to one. x.xx.x Prerequisites DRDY set equal to one. x.xx.x Description This command command will return can be good used status to unlock (no ERR the device, bit in the if MSN Status is register) disabled and. If perform MSN is enabled no action., this If the media is present, the media shall be set to the UNLOCKED state and no Error register bit shall be set to one. If command, a media change the media request shall has be ejected been detected when the by MEDIA the device UNLOCK prior to command the issuance completes. of this Note: Some caching controllers not reporting ATA-3 or later capability hang if issued this command. 11
x.xx SET FEATURES x.xx.x Command code EFh x.xx.x Feature set General feature set Mandatory for all devices. Set transfer mode subcommand is mandatory. Enable/Disable write cache subcommands are mandatory when a write cache is implemented. Enable/Disable Media Status Notification subcommands are mandatory if the Removable Media feature set is implemented. All other subcommands are optional. x.xx.x Protocol Non-data protocol, see section 9.9. x.xx.x Inputs Table other registers, 19 defines such the as value the of Sector the subcommand Count register in to the pass Feature additional register. information Some subcommands to the device. use Features Subcommand code Sector Count Subcommand specific Sector Number Subcommand specific Cylinder Low Subcommand specific Cylinder High Subcommand specific Device/Head obs na obs DE na na na na V Command EFh x.xx.x Normal outputs See the subcommand descriptions. x.xx.x Error outputs If command any subcommand error. input value is not supported or is invalid, the device posts an Aborted 12
Error na na na na na ABRT na na Device/Head obs na obs DEV na Status 0 1 0 na 0 na na ERR Error register - ABRT - This bit shall be set to one if this subcommand is not supported or if command parameters are invalid. Status register - ERR - This bit shall be set to one if the ABRT bit in the Error register is set to one. x.xx.x Prerequisites DRDY set equal to one. x.xx.x Description This device At subcommands power features. on, or are is after Table used vendor a 19 hardware by defines the specific. host reset, these to establish the features. default parameters setting of which the functions affect the specified execution by of the certain Table 19 SET FEATURES register definitions Value (see note) 01h Retired 02h Enable write cache 03h Set transfer mode based on value in Sector Count register. Table 20 defines values. 04h Obsolete 31h Disable Media Status Notification 33h Obsolete 44h Obsolete 54h Obsolete 55h Disable read look-ahead feature 5Dh Enable release interrupt 5Eh Enable Service interrupt 66h Disable reverting to power on defaults 77h Obsolete 81h Retired 82h Disable write cache 84h Obsolete 88h Obsolete 95h Enable Media Status Notification 99h Obsolete 9Ah Obsolete AAh Enable read look-ahead feature 13
ABh Obsolete BBh Obsolete CCh Enable reverting to power on defaults DDh Disable release interrupt DEh Disable Service interrupt NOTE All values not shown are reserved for future definition. x.xx.x Inputs Enable Media Status Notification x.xx.x Normal outputs Features 95h Device/Head obs na obs DE na na na na V Command EFh Error na Cylinder Low VER Cylinder High RSVD RSVD RSVD RSVD RSVD PEJ LOCK PENA Status 0 1 0 na 0 na na 0 Cylinder Low register - VER - This field shall contain the Media Status Notification version supported by the device (currently 0x00). Cylinder High register - PENA - This bit shall be set to one if Media Status Notification was enabled prior to the receipt of this command. LOCK preventing PEJ capable device. a RSVD software - - This shall physically bit EJECT manual bit be shall must shall cleared command. eject be be ejecting set set operation. to to zero. to one the. zero one if media the if if the when device has a is only software capable a power unlocks EJECT of eject locking the mechanism media command the when media, is that it sent receives is to the x.xx.x Description Subcommand code 95h enables Media Status Notification, and clears any previous media lock state. This subcommand returns the device capabilities for media eject, media lock, previous state of Media Status Notification and the current version of Media Status Notification supported. 14
x.xx.x Disable Media Status Notification Subcommand code 31h disables Media Status Notification and leaves the media in an unlocked state. If Media Status Notification is disabled when this subcommand is received the subcommand has no effect. x.xx.x Required Error Register Changes to Task File Commands While MSN is Active The READ, following READ changes VERIFY, shall READ be MULTIPLE, made to error READ register DMA values and READ for these DMA task QUEUED file read commands: Error RP UNC MC 0 MCR ABRT NM 0 Status 0 1 0 na 0 na na ERR Error register - ABRT - This bit shall be set to one if the device does not support this command. NM MCR command. UNC RP - This - media This bit The bit status shall shall device be is be only set shall set if to cleared if the to one data one media if its is if the no by uncorrectable. internal a is media Get read Media is media changed protected. present. Status request change since or has detected a last media been issuance state. access detected of this command. by device. The WRITE, following WRITE changes MULTIPLE, shall be WRITE made DMA to error and register WRITE values DMA QUEUED for these task file write commands: Error na WP MC 0 MCR ABRT NM 0 Status 0 1 0 na 0 na na ERR Error register - ABRT - This bit shall be set to one if the device does not support this command. NM MCR The WP - device This - media bit shall bit status shall clear be is be only set its set internal to if cleared to the one one media if if media no by a media is Get write changed Media is protected. present. detected Status since request last or state. has media issuance been access detected of this command. by device. 15
The following changes shall be made to error register values for the task file seek command: Error na na MC 0 MCR ABRT NM 0 Status 0 1 0 na 0 na na ERR Error register - ABRT - This bit shall be set to one if the device does not support this command. NM MCR command. - This - media bit The bit status shall device be is be only set shall set to cleared to one one if its if the no by internal a media Get Media is media changed present. Status request change since or has detected last media been issuance access detected state. of command. this by device. x.xx.x ATAPI Unit Attention Conditions and Media Status Notification ATAPI Media device media commands Status changed shall devices are be Notification shall received able (MC) to maintain no report by matter (media the both independent device. what change Unit order Attention status). the REQUEST Media for When Unit Change a Attention media SENSE and insertion and (media the GET occurs change MEDIA the status) STATUS ATAPI and x.xx.x Media Power Up Status RESET Reset, Notification Hard Reset, Enabled: Device Reset (method (ATAPI 1) Command 08), SOFT RESET (ATA SRST) and EXECUTE DEVICE DIAGNOSTIC disable Media Status Notification. Media Status Notification must be re-enabled after any of the previous reset conditions occur. All media status is reset when Media Status Notification is disabled because a reset condition occurred. Any pending media change (MC) or media change request (MCR) is lost after the reset condition occurs. Media Status Notification Disabled: (method 2) When a SOFT RESET (ATA SRST) occurs the Media Lock (LOCK) state is cleared, the Media Change Request (MCR) state is cleared, and the Media Change state (MC) is preserved. Need to add new commands to Annex E Table E.2 - Commands sorted by command value Command Name Command Code MEDIA LOCK DEh MEDIA UNLOCK DFh MEDIA EJECT EDh GET MEDIA STATUS DAh 16
Need to alter Identify Device Information of Table 11. Table 11 Identify device information (concluded) Word F/V 91-126 R Reserved 127 F Removable feature set support 15-2 1-0 Reserved 01=Removable Feature Set supported 00=Removable Feature Set not supported 8.6.51 Words 91-126: Reserved 8.6.52 Word 127: If bit 0 of word 127 is set to one and bit 1 of word 127 is cleared to zero, the device supports the Removable Media Features set. Bits 15 through 2 of word 127 are reserved and shall be cleared to zero. Need to alter Identify Packet Device Information of Table 13 Table 13 Identify packet device information (concluded) Word F/V 89-126 R Reserved 127 F Removable feature set support 15-2 1-0 Reserved 01=Removable Feature Set supported 00=Removable Feature Set not supported 8.7.41 Words 91-126: Reserved 8.7.42 Word 127: If bit 0 of word 127 is set to one and bit 1 of word 127 is cleared to zero, the device supports the Removable Media Features set. Bits 15 through 2 of word 127 are reserved and shall be cleared to zero. 17
OUTSTANDING ISSUES There is a conflict in Error register bit definitions for the task file command WRITE VERIFY when Media Status Notification is enabled. The conflicting Error register bit definitions occur for the previously defined UNC bit and the newly defined WP bit.? more information here? 18