0% found this document useful (0 votes)
17 views198 pages

ATAPI CD-ROM Specification Draft 1.2

The document is a specification for the ATA Packet Interface for CD-ROMs, designated as SFF-8020, submitted by the Small Form Factor Committee on February 24, 1994. It includes contributions from various member companies and outlines the structure and content of the specification, which encompasses an introduction, general information, and conventions. The document is not a final draft and serves as a preliminary guideline for the interface standard.

Uploaded by

kelvinmacshop
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views198 pages

ATAPI CD-ROM Specification Draft 1.2

The document is a specification for the ATA Packet Interface for CD-ROMs, designated as SFF-8020, submitted by the Small Form Factor Committee on February 24, 1994. It includes contributions from various member companies and outlines the structure and content of the specification, which encompasses an introduction, general information, and conventions. The document is not a final draft and serves as a preliminary guideline for the interface standard.

Uploaded by

kelvinmacshop
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Small Form Factor Committee Revision 1.

2
February 24, 1994
Specification of Status: Submitted
THIS IS NOT A FINAL DRAFT

nl t
O raf
ATA Packet Interface for CD-ROMs SFF-8020

w D
y
Member Companies Supporting This Specification:
Adaptec NEC Technologies
Apple OAK Technologies
Cirrus Logic
Compaq
ie ry Panasonic
Philips
Dell Quantum
ev a
ENDL Seagate
IBM Silicon Systems
n

Intel Sony Corporation


Maxtor Wearns Technology
i

Microsoft Western Digital


rR m

Molex
fo eli

Member Companies Voting Against This Specification:


Pr

Point of Contact: I. Dal Allan Technical Editors: Tom Hanan


Chairman SFF Committee Western Digital Corporation
ENDL 8105 Irvine Center Drive
14426 Black Walnut Court Irvine Calif. 92718
Saratoga, CA 95070 Ph: (714) 932-7472
Ph: (408) 867-6630 Fax: (714) 932-7796
Fax: (408) 867-2115 E-Mail: hanan_t@[Link]
E-Mail: 250-1752@[Link]
Devon Worrell
Western Digital Corporation
8105 Irvine Center Drive
Irvine Calif 92718
Ph: (714) 932-7042
Fax: (714) 932-7796
E-Mail: worrell@[Link]
ATAPI CD-ROM Specification
February 24, 1994

Table of Contents
1.0 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
1.1 Abstract. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
1.2 Secretariat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
1.3 Summary of SFF Principals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
1.4 SFF Membership and Fees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
1.5 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
1.6 Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

nl t
1.7 Normative References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

O raf
1.8 Prerequisites and Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
1.9 Layout of the Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
1.10 Patents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
2.0 General. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

w D
y
2.2 Feature Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
3.0 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2
3.3
ie ry
Signal Conventions. . . . . . . . . . . .
Definitions . . . . . . . . . . . . . . . .
3.3.1 Absolute F Field . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
11
11
11
ev a
3.3.2 Absolute M Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3.3 Absolute S Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
n
3.3.4 ATA (AT Attachment) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.5 BCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
i

3.3.6 Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
rR m

3.3.7 Blocks Per Sector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12


3.3.8 Command Packet (CP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.9 CD-DA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
fo eli

3.3.10 CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.11 CD-ROM Control Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.12 CD-ROM Data Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Pr

3.3.13 CHS (Cylinder-Head-Sector) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13


3.3.14 CIRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.15 Data Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.16 DMA (Direct Memory Access). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.17 Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.18 Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.19 Hold Track State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.20 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.21 Invalid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.22 LBA (Logical Block Address) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.23 Logical Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.24 Lead-in Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.25 Lead-out Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.26 L-EC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.27 LUN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.28 Mandatory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.29 MSF Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.30 One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.31 Optional. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.32 Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.33 Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.34 Pause Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Page i working draft AT Packet Interface


ATAPI CD-ROM Specification
February 24, 1994

Table of Contents
3.3.35 PIO (Programmed Input/Output) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.36 Post-gap Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.37 Pre-gap Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.38 Relative F Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.39 Relative M Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.40 Relative S Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.41 SAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

nl t
3.3.42 Reserved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

O raf
3.3.43 Sector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.44 Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.45 Sub-channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.46 TOC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.47 Track . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

w D
y
3.3.48 Track Relative Logical Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.49 Transition Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.50 VU (Vendor Unique) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.0
3.4
ie ry
3.3.51 Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Symbols and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
ATAPI Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ev a
4.1 ATA Signal Utilization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 ATA Command Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
n
4.3 ATA Compatibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.4 Packet Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
i

4.5 How SCSI is Used by ATAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19


rR m

4.5.1 Differences from the SCSI Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19


4.5.2 Redundant Command Functionality (Task File vs. Packet) . . . . . . . . . . . . . . . . 20
[Link] Door Lock and Door Unlock vs. Prevent / Allow Medium Removal . . . . . 20
fo eli

[Link] ATAPI Identify Drive vs. Inquiry . . . . . . . . . . . . . . . . . . . . . . . 20


[Link] Initialize Drive Parameters and Set Features vs. Mode Sense and Mode Select 20
[Link] Recalibrate vs. Rezero. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Pr

5.0 ATAPI Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21


5.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2 PACKET Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.3 Status Register Utilization for Packet Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.4 Byte Count Register (Cylinder Low/High) Usage for Packet Commands. . . . . . . . . . . . . . 22
5.5 Sector Count (ATAPI Interrupt Reason) Register Usage for Packet Commands . . . . . . . . . . 23
5.6 Overlapped Command Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.7 Flow of Packet Command, PIO Data In to Host . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.8 Flow of Packet Command with PIO Data Out from the Host . . . . . . . . . . . . . . . . . . . . 26
5.9 Flow of DMA Data Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.10 Flow of Non-data Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.11 Timing of Packet Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.12 Timing of Data and Status Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.13 Control Signal Timing Requirements and Relationships . . . . . . . . . . . . . . . . . . . . . . 31
5.14 BIOS and ATAPI Driver Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.14.1 Reset Master/Slave Diagnostics Sequence . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.14.2 SRST Initialization Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.14.3 Special Handling of ATA Read and Identify Drive Commands . . . . . . . . . . . . . . 32
5.14.4 ATAPI aware BIOS and Driver Considerations . . . . . . . . . . . . . . . . . . . . . . 33
5.14.5 Default Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.0 ATAPI Transport Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.1 Reset Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Page ii working draft AT Packet Interface


ATAPI CD-ROM Specification
February 24, 1994

Table of Contents
6.1.1 Power On or Hardware Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.2 ATAPI Soft Reset Command and Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.3 ATAPI Implementation of ATA SRST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.4 Physical Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.5 Register Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.6 ATAPI Register Map (Packet Command) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.0 CD-ROM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

nl t
7.1 New Capabilities Since the SCSI-2 Standardization. . . . . . . . . . . . . . . . . . . . . . . . . 43

O raf
7.2 CD-ROM Media Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.3 CD-ROM Physical Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.3.1 Frame Format for Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.3.2 Sector Format for Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.3.3 Sub-channel Information Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

w D
y
7.4 CD Audio Error Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.5 CD-ROM Ready Condition/Not Ready Condition. . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.5.1 Packet Command Not Ready Status Utilization . . . . . . . . . . . . . . . . . . . . . . 50

8.0
7.6
7.7
ie ry
CD-ROM Address Reporting Formats (MSF bit) . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Error Reporting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
CD-ROM ATA (Task File) Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
ev a
8.1 ATA (Task File) Command Implementation Requirements . . . . . . . . . . . . . . . . . . . . . 53
8.1.1 ATAPI Soft Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
n
8.1.2 Check Power Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.1.3 Execute Drive Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
i

8.1.4 Idle Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54


rR m

8.1.5 Nop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.1.6 Packet Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.1.7 ATAPI Identify Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
fo eli

[Link] General Configuration Word (0) . . . . . . . . . . . . . . . . . . . . . . . . 57


[Link] Serial Number (Words 10 - 19). . . . . . . . . . . . . . . . . . . . . . . . . 58
[Link] Buffer Type (Word 20) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Pr

[Link] Buffer Size (Word 21) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58


[Link] Firmware Revision (Words 23-26) . . . . . . . . . . . . . . . . . . . . . . . 58
[Link] Model Number (Words 27 - 46) . . . . . . . . . . . . . . . . . . . . . . . . 58
[Link] Capabilities Word (Word 49). . . . . . . . . . . . . . . . . . . . . . . . . . 58
[Link] PIO Data Transfer Cycle Timing (Word 51) . . . . . . . . . . . . . . . . . . 59
[Link] DMA Data Transfer Cycle Timing (Word 52) . . . . . . . . . . . . . . . . . 59
[Link] Field Validity (Word 53) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
[Link] Single Word DMA Transfer (Word 62) . . . . . . . . . . . . . . . . . . . . 59
[Link] Multi Word DMA Transfer (Word 63) . . . . . . . . . . . . . . . . . . . . . 59
[Link] Enhanced PIO Mode (Word 64) . . . . . . . . . . . . . . . . . . . . . . . . 59
[Link] Minimum Multi-word DMA Transfer Cycle Time per Word (Word 65) . . . 60
[Link] Manufacturer’s Recommended Multi-word DMA Transfer Cycle Time (Word
66) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
[Link] Minimum PIO Transfer Cycle Time Without Flow Control (Word 67) . . . . 60
[Link] Minimum PIO Transfer Cycle Time with IORDY Flow Control (Word 68) . 60
8.1.8 Set Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
[Link] Set Transfer Mode (03h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
[Link] Disable Reverting to Power On Defaults (66h) . . . . . . . . . . . . . . . . 62
[Link] Enable Reverting to Power On Defaults (CCh) . . . . . . . . . . . . . . . . 62
[Link] Disable Shared Interrupts (DDh) . . . . . . . . . . . . . . . . . . . . . . . . 62
[Link] Enable Shared Interrupts (5Dh) . . . . . . . . . . . . . . . . . . . . . . . . 62
8.1.9 Sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Page iii working draft AT Packet Interface


ATAPI CD-ROM Specification
February 24, 1994

Table of Contents
8.1.10 Standby Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
9.0 CD-ROM Packet Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
9.1 Packet Command Implementation Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 65
9.1.1 Reserved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
9.1.2 Operation Code Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
9.2 ATAPI Command Packet Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
9.2.1 Operation Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

nl t
9.2.2 Logical Block Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

O raf
9.2.3 Transfer Length. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.2.4 Parameter List Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.2.5 Allocation Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.3 Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.4 Immediate Command Processing Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 68

w D
y
9.5 Command Processing Considerations and Exception Conditions . . . . . . . . . . . . . . . . . . 68
9.5.1 Parameter Rounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.6 Unit Attention Condition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.7
9.8
ie ry
Commands and Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ATAPI Packet Commands for CD-ROM Devices. . . . . . . . . . . . . . . . . . . . .
9.8.1 AUDIO SCAN Command . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
. 69
. 70
. 71
ev a
9.8.2 INQUIRY Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
[Link] Standard INQUIRY Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
n
[Link] Using the INQUIRY Command . . . . . . . . . . . . . . . . . . . . . . . . 76
[Link] Vital Product Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
i

[Link] Vital Product Data Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 77


rR m

[Link].1 ASCII Implemented Operating Definition Page . . . . . 78


[Link].2 ASCII Information Page . . . . . . . . . . . . . . . . . 79
[Link].3 Supported Vital Product Data Pages . . . . . . . . . . . 80
fo eli

[Link].4 Unit Serial Number Page . . . . . . . . . . . . . . . . . 80


9.8.3 MODE SELECT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.8.4 MODE SENSE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Pr

[Link] Current Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86


[Link] Changeable Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
[Link] Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
[Link] Saved Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
[Link] Initial Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
9.8.5 Mode Select/Sense Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
[Link] CD-ROM Audio Control Parameters Page . . . . . . . . . . . . . . . . . . . 90
[Link] CD-ROM Device Parameters Page. . . . . . . . . . . . . . . . . . . . . . . 94
[Link] Read Error Recovery Parameters Page . . . . . . . . . . . . . . . . . . . . . 95
[Link] CD-ROM Capabilities and Mechanical Status Page . . . . . . . . . . . . . . 99
9.8.6 PAUSE/RESUME Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
9.8.7 PLAY AUDIO (10) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
[Link] Play Audio with Overlapped Packet Commands . . . . . . . . . . . . . . . .106
9.8.8 PLAY AUDIO (12) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
9.8.9 PLAY AUDIO MSF Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
9.8.10 PLAY AUDIO TRACK RELATIVE (10) Command . . . . . . . . . . . . . . . . . . .111
9.8.11 PLAY AUDIO TRACK RELATIVE (12) Command . . . . . . . . . . . . . . . . . . .113
9.8.12 PREVENT/ALLOW MEDIUM REMOVAL Command . . . . . . . . . . . . . . . . .115
9.8.13 READ (10) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
9.8.14 READ (12) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119
9.8.15 READ CD-ROM CAPACITY Command . . . . . . . . . . . . . . . . . . . . . . . . .121
9.8.16 READ CD Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123

Page iv working draft AT Packet Interface


ATAPI CD-ROM Specification

[Link] Description of Sub-channels R-W . . . . . . . . . . . . . . . . . . . . . . .130


9.8.17 READ CD MSF Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133
9.8.18 READ HEADER Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135
9.8.19 READ SUB-CHANNEL Command . . . . . . . . . . . . . . . . . . . . . . . . . . . .137
[Link] CD-ROM Current Position Data Format . . . . . . . . . . . . . . . . . . . .138
[Link] Media Catalogue Number Data Format . . . . . . . . . . . . . . . . . . . .141

nl t
[Link] Track International Standard Recording Code Data Format . . . . . . . . . .142

O raf
[Link] Caching of Sub-Channel Data . . . . . . . . . . . . . . . . . . . . . . . . .144
9.8.20 READ TOC Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145
[Link] Sub-channel Q TOC information . . . . . . . . . . . . . . . . . . . . . . . .149
[Link] Example Read TOC Operations . . . . . . . . . . . . . . . . . . . . . . . .151

w D
9.8.21 REQUEST SENSE Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153

y
[Link] Sense-key Specific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155
[Link] Deferred Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156
[Link] Sense-key and Sense Code Definitions. . . . . . . . . . . . . . . . . . . . .157

ie ry
[Link] Using the REQUEST SENSE Command . . . . . . . . . . . . . . . . . . .157
9.8.22 REZERO UNIT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161
9.8.23 SEEK Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163
ev a
9.8.24 SET CD-ROM SPEED Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165
9.8.25 STOP PLAY / SCAN CD-ROM Command . . . . . . . . . . . . . . . . . . . . . . . .167
n
9.8.26 START/STOP UNIT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169
9.8.27 TEST UNIT READY Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171
i
[Link] Using the TEST UNIT READY Command . . . . . . . . . . . . . . . . . .171
rR m

10.0 Physical Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173


10.1 CD-ROM Digital Audio Connector (Optional) . . . . . . . . . . . . . . . . . . . . . . . . . . .173
fo eli

10.2 CD-ROM Analog Audio Connector (Optional) . . . . . . . . . . . . . . . . . . . . . . . . . . .173


10.3 Device Configuration Jumper (Optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
10.4 Host IDE Interface Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
10.5 Power Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
Pr

A.1 Vendor Identification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176


B.1 ATAPI XA Packet Commands for CD-ROM Devices . . . . . . . . . . . . . . . . . . . . . . .179
B.1.1 PLAY CD-ROM XA Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179
B.1.2 SEND CD-ROM XA DATA (12) Command . . . . . . . . . . . . . . . . . . . . . . .181
C.1 Connectors / Jumpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183

working draft ATAPI Page v


Revision 1.2
February 23, 1994 2:30 pm

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page vi working draft ATAPI


ATAPI CD-ROM Specification
February 24, 1994

List Of Tables
Table 1 - Layout of the Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
Table 2 - Command and Status Usage for ATAPI Devices (Generic) . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 3 - Byte Count Register Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 4 - Preferred Drive Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Table 5 - I/O Port Functions/Selection Addresses (Compatibility Model) . . . . . . . . . . . . . . . . . . . . . . 39
Table 6 - Word Mapping of Task File Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table 7 - Example Mixed Mode CD-ROM Disc Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

nl t
Table 8 - Not Ready Error Reporting (by Command) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

O raf
Table 9 - MSF Address Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Table 10 - Error Conditions and Sense Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Table 11 - ATA Command and Status Usage for ATAPI CD-ROM Devices . . . . . . . . . . . . . . . . . . . . . 53
Table 12 - Identify Drive, Fields Supported by CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

w D
Table 13 - Identify Drive Data - General Configuration (Word 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

y
Table 14 - Identify Drive Data - Capabilities Word (49) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Table 15 - Contents of the Feature Register for Set Features Command . . . . . . . . . . . . . . . . . . . . . . . . 61
Table 16 - Set Feature Register Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Table 17 -
Table 18 -
Table 19 -
ie ry
Feature Number Description for Set Feature Command . . . . . . . . . . . . .
Operation Code Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Typical Command Packet for Most Commands . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
62
65
66
ev a
Table 20 - Typical Command Packet for Some Extended Commands . . . . . . . . . . . . . . . . . . . . . . . . . 66
Table 21 - Operation Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
n
Table 22 - Packet Commands Supported by CD-ROM Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Table 23 - AUDIO SCAN Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
i

Table 24 - Scan Starting Address in Logical Block Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72


rR m

Table 25 - Scan Starting Address in AMIN, ASEC and AFRAME Format . . . . . . . . . . . . . . . . . . . . . . 72


Table 26 - Scan Starting Address in Track Number (TNO) Format . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Table 27 - Recommended Sense Key, ASC and ASCQ for Audio Scan Command Errors . . . . . . . . . . . . . . 73
fo eli

Table 28 - INQUIRY Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75


Table 29 - INQUIRY Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Table 30 - Peripheral Device Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Pr

Table 31 - Vital Product Data Page Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78


Table 32 - ASCII Implemented Operating Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Table 33 - ASCII Information Page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Table 34 - Page Code 0: Supported VPD Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Table 35 - Unit Serial Number Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Table 36 - Recommended Sense Key, ASC and ASCQ for Inquiry Command Errors. . . . . . . . . . . . . . . . . 81
Table 37 - Mode Select Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Table 38 - Recommended Sense Key, ASC and ASCQ for Mode Select Command Errors . . . . . . . . . . . . . . 84
Table 39 - Mode Sense command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Table 40 - Page Control Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Table 41 - Recommended Sense Key, ASC and ASCQ for Mode Sense Command Errors . . . . . . . . . . . . . . 87
Table 42 - Mode Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Table 43 - Mode Page Codes for CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Table 44 - Mode Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Table 45 - Mode Parameter Header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Table 46 - CD-ROM Medium Type Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Table 47 - CD-ROM Audio Control Mode Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Table 48 - CDDA Output Port Channel Selection Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Table 49 - Attenuation Levels for Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Table 50 - CD-ROM Parameters Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Table 51 - Inactivity Time Multiplier Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Table 52 - Read Error Recovery Parameters Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Page vii working draft AT Packet Interface


ATAPI CD-ROM Specification
February 24, 1994

List Of Tables
Table 53 - Error Recovery Bit Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Table 54 - CD-ROM Error Recovery Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Table 55 - CD-ROM Capabilities and Mechanical Status Page Format . . . . . . . . . . . . . . . . . . . . . . . . 99
Table 56 - Example Data Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Table 57 - PAUSE/RESUME Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
Table 58 - Recommended Sense Key, ASC and ASCQ for Pause/Resume Command Errors . . . . . . . . . . . . .103
Table 59 - PLAY AUDIO Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105

nl t
Table 60 - Recommended Sense Key, ASC and ASCQ for Play Audio Command Errors . . . . . . . . . . . . . .106

O raf
Table 61 - Commands That Will Stop a Play Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
Table 62 - Commands That Will Not Stop a Play Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
Table 63 - PLAY AUDIO (12) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Table 64 - Recommended Sense Key, ASC and ASCQ for Play Audio (12) Command Errors . . . . . . . . . . . .108

w D
Table 65 - PLAY AUDIO MSF Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109

y
Table 66 - Recommended Sense Key, ASC and ASCQ for Play Audio MSF Command Errors . . . . . . . . . . .110
Table 67 - PLAY AUDIO TRACK RELATIVE (10) Command . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Table 68 - Recommended Sense Key, ASC and ASCQ for Play Track Relative (10) Command Errors . . . . . . .112
Table 69 -
Table 70 -
Table 71 -
ie ry
PLAY AUDIO TRACK RELATIVE (12) Command . . . . . . . . . . . . . . . . . . . .
Recommended Sense Key, ASC & ASCQ for Play Track Relative (12) Command Errors .
PREVENT ALLOW MEDIUM REMOVAL Command . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.113
.113
.115
ev a
Table 72 - Actions for Lock / Unlock / Eject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
Table 73 - Recommended Sense Key, ASC and ASCQ for Prevent/Allow Command Errors . . . . . . . . . . . . .116
n
Table 74 - READ (10) Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
Table 75 - Recommended Sense Key, ASC and ASCQ for READ (10) Command Errors . . . . . . . . . . . . . .118
i

Table 76 - READ (12) Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119


rR m

Table 77 - Recommended Sense Key, ASC and ASCQ for READ (12) Command Errors . . . . . . . . . . . . . .119
Table 78 - READ CD-ROM CAPACITY Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Table 79 - READ CAPACITY DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
fo eli

Table 80 - Recommended Sense Key, ASC and ASCQ for Read Capacity Command Errors . . . . . . . . . . . . .122
Table 81 - READ CD Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
Table 82 - READ-CD, Expected Sector Type Field Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
Pr

Table 83 - READ CD, Header Code Field Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124


Table 84 - READ CD, Error Flag Field Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
Table 85 - READ CD, Sub-channel Data Selection Field Definition . . . . . . . . . . . . . . . . . . . . . . . . .125
Table 86 - Number of Bytes Returned Based on Data Selection Field . . . . . . . . . . . . . . . . . . . . . . . . .126
Table 87 - Recommended Sense Key, ASC and ASCQ for Read CD Command Errors. . . . . . . . . . . . . . . .127
Table 88 - CD-DA (Digital Audio) Data Block Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
Table 89 - R-W Raw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131
Table 90 - R-W De-Interleaved & Error Corrected. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131
Table 91 - Sub-channel R-W, Allowed Mode/Item Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . .132
Table 92 - READ CD MSF Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133
Table 93 - Recommended Sense Key, ASC and ASCQ for Read CD MSF Command Errors. . . . . . . . . . . . .133
Table 94 - READ HEADER Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135
Table 95 - READ HEADER Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135
Table 96 - CD-ROM Data Mode Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136
Table 97 - Recommended Sense Key, ASC and ASCQ for Read Header Command Errors. . . . . . . . . . . . . .136
Table 98 - READ SUB-CHANNEL Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137
Table 99 - )Sub-channel Data Format Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138
Table 100 - Sub-channel Data Format Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138
Table 101 - CD-ROM Current Position Data Format (Format Code 01h). . . . . . . . . . . . . . . . . . . . . . . .138
Table 102 - Audio Status Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139
Table 103 - ADR Sub-channel Q Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140
Table 104 - Sub-channel Q Control Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140

Page viii working draft AT Packet Interface


ATAPI CD-ROM Specification
February 24, 1994

List Of Tables
Table 105 - Media Catalogue Number Data Format (Format Code 02h) . . . . . . . . . . . . . . . . . . . . . . . .141
Table 106 - UPC Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142
Table 107 - Track International Standard Recording Code Data Format . . . . . . . . . . . . . . . . . . . . . . . .142
Table 108 - Raw ISRC Format on the CD-ROM Disc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
Table 109 - ISRC Format of Data Returned to Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
Table 110 - Recommended Sense Key, ASC and ASCQ for Read Sub-channel Command Errors . . . . . . . . . . .144
Table 111 - READ TOC Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145

nl t
Table 112 - Read TOC Data Format (With Format Field = 00b) . . . . . . . . . . . . . . . . . . . . . . . . . . . .146

O raf
Table 113 - Read TOC Data Format (With Format Field = 01b) . . . . . . . . . . . . . . . . . . . . . . . . . . . .147
Table 114 - Read TOC Data Format (With Format Field = 10b) . . . . . . . . . . . . . . . . . . . . . . . . . . . .148
Table 115 - Recommended Sense Key, ASC and ASCQ for Read TOC Command Errors . . . . . . . . . . . . . . .148
Table 116 - Lead in Area (TOC), Sub-channel Q formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149

w D
Table 117 - Bit Definitions for the Control Field in Sub-channel Q . . . . . . . . . . . . . . . . . . . . . . . . . . .150

y
Table 118 - Values for Control Field in Sub-channel Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150
Table 119 - Example Read TOC Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151
Table 120 - Request Sense Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153
Table 121 -
Table 122 -
Table 123 -
ie ry
Request Sense Standard Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154
Field Pointer Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155
Field Pointer Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156
ev a
Table 124 - Sense Key Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157
Table 125 - ASC and ASCQ Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158
n
Table 126 - Recommended Sense Key, ASC and ASCQ for Request Sense Command Errors . . . . . . . . . . . . .159
Table 127 - REZERO UNIT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161
i

Table 128 - Recommended Sense Key, ASC and ASCQ for SEEK Command Errors . . . . . . . . . . . . . . . . .161
rR m

Table 129 - SEEK Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163


Table 130 - Recommended Sense Key, ASC and ASCQ for Seek Command Errors . . . . . . . . . . . . . . . . . .163
Table 131 - SET CD-ROM SPEED Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165
fo eli

Table 132 - Recommended Sense Key, ASC and ASCQ for SET CD-ROM SPEED Command Errors . . . . . . . .165
Table 133 - STOP PLAY / SCAN CD-ROM Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167
Table 134 - Recommended Sense Key, ASC and ASCQ for STOP PLAY CD-ROM Command Errors . . . . . . . .167
Pr

Table 135 - START/STOP UNIT Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169


Table 136 - Start/Stop and Eject Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169
Table 137 - Actions for Eject/Load Disc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170
Table 138 - Recommended Sense Key, ASC and ASCQ for SEEK Command Errors . . . . . . . . . . . . . . . . .170
Table 139 - Test Unit Ready Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171
Table 140 - Recommended Sense Key, ASC and ASCQ for MODE SELECT Command Errors . . . . . . . . . . .171
Table 141 - Vendor Identification List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .175
Table 142 - PLAY CD-ROM XA (12) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179
Table 143 - Recommended Sense Key, ASC and ASCQ for PLAY CD-ROM XA (12) Command Errors . . . . . .180
Table 144 - SEND CD-ROM XA DATA (12) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181
Table 145 - Recommended Sense Key, ASC and ASCQ for SEND CD-ROM XA ADPCM DATA Command Errors . .
182

Page ix working draft AT Packet Interface


ATAPI CD-ROM Specification
February 24, 1994

List Of Figures
Figure 1 - Packet Command with PIO Data In to Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 2 - Packet Command with PIO Data Out from Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 3 - Timing of Command Packet Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 4 - Timing of Data and Status Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 5 - SRST Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 6 - ATAPI Status Register (ATA Status Register) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 7 - ATAPI Error Register (ATA Error Register) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

nl t
Figure 8 - ATAPI Feature Register (ATA Feature Register). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

O raf
Figure 9 - ATAPI Byte Count Register (ATA Cylinder High/Low Register) . . . . . . . . . . . . . . . . . . . . . 41
Figure 10 - ATAPI Interrupt Reason Register (ATA Sector Count Register). . . . . . . . . . . . . . . . . . . . . . 42
Figure 11 - ATAPI Drive Select Register (ATA Drive / Head Select Register) . . . . . . . . . . . . . . . . . . . . 42
Figure 12 - ATAPI Device Control Register (ATA Device Control Register) . . . . . . . . . . . . . . . . . . . . . 42
Figure 13 - CD-ROM Sector Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

w D
y
Figure 14 - ADPCM Volume MUX / Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Figure 15 - Read CD Data Stream Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129
Figure 16 - Read CD Sub-channel, R-W (100b). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
Figure 17 -
Figure 18 -
Figure 19 -
ie ry
Stop Play/Play Audio/Audio Scan/Pause/Resume Sequencing . . .
CD-ROM Connectors (Rear View) . . . . . . . . . . . . . . . . .
Device Configuration Jumper . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.168
.173
.174
ev a i n
rR m
fo eli
Pr

Page x working draft AT Packet Interface


ATAPI CD-ROM Specification
Introduction

1.0 Introduction

The ATA/IDE interface has become a de facto industry standard for connection of disk drives in PC‘s. In the interest of
simplicity and cost, the ATA/IDE interface was originally designed to support only a small subset of computer peripher-
als. The expanding use of multimedia, inexpensive program distribution on CD ROM, and faster and more powerful sys-
tems has created the need for enhancements to ATA. Currently, efforts are under way (Enhanced IDE, SFF-8011, SFF-

nl t
8033, ATA-2) to expand ATA/IDE to provide the following enhancements:

O raf
• Support for drives larger than 528 MB.
• Support for two connectors to allow up to four drives.

w D
• Support for CD-ROM and tape peripherals.

y
• Support for 11.1/16.6 Mbytes/second, I/O Channel Ready PIO data transfers
• Support for 13.3/16.6 Mbytes/second DMA data transfers

ie ry
This document addresses only the CD-ROM connection issues. There is no generally accessible standard for connection
ev a
of CD-ROM devices. Several “native” interfaces exist, but they are vendor-unique. There is the SCSI Interface, which
along with the Microsoft MS-DOS CD-ROM Extensions provides an actual standard, but most systems do not ship with
n
an imbedded SCSI interface. Thus, it seemed obvious to provide a simple and inexpensive CD-ROM interface by provid-
ing a superset of ATA for that purpose.
i
rR m

1.1 Abstract
fo eli

This document defines a standard method for interfacing to a CD-ROM Drive utilizing the existing ATA host computer
hardware and cabling. This specification supplements the definitions of an ATA mass storage peripheral found in the
ATA document. The ATAPI and CD-ROM interfaces described in this document are compatible with existing ATA hard-
Pr

ware without any changes or additional pins.

1.2 Secretariat
The Small Form Factor Committee is an ad hoc group formed to address disk industry needs in a prompt manner. When
formed in 1990, the original goals were limited to defining de facto mechanical envelopes for disk drives so they
could fit into laptop computers and other small products.

In November 1992, the SFF Committee objectives were broadened to encompass areas other than mechanical form fac-
tors for drives, which needed prompt industry action. SFF Specifications are narrow in scope, to reduce development
time.

working draft ATAPI Page 1


Revision 1.2 Introduction
February 23, 1994 2:42 pm Secretariat

There are several projects active within the Small Form Factor Committee. At the date of printing document numbers
had been assigned to the following projects. The status of Specifications is dependent on committee activities.

Spec # Rev. SFF Document Titles Status Pages

nl t
SFF-8001 1.0 44-pin ATA (AT Attachment) Pinouts for SFF Drives FP 14

O raf
SFF-8002 2.0 68-pin ATA (AT Attachment) for SFF Drives FP 16

SFF-8003 1.1 SCSI Pinouts for SFF Drives P 14

SFF-8004 1.0 Small Form Factor 2.5" Drives A 14

w D
y
SFF-8005 2.3 Small Form Factor 1.8" Drives FP 14

SFF-8006 2.0 Small Form Factor 1.3" Drives FP 16

ie ry
SFF-8007 0.1 SFF Connector Alternatives D 14

SFF-8008 2.2 68-pin Embedded Interface for SFF Drives P 12


ev a
SFF-8009 2.1 Unitized Connector for Cabled Drives P 12
n
SFF-8010 1.0 Small Form Factor 15mm 1.8" Drives FP 14
i
SFF-8011 1.1 ATA Timing Extensions for Local Bus FP 18
rR m

SFF-8012 1.0 Power Connector Pin Dimensions FP 10

SFF-8013 0.1 ATA Download Microcode Command Fs 8


fo eli

SFF-8014 Unitized Connector for Rack Mounted Drives D n/a

SFF-8015 Single Connector for Rack Mounted Drives D n/a


Pr

SFF-8016 Small Form Factor 10mm 2.5” Drives C n/a

SFF-8017 0.1 A-Cable SCSI on a 68-pin Connector D 12

SFF-8018 0.1 ATA Low Power Modes Fs 8

SFF-8019 0.2 Identify Drive Data for ATA Disks over 528 MB D 10

SFF-8020 1.2 ATA Packet Interface for CD-ROMs D 200

n/a = No document available yet

F = Forwarded The document has been approved by the members for forwarding to a formal standards body.
P = Published The document has been balloted by members and is available as a published SFF Specification.
A = Approved The document has been approved by ballot of the members and is in preparation as an SFF Specifica-
tion.
D = Development The document is under development at SFF.
E = Expired The document has been published as an SFF Specification, and the members voted against
re-publishing it when it came up for annual review.
s = submitted The document is a proposal to the members for consideration to become an SFF Specification.

FD A Specification in Development Forwarded to a standards committee.


FA An Approved Specification Forwarded to a standards committee.
FP A Published Specification Forwarded to a standards committee.
Fs A submitted proposal Forwarded directly to a standards committee.

Page 2 working draft ATAPI


ATAPI CD-ROM Specification
Introduction

The SFF Committee complements the formal standards process. Some industry needs cannot be addressed by standards
because of timing, or charter, or some other consideration. This is a gap the Small Form Factor Committee fills.

It is anticipated that most Specifications will be Forwarded to an accredited standards body such as EIA (Electronic In-
dustries Association) or ASC (Accredited Standards Committee) X3T9. They may be accepted for separate standards, or
incorporated into other standards activities.

nl t
O raf
The members decision to forward is based on a wide variety of factors, and a document can be forwarded at any stage in
its development cycle. For example, if a proposal is under development within SFF, and a standards project begins in a
similar area. The SFF members might submit the draft of the SFF Specification to the standards committee rather than
operate a parallel effort.

w D
y
In the case of proposals submitted to SFF which now have a status of Fs, the proposal never became an SFF project or
specification. Instead the proposal was forwarded to the appropriate standards body for further consideration. A copy of

ie ry
the proposal submitted to SFF remains available for historical purposes, however, the contents may no longer be valid.
The latest documentation for forwarded SFF specifications should be obtained from the committee the proposal was for-
warded to. The best way to track standards activity is to subscribe to the document service for X3T9 subcommittees:
ev a
CBEMA X3 Secretariat: Ph: 202-737-8888
n
1250 Eye St. #200 Fax: 202-638-4922
Washington DC 20005
i
rR m

Copies of SFF Specifications are available by FaxAccess or by joining the SFF


Committee as an Observer ($300 or $400 overseas) or Member ($3,000).
fo eli

14426 Black Walnut Ct Ph: 408-867-6630x303 Email: 250-1752@[Link]


Saratoga CA 95070 Fax: 408-867-2115 FaxAccess: 408-741-1600
Pr

1.3 Summary of SFF Principals


Documents created by the SFF Committee are expected to be submitted to accredited standards bodies such as EIA
(Electronic Industries Association) or ASC (Accredited Standards Committee) X3T9. They may be accepted for sepa-
rate standards, or incorporated into other standards activities. The principles of operation for the SFF Committee are not
unlike those of an accredited standards committee. There are 3 levels of participation:

- Attending the meetings is open to all, but taking part in discussions is limited to member companies, or those invited
by member companies.

- The minutes and copies of material which are discussed during meetings are distributed only to those who sign up to
receive documentation.

- The individuals who represent member companies of the SFF Committee receive documentation and vote on issues
that arise. Votes are not taken during meetings, only guidance on directions. All voting is by letter ballot, which en-
sures all members an equal opportunity to be heard.

Material presented at SFF Committee meetings becomes public domain. There are no restrictions on the open mailing of
material presented at committee meetings. In order to reduce disagreements and misunderstandings, copies must be pro-
vided for all agenda items that are discussed. Copies of the material presented, or revisions if completed in time, are in-
cluded in the documentation mailings.

The sites for SFF Committee meetings rotate based on which member companies volunteer to host the meetings. Meet-
ings have typically been held on the first day of the X3T9 Working Group weeks (the third week of odd months).

working draft ATAPI Page 3


Revision 1.2 Introduction
February 23, 1994 2:42 pm SFF Membership and Fees

1.4 SFF Membership and Fees


The funds received from the annual membership fees are placed in escrow, and are used to reimburse ENDL for the ser-
vices to manage the SFF Committee.

Annual SFF Committee Membership Fee $ 3,000.00


Annual SFF Committee Documentation Fee $ 300.00

nl t
Annual Surcharge for AIR MAIL to Overseas $ 100.00

O raf
Funds received will be retained in escrow until earned and will be
accounted for to the members of the SFF Committee.

w D
To join SFF, fill out the form below and indicate the method of payment.

y
Name: _______________________________

ie ry
Title: _______________________________

Company: _______________________________
ev na
Address: _______________________________

_______________________________
i
rR m

_______________________________
fo eli

Phone: _______________________________

Fax: _______________________________
Pr

Email: _______________________________

Please register me as the company representative on the SFF


Committee ($3,000 fee includes documentation).

Check Payable to SFF Committee is Enclosed: ____

Please Invoice me: ___ PO #: __________________

Signature: _____________________________________

Please register me to receive documentation on activities of the SFF Committee.

Check Payable to SFF Committee: U.S. $ 300


(POs Not Accepted) Overseas $ 400

Signature: _____________________________________

Fax POs to: 408 867-2115 Mail Checks to: 14426 Black Walnut Ct.
..................... Saratoga, CA 95070

Page 4 working draft ATAPI


ATAPI CD-ROM Specification
Introduction

1.5 Scope
This document is intended to be used with the ATA document. Its purpose is to highlight those areas of implementation
in which the CD-ROM Interface and the ATA document differ. In addition, it indicates areas within the ATA document
which are modified for operation in the CD-ROM environment. Both mandatory and optional specifications are present-
ed.

nl t
In the event of a conflict between one of the base documents (ATA / SCSI CD-ROM) and this document, the interpreta-

O raf
tion of this document shall prevail only if this document acknowledges that a conflict exists between the documents.

This document provides a description for the ATAPI Transport Protocol (TP), ATAPI Transport Mechanism (TM) as
well as a CD-ROM Command Protocol (CP).

w D
y
ie ry
CD-ROM Commands ATA Commands Other Commands
ev a
Commands
i n
ATA Task File ATAPI
rR m

Transport Protocol (TP)


Protocols
fo eli

ATA Hardware ATAPI PCMCIA


Transport Mechanism (TM)
Pr

Interconnects

1.6 Audience
This document is intended for use by Computer System, CD-ROM Peripheral, and CD-ROM chip set vendors.

1.7 Normative References


The following standards contain provisions which, when referenced in the text of this standard, constitute provisions of
this Specification. At the time of publication, the editions indicated were valid. All standards are subject to revision, and
parties to agreements based on this Specification are encouraged to investigate the possibility of applying the most re-
cent editions of the standards indicated below. Members of IEC and ISO maintain registers of currently valid Internation-
al Standards.

ISO/IEC 10149:1989, Information technology - Data Interchange on Read-only 120 mm Optical Data Disks (CD-
ROM).
IEC 908:1987, Compact Disk Digital Audio System.
American National Standard ANSI X3T9.2/375R revision 10k, Small Computer System Interface.
American National Standard ANSI X3T9.2/791D revision 4a, April 19, 1993, CBEMA ATA (AT Attachment).

working draft ATAPI Page 5


Revision 1.2 Introduction
February 23, 1994 2:42 pm Prerequisites and Related Documents

1.8 Prerequisites and Related Documents


The reader is expected to have a basic understanding of the AT hardware and software interfaces as well as the ATA Doc-
ument. Specifically, the following documents are required for understanding and implementing an ATA CD-ROM be-
cause this document is based on them:

• CBEMA, ATA (AT Attachment) ANSI Draft Standard, Revision 4a, April 19, 1993, Document

nl t
Number X3T9.2/791D, Computer and Business Equipment Manufacturer’s Association. This is

O raf
referred to as the ATA Document.
• ANSI X3T9.2/375R, Small Computer System Interface
• AT bus specification

w D
y
• SFF-8011 Rev. 1.2, ATA Timing Extensions for Local Bus Attachment.
• Red, Yellow, Green, Orange Books and CD-ROM XA Specification.

ie ry
1.9 Layout of the Document
This document is broken into several sections:
ev na
Table 1 - Layout of the Document
Section "1.0 Introduction" on page 1 Introduction, scope, purpose etc. SFF-8021
i
Section "2.0 General" on page 9 Details the current requirements, assump-
rR m

tions and goals.


Section "3.0 Conventions" on page 11 Describes conventions used in the docu-
ment, and a definitions of terms and sig-
fo eli

nals.
Section "4.0 ATAPI Overview" on page 17 Overview of the Packet Interface and how SFF-8022
the “Layering” of SCSI and ATA occurs.
Pr

Section "5.0 ATAPI Protocol" on page 21 Describes the actual “Protocol” used for
the new Packet Command.
Section "6.0 ATAPI Transport Mechanism" on page 35 Describes ATAPI register and hardware
usage of the ATA Interface.
section 7.0, "CD-ROM Model", on page 43 Overview and general comments on CD- SFF-8023
ROM device functions and media formats.
section 8.0, "CD-ROM ATA (Task File) Commands", on page 53 ATA Task File Command set definition for
the CD-ROM peripheral type.
Section "9.0 CD-ROM Packet Commands" on page 65 SCSI Command Subset definition for the SFF-8024
CD-ROM peripheral type.
Section "10.0 Physical Interface" on page 173 Describes the physical Host Interface, SFF-8025
connectors and their placement.
Annex “A” Vendor Identification Provides informative reference material SFF-8026
Annex “B” CD ROM XA Commands and describes extended features and com- SFF-8027
Annex “C” Audio Connectors mands which will very likely be imple- SFF-8028
ment by some CD-ROM manufacturers.
Annex ”D” Errata sheet for SFF-8020 rev 1.2 Identifies current editorial & technical cor- SFF-8029
rections made to SFF-8020 rev 1.2.

To simplify retrieval of this document via the SFF FaxAccess system, the individual sections of this document are avail-
able as individual SFF FaxAccess documents. Unless you have a plain paper fax machine with the ability to print 300
pages in a single fax, you should request the individual sections. Request SFF-8020 to receive the entire document or re-
quest any of the numbers between 8021 and 8029 to receive the individual section(s) identified in the table above.

Page 6 working draft ATAPI


ATAPI CD-ROM Specification
Introduction

1.10 Patents
The developers of this specification have requested that holders of patents that may be required for the implementation
of the specification, disclose such patents to the publisher. However, neither the developers nor the publisher have under-
taken a patent search in order to identify which, if any, patents apply to this specification.

No position is taken with respect to the validity of any claim or any patent rights that may have been disclosed. Details of

nl t
submitted statements may be obtained from the publisher concerning any statement of patents and willingness to grant a

O raf
license under these rights on reasonable and nondiscriminatory terms and conditions to applicants desiring to obtain
such a license.

w D
y
ie ry
ev a i n
rR m
fo eli
Pr

working draft ATAPI Page 7


Revision 1.2 Introduction
February 23, 1994 2:42 pm Patents

nl t
O raf
w D
y
ie ry
ev a i n
Intentionally Left Blank
rR m
fo eli
Pr

Page 8 working draft ATAPI


ATAPI CD-ROM Specification
General

2.0 General

2.1 Overview
The primary objective of this Standard is to provide an inexpensive CD-ROM interface. The existing ATA does not pro-
vide an adequate command structure to support CD-ROM devices. Although the inclusion of a CD-ROM drive would

nl t
compromise the performance of another disk on the same ATA Cable, this standard does not attempt to address the “Per-

O raf
formance” issues.

2.2 Feature Summary

w D
y
This section provides an abbreviated list of the perceived requirements upon which the development of this specification
was based.

ie ry
• Do not break any existing ATA drive connections when the CD-ROM is attached, e.g., com-
pletely compatible with existing hardware and drivers.
ev a
• Prevent BIOS and O/S recognition of ATAPI Peripherals as hard disk drives.
• Allow the ATA cable and I/O registers to support one ATA drive and one CD-ROM peripheral.
n
• Support for the ATA master / slave protocol.
i
rR m

• Support for 8-bit Task File registers and 16-bit data transfer register.
• Reset the peripheral into a known state.
• Provide a status indication of Peripheral Ready to accept commands.
fo eli

• Provide capability for sending CDB like (Command Packet Bytes) to the peripheral.
• Support for command packets of at least 12 bytes in length.
Pr

• Capability to indicate to the Host computer when Command Packet can be transferred.
• Capability to Interrupt the Host computer when data can be transferred.
• Capability to Interrupt the Host computer when command complete.
• Send & Receive Data bytes using PIO.
• Provide a simple DMA capability.
• Capable of transferring variable length data packets. (Drive indicates to Host amount to transfer.)
• Send Status of command operation (Error / Done / Data Ready...) to the host computer.
• Enable and disable interrupts from the peripheral.
• Detect when a peripheral is interrupting (Which & Why.)
• Detect when an ATAPI peripheral is attached to the ATA Cable.
• Support for both primary and secondary ATA addressing / cable.
• Support for SFF-8011 ATA Timing Extensions for Local Bus.
• Support for the CD-DA, CD-XA, Multi Session and Hybrid (Photo CD) formats.
• Support for multiple speed drives.
• Support multiple block sizes (i.e. 2048, 2052, 2056, 2324, 2332, 2336, 2340 & 2352)

working draft ATAPI Page 9


Revision 1.2 General
February 23, 1994 2:42 pm Feature Summary

nl t
O raf
w D
y
ie ry
ev a i n
Intentionally Left Blank
rR m
fo eli
Pr

Page 10 working draft ATAPI


ATAPI CD-ROM Specification
Conventions

3.0 Conventions

3.1 Document Conventions


Certain words and terms used in this document have specific meaning beyond the normal English meaning. These words
and terms are defined either in this section or in the text where they first appear. Names of signals, commands, statuses,

nl t
and sense keys are in all uppercase (e.g. REQUEST SENSE). Lower case is used for words having the normal English

O raf
meaning.

Fields containing only one bit are usually referred to as the <name> bit instead of the <name> field. Numbers that are
not immediately followed by a lower case b or h are decimal (0xnn for Hexadecimal, where nn refers to two hexadecimal

w D
digits 0-9, A-F.)

y
ie ry
3.2 Signal Conventions
Signal names are shown in all upper case letters. Signals can be asserted (active, true) in either a high (more positive
ev a
voltage) or low (less positive voltage) state. A dash character (-) at the beginning or end of a signal name indicates it is
asserted at the low level (active low). No dash or a plus character (+) at the beginning or end of a signal name indicates
n
it is asserted high (active high). An asserted signal may be driven high or low by an active circuit, or it may be allowed to
be pulled to the correct state by the bias circuitry.
i
rR m

Control signals that are asserted for one function when high and asserted for another function when low are named with
the asserted high function name followed by a slash character (/), and the asserted low function name followed with a
dash (-) e.g. BITENA/BITCLR- enables a bit when high and clears a bit when low. All signals are TTL-compatible un-
fo eli

less otherwise noted. “Negated” means that the signal is driven by an active circuit to the state opposite to the asserted
state (inactive, or false) or may be simply released (in which case the bias circuitry pulls it inactive, or false) at the option
of the implementor.
Pr

Control signals that may be used for two mutually exclusive functions are identified with their two names separated by a
colon e.g. SPSYNC:CSEL can be used for either the Spindle Sync or the Cable Select functions.

3.3 Definitions

3.3.1 Absolute F Field


Absolute F field is the least significant part of the absolute physical address from the beginning of the media. It is written
on CD-ROM media in binary-coded decimal notation. The value ranges from 00to 74.

3.3.2 Absolute M Field


Absolute M field is the most significant part of the absolute physical address from the beginning of the media. It is writ-
ten on CD-ROM media in binary-coded decimal notation. The value ranges from 00 to 99.

3.3.3 Absolute S Field


Absolute S field is the intermediate significant part of the absolute physical address from the beginning of the media. It
is written on CD- ROM media in binary-coded decimal notation. The value ranges from 00 to 59.

working draft ATAPI Page 11


Revision 1.2 Conventions
February 23, 1994 2:42 pm Definitions

3.3.4 ATA (AT Attachment)


ATA defines a compatible register set and a 40-pin connector and its associated signals.

3.3.5 BCD
Binary coded decimal: The number system used on the physical CD-ROM and CD-DA media. Numbers that use this no-

nl t
tation have the ‘bcd’ suffix attached. A byte has two 4-bit values, each of which can have a value from 0 to 9. The maxi-

O raf
mum value is 99bcd (99 decimal).

Example: 00 01 02 03... 08 09 10 11... 19 20 21... 98 99.

w D
y
3.3.6 Block
The term “block” refers to the data in one logical block; the number of bytes in a block is defined by the logical block

ie ry
length in the mode block descriptor.

3.3.7 Blocks Per Sector


ev a
“Blocks per sector” is the number of logical blocks read from each CD-ROM physical sector. The value depends on the
n
logical block length as defined in the mode block descriptor. The value for blocks per sector is:
i
1 if the logical block length is 2048, 8 if the logical block length is 256 bytes.
rR m

(Assuming a density code of 1 -- 2048 bytes of data per sector.)


fo eli

3.3.8 Command Packet (CP)


“Command Packet” is the structure used to communicate commands from a host computer to an ATAPI device.
Pr

3.3.9 CD-DA
Compact Disc-Digital Audio (CD-DA) is the standardized medium for recording digital/audio information. The ‘Red
Book’ defines CD-DA media.

3.3.10 CD-ROM
Compact Disc - Read Only Memory (CD-ROM) is the standardized medium for recording digitized audio and digital da-
ta. CD-ROM is used to describe media with digital data rather than discs that encode audio only. The ISO/IEC 10149
standard defines CD-ROM media.

3.3.11 CD-ROM Control Field


The CD-ROM Control Field is a 4-bit field in the Q sub-channel data indicating the type of information encoded on the
current track. It indicates audio versus data and the type of audio encoding, etc. The control field is also found in the ta-
ble of contents entries.

3.3.12 CD-ROM Data Mode


A byte in the header of CD-ROM data sectors. This indicates if data is present and if layered error correction informa-
tion is present.

Page 12 working draft ATAPI


ATAPI CD-ROM Specification
Conventions

3.3.13 CHS (Cylinder-Head-Sector)


This is an ATA term defining the addressing mode of the drive as being by physical address. This form of addressing is
not used by ATAPI Devices.

3.3.14 CIRC

nl t
Cross Interleaved Reed-Solomon Code (CIRC) is the error detection and correction technique used within small frames

O raf
of audio or data. The CIRC bytes are present in all CD-ROM data modes. The error correction procedure which uses the
CIRC bytes is referred to as the CIRC based algorithm. In most CD-ROM drives, this function is implemented in hard-
ware.

w D
y
3.3.15 Data Block
This term describes a data transfer, and is typically a single sector, except when declared otherwise by use of the Set

ie ry
Multiple command.

3.3.16 DMA (Direct Memory Access)


ev a
DMA is a means of data transfer between peripheral and host memory without processor intervention.
i n
3.3.17 Field
rR m

A field is a group of one or more contiguous bits.


fo eli

3.3.18 Frame
A frame is a physical sector on CD-ROM media or the F field unit of a MSF CD-ROM address. The term frame is also
used in the CD-ROM model to describe the amount of data received between synchronization patterns. Ninety-eight
Pr

frames make a sector. This sort of frame is referred to as a ‘small frame’ when the meaning is not clear from the context.

3.3.19 Hold Track State


When a CD-ROM device enters the hold track state the optical pick-up is maintained at an approximately constant posi-
tion on the media. This allows a paused operation to be resumed without latency due to seeking. However, rotational la-
tency may be incurred.

3.3.20 Index
An index is a subdivision of a CD-ROM track. A track can have from 1 to 99 index numbers. Index numbers within a
track are sequential, starting with 1.

3.3.21 Invalid
Invalid refers to an illegal (reserved) or unsupported field or code value.

3.3.22 LBA (Logical Block Address)


The LBA defines the addressing mode of the drive by the linear mapping of sectors from 0 to n.

working draft ATAPI Page 13


Revision 1.2 Conventions
February 23, 1994 2:42 pm Definitions

3.3.23 Logical Block


A Logical Block is a unit of data supplied or requested by a host computer.

3.3.24 Lead-in Area


The Lead-in Area is the area on a CD-ROM disc preceding track one. The main channel in the lead-in area contains au-

nl t
dio or data null information. This area is coded as track zero but is not addressable via the ATA CD-ROM command set.

O raf
The Q sub-channel in this area is coded with the table of contents information.

3.3.25 Lead-out Area

w D
y
The Lead-out Area is the area on a CD-ROM disc beyond the last information track. The main channel in the lead-out
area contains audio or data null information. This area is coded as track AA bcd but is not addressable via the ATA CD-
ROM command set. The READ CD-ROM CAPACITY data is the first logical block address of this area minus one.

3.3.26 L-EC

ie ry
ev a
Layered Error Correction (L-EC) is the error correction technique used with CD-ROM (data mode one) sectors. In such
sectors, 276 bytes of the auxiliary data field contain L-EC bytes. The algorithm that uses these bytes to perform error cor-
n
rection is often implemented in the drive firmware.
i
rR m

3.3.27 LUN
Logical Unit Number.
fo eli

3.3.28 Mandatory
“Mandatory” indicates that a referenced item is required to claim compliance with this standard.
Pr

3.3.29 MSF Address


The MSF Address is the physical address written on CD-ROM discs. It is expressed as a sector count relative to either
the beginning of the medium (absolute) or to the beginning of the current track (relative). As defined by the CD-DA and
CD-ROM standards, each F field unit is one physical sector; each S field unit is 75 F field units; each M field unit is 60 S
field units. Valid contents of F fields are binary values from 0 through 74. Valid contents of S fields are binary values
from 0 through 59. Valid contents of M fields are binary values from 0 through 99.

3.3.30 One
“One” represents a true signal value or a true condition of a variable.

3.3.31 Optional
“Optional” describes features which are not required by the standard. However, if any feature defined by the standard is
implemented, it shall be done in the same way as defined by the standard. Describing a feature as optional in the text is
done to assist the reader. If there is a conflict between text and tables on a feature described as optional, the table shall
be accepted as being correct.

3.3.32 Output Port


The Output Port is a means for connecting the audio signal being played to equipment outside the CD-ROM device.

Page 14 working draft ATAPI


ATAPI CD-ROM Specification
Conventions

3.3.33 Page
Several commands use regular parameter structures that are referred to as pages. These pages are identified with a value
known as a page code.

3.3.34 Pause Area

nl t
A “pause area” is a transition area at the beginning or end of an audio track encoded with audio silence. This transition

O raf
area is required where the audio track immediately precedes a data track.

3.3.35 PIO (Programmed Input/Output)

w D
y
PIO is a means of data transfer that requires the use of the host processor.

3.3.36 Post-gap Area

ie ry
Post-gap Area is a transition area at the end of a data track encoded with null information. This transition area is re-
quired where the data track immediately precedes an audio track.
ev a n
3.3.37 Pre-gap Area
Pre-gap Area is a transition area at the beginning of a data track encoded with null information. This transition area is re-
i
rR m

quired where the data track immediately follows an audio track.

3.3.38 Relative F Field


fo eli

The sub-division of the S field part of the relative physical address from the beginning of the current track. One physical
sector. Written on CD-ROM medium in binary coded decimal notation. The value is from 00bcd to 74bcd.
Pr

3.3.39 Relative M Field


Relative M Field is the most significant part of the relative physical address from the beginning of the current track. It is
written on CD- ROM media in binary-coded decimal notation. The value is from 00bcd to 99bcd.

3.3.40 Relative S Field


Relative S Field is the intermediate significant part of the relative physical address from the beginning of the current
track. It is written on CD-ROM medium in binary-coded decimal notation. The value is from 00bcd to 59bcd.

3.3.41 SAM
SCSI Architectural Model.

3.3.42 Reserved
Reserved bits, fields, bytes, and code values are set aside for future standardization. Their use and interpretation may be
specified by future extensions to this or other standards. A reserved bit, field, or byte shall be set to zero, or in accor-
dance with a future extension to this standard. The recipient shall not check reserved fields.

3.3.43 Sector
“Sector” refers to the data contained by one frame time. (On CD-DA medium with two channels of audio this is 1/75th

working draft ATAPI Page 15


Revision 1.2 Conventions
February 23, 1994 2:42 pm Symbols and Abbreviations

of a second). In the CD-ROM standard document the term block is used for this unit. There may be more than one logi-
cal block per sector. Similarly, a single logical block may map to multiple sectors.

3.3.44 Status
Status is one byte of information sent from the ATA CD-ROM to the host computer upon completion of each command.

nl t
O raf
3.3.45 Sub-channel
CD-ROM and CD-DA media have a main channel and a sub-channel. The sub-channel area has eight parts called P, Q,
R, S, T, U, V, and W. The Q-sub-channel contains information useful to the controller and drive, such as the control field

w D
and MSF addresses. The data rate of each sub-channel (P, Q, etc.) is 1/192nd of that of the main channel.

y
3.3.46 TOC

ie ry
The table of contents has information on the type of disc and the starting address of the tracks. This information is encod-
ed in the Q sub-channel.
ev a
3.3.47 Track
n
A track is a sub-division of the CD-ROM media. A disc has from one to ninety-nine tracks. The data within a track is al-
i
ways of the same type. A track can be either CD-ROM or CD-Audio. A disc can start at any track number.
rR m

3.3.48 Track Relative Logical Address


fo eli

Track Relative Logical Address is an offset from the beginning of the recorded information on a track expressed in units
of the logical block length. The value is used to address logical blocks relative to the beginning of a track using the rela-
tive MSF address encoded in the CD-ROM Q sub-channel.
Pr

3.3.49 Transition Area


Sectors at the beginning or end of tracks that are coded with null information are called transition areas. Where required
by the media standards, these areas have minimum lengths of 1 s or 2 s. The maximum lengths are not specified. Transi-
tion areas at the beginning of a track are encoded with index zero. Addresses within transition areas may not be read.

3.3.50 VU (Vendor Unique)


The term, VU, is used to describe bits, bytes, fields, code values and features which are not described in this standard,
and may be used in a way that varies between vendors.

3.3.51 Zero
Zero is a false signal value or a false condition of a variable.

3.4 Symbols and Abbreviations


AWG American Wire Gauge
LSB Least significant bit
LUN Logical unit number
MSB Most significant bit

Page 16 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Overview

4.0 ATAPI Overview


The purpose of the ATAPI is to provide a more extensible and general purpose interface than the ATA Task file.

Although the attachment of a CD-ROM on the ATAPI Interface will utilize the ATA Host Hardware and Task File, the
logical interface will differ slightly and will need to support additional capabilities. The Mass Storage devices connected
to the ATA make use of eight registers (Task File) that contain the command and all parameters needed for operation.

nl t
However, eight registers is not enough to pass all the needed information for commanding other peripheral types. To rem-

O raf
edy this, the ATAPI Device will receive its commands through the use of a Packet mode, in addition to the normal ATA
protocol. The Packet Command will complement the existing ATA commands. The ATAPI Device shall support all of the
ATA specified protocol, including the Reset Master/Slave Diagnostic Sequence, Diagnostic Command, and Command
Abort for unsupported Commands. The ATAPI Device shall also support both the Master and Slave modes of operation.

w D
y
4.1 ATA Signal Utilization

ie ry
ATAPI Devices will utilize the same signals and timing from the ATA Standard and Extensions.

4.2 ATA Command Utilization


ev a
The ATA Task File concept does not contain enough bytes to support some of the CD-ROM command structures, so a
n
new command called “Packet Command” has been added to allow a Packet to be sent to the Device. The Packet will be
transferred by writing multiple times to the Data Register. No random access to the register file in the Peripheral can be
i
done. This technique reduces the number of register addresses needed, but not the actual space needed. Although all the
rR m

commands for the CD-ROM Device could be sent via this packet mode, it is believed that some of the existing ATA com-
mands and the full ATA command protocol must be provided for the existing drivers to operate correctly. The CD-ROM
Device will therefore support some existing ATA commands in addition to the new “Packet command”, so that there will
fo eli

be minimal changes to the existing drivers. This minimal set of ATA commands is different than the minimum as defined
in the ATA standard, but should be sufficient for normal operation.
Pr

4.3 ATA Compatibility


There are several backward compatibility issues with the existing ATA commands, and therefore the ATAPI CD-ROM
Device will respond to the existing ATA Reset Master/Slave Diagnostic Sequence, but not the Identify Drive or Read
commands. This will allow the BIOS and older drivers to ignore the CD-ROM Device and not confuse CD-ROM data
with normal ATA Drive format data. All unsupported ATA commands shall be Aborted, and not executed. As with abort-
ed commands in ATA, an interrupt will be generated to signal the completion with an “aborted” error status.

4.4 Packet Types


To allow for generic packet transfer and the connection of SCSI like peripherals, there shall exist a minimum set of infor-
mation that is exchanged. This information shall generically support the following:

• Command Packet (Always padded to number of bytes identified in byte 0 of the identify drive da-
ta. 00 = 12 bytes, 01 = 16 bytes)
• Command Parameter Data (e.g. Write Data etc.)
• Command Response Data (e.g. Read Data etc.)
• Status. The Status will not take the form of a packet of information. The status will be presented
using the ATAPI Status Register (redefinitions of the ATA Status Register).

working draft ATAPI Page 17


Revision 1.2 ATAPI Overview
February 23, 1994 2:40 pm Packet Types

Table 2 - Command and Status Usage for ATAPI Devices (Generic)


Command Used Code Error Register Status Register
BBK UNC IDNF ABRT TKONF AMNF DRDY DWF DSC CORR ERR

nl t
Acknowledge media N DB V V

O raf
change
Boot - post-boot N DC V V
Boot - pre-boot N DD V V
Check power mode M E5 V V V V V

w D
y
Door lock O DE V V V V
Door unlock O DF V V
Execute drive diags M 90 Special Drive Diagnostic Errors V

ie ry
Format track O1 50 V V V V V V
Identify drive N EC V V
Idle O E3 V V V V V
ev a
Idle immediate M E1 V V V V V
Initialize drive parms N2 91 V V
n
NOP M 00 V V
ATAPI Pkt. Command M A0 Contains Packet Command Status V V V
i
rR m

ATAPI Identify Device M A1 V V V V V


ATAPI Soft Reset M 08
Read buffer N E4 V V
fo eli

Read DMA (w/retry) N C8 V V


Read DMA (wo/retry) N C9 V V
Read long (w/retry) N2 22 V V
N2
Pr

Read long (wo/retry) 23 V V


Read multiple N C4 V V
Read sector(s) (w/retry) N2 20 V V
Read sector(s) (wo/retry) N2 21 V V
Read verify sector(s) N2 40 V V
(w/retry)
Read verify sector(s) N2 41 V V
(wo/retry)
Recalibrate O1 1x V V V V V V
Seek N1 7x V V
Set features M EF V V V V V
Set multiple mode N C6 V V V V V
Sleep M E6 V V V V V
Standby O E2 V V V V V
Standby immediate M E0 V V V V V
Write buffer N E8 V V
Write DMA (w/retry) N CA V V
Write DMA (wo/retry) N CB V V
Write long (w/retry) N2 32 V V

Page 18 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Overview

Table 2 - Command and Status Usage for ATAPI Devices (Generic)


Command Used Code Error Register Status Register
BBK UNC IDNF ABRT TKONF AMNF DRDY DWF DSC CORR ERR

2
Write long (wo/retry) N 33 V V
Write multiple N C5 V V

nl t
Write same N E9 V V

O raf
Write sector(s) (w/retry) N2 30 V V
Write sector(s) (wo/retry) N2 31 V V
Write verify N 3C V V
Invalid command code V V V V V

w D
y
V = valid on this command
M = Mandatory and shall be supported by CD-ROM ATAPI Devices, as specified by the ATA Standard
O = Optional for use by an ATAPI Device

ie ry
N = Not supported by ATAPI Devices (shall be Aborted by the ATAPI Device)
Shaded = Commands are utilized by the ATAPI Devices
1. Although this command is Optional for ATAPI the ATA Standard specifies it as Mandatory.
ev a
2. This command is specified as Mandatory for ATA, but shall NOT be supported by ATAPI Devices.
n
4.5 How SCSI is Used by ATAPI
i
rR m

Although the ATAPI Device will utilize many of the actual packet definitions from the SCSI standard, it will NOT use
most other features of the normal SCSI Protocol. Thus there are no Phases, no Messages, no sharable bus, (only one
Host Computer) and no SCSI Hardware. For those who are familiar with the current SCSI-3 effort, this Standard will not
fo eli

conform with that Packetized Standard, due mostly to limitations of ATAPI.

4.5.1 Differences from the SCSI Standard


Pr

Some of the major differences from the SCSI Standard:

• Status will use the ATAPI description, rather than a Data Byte passed at the end of the command.
• ATAPI Device is slave during operation rather than the master view of a SCSI Peripheral.
• No messages are supported.
• No disconnect/reconnect or any of the SCSI Pointers.
• No linking or queueing of commands.
• All CD-ROM Command Packets (CP) are 12 bytes in length, rather than the 6, 8, 10 or 12-byte
packets of the SCSI Standard; however, 16-byte ATAPI Command Packets are defined for SAM
compatibility for future Devices. The size of the Command Packet required by a Device is defined
in word 0 of the ATAPI Identify Device command, allowing Host System Device Drivers to deter-
mine the size of the Command Packets before issuing an ATAPI Command Packet.
• No allegiance conditions are used.

This standard will make use of many of the Standard SCSI Command Block definitions and Commands, but some of the
commands that would normally be supported by a SCSI Device will not be supported for various reasons. These com-
mands are:

• Reserve and release; as there is only one Host allowed, this is not needed.
• Send and receive diagnostics; the ATA EXECUTE DRIVE DIAGS command replaces these com-

working draft ATAPI Page 19


Revision 1.2 ATAPI Overview
February 23, 1994 2:40 pm How SCSI is Used by ATAPI

mands.
• Change definitions; as there is no SCSI, this command is nonsensical.
• Copy / Copy and Verify; no shared bus so this command can’t be implemented.
• Compare; no shared bus, so this command can’t be implemented.
• Read and Write Buffer; simplification.

nl t
• Log Sense and Select; simplification.

O raf
• Search Data; simplification.
• Verify; simplification.

w D
y
4.5.2 Redundant Command Functionality (Task File vs. Packet)
The SCSI Standard has provided some commands that the ATA Standard also provides. It is the intent of this standard to

ie ry
allow all the functionality to exist, by utilizing only Command Packets. This will allow existing SCSI like drivers to con-
tinue to issue packets for all operation, and have some lower level driver convert them to the ATAPI protocol. Unfortu-
nately there are existing low level drivers that would like to continue to use some non data transfer ATA Task File
ev a
commands. As such both these “Task File” and “Packet” commands will be supported.
n
[Link] Door Lock and Door Unlock vs. Prevent / Allow Medium Removal
i
There is a need to support a removable Device protocol that allows the Device to send a request to the Host to unlock
rR m

and/ or Eject the media. There is already an existing methodology that provides this capability in ATA. The device re-
quested eject is performed by setting the MCR bit in the Error Register and issuing an Error status to the Host (ERR bit
in the Status Register.) The Host would then issue an ACKNOWLEDGE MEDIA CHANGE command to indicate that it
fo eli

will perform the Unlock / Eject sequence. The SCSI PREVENT/ALLOW MEDIUM REMOVAL command only allows
the host to “Prevent” the user from removing the media and not to signal when the user needs to remove the media. As
such both the ATA and Packet (ATAPI) versions of the commands will be supported. When the ATA Door Lock is used,
Pr

only the MCR bit will be presented to the host, which can then poll for this condition. When the Packet commands are
used the MCR / Acknowledge Media Change sequence will not be used. The Door Lock / Unlock and Acknowledge Me-
dia Change commands are optional, but if the MCR bit is set by the device, they shall be supported.

[Link] ATAPI Identify Drive vs. Inquiry


The ATAPI IDENTIFY DRIVE command has information that the low level drivers use to perform ATA interface hard-
ware configuration. Information in the Identify Drive shall continue to look exactly as the ATA Identify Drive does for
compatibility reasons. As the information in the Inquiry Command cannot be returned by the ATAPI Identify Drive Com-
mand, the Inquiry Command will be supported for use by higher level drivers.

[Link] Initialize Drive Parameters and Set Features vs. Mode Sense and Mode Select
The INITIALIZE DRIVE PARAMETERS command does not contain a method to provide non ATA device configura-
tion information, and will not be used. As such the Mode Select and Mode Sense from the SCSI standard shall be sup-
ported. The combination of Mode Select and Set Features commands contain all the necessary functionality and is most
compatible with the existing BIOSes and OS Drivers.

[Link] Recalibrate vs. Rezero.


The RECALIBRATE ATA command is being kept for compatibility reasons. Either command will perform the same
function.

Page 20 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

5.0 ATAPI Protocol


The ATAPI Device is commanded by two methods, the original ATA Commands utilizing the Task File and the new
Packet Command method. For both methods, the devices using this interface shall be programmed by the host computer
to perform commands and return status to the host at command completion. When more than one Device is daisy
chained on the interface, commands are written in parallel to all peripherals, and for ATA commands except the Execute
Diagnostics command, only the selected Device (DRV bit in the Drive/Head ATA Register) executes the command. On

nl t
an Execute Diagnostics command addressed to Device 0, both devices shall execute the command, and Device 1 shall

O raf
post its status to Device 0 via PDIAG-.

The “Protocol” for ATAPI centers around the usage of a new ATA Command called “Packet Command.” All the normal
ATA rules and protocol are used to issue the Packet Command, but once the command has been issued, a new set of

w D
rules applies:

y
1. The interpretation of the DRQ bit in the Status Register shall be used along with the Interrupt Reason Registers

ie ry
to determine the actual Interrupt Type.
2. The actual command for the Device to execute is sent as a packet via the data register, and not the Task File.
ev a
3. Command arguments are supplied by the Command Packet as well as from the Task File.
n
4. A Byte Count is used to determine the amount of data the Host shall transfer at each DRQ Interrupt.
i
5. The ATAPI Features Register is used to indicate when DMA will be used rather than by using different opcodes.
rR m

6. The final status is presented to the Host as a new interrupt after the last data has been transferred, rather than along
with the last block of data.
fo eli

These new rules (protocol) only apply from after the issuance of the Packet Command, until the Completion Status has
been read by the Host. After the Completion Status has been read, the Task File Register definitions and Protocol revert
to the standard ATA definition.
Pr

5.1 Initialization
The ATAPI Device will respond just as defined in the ATA Standard. The DASP and PDIAG signals will be utilized fol-
lowing any reset condition, except the ATAPI RESET command.

5.2 PACKET Command


The Packet Command is issued exactly as normal ATA commands, by initializing the Task File Registers, setting the
Drive Selection Bit and writing the Command byte into the Command Register. With normal ATA commands a DRQ
(Optional Interrupt) would be generated to indicate that the data for the command could be transferred to/from the De-
vice. With the Packet Command, the first DRQ indicates that the Command Packet Data shall be written to the Device.
Once the Command Packet has been sent, the command proceeds as a normal ATA command would. The Command
Packet bytes shall always be transferred via PIO and never using DMA.

ATA Packet Commands can be issued regardless of the state of the DRDY Status Bit.

If while polling BSY the device remains in a state where it cannot accept a command for more than 5 seconds, the Host
shall time out and reset the device.

Data transfers may be accomplished in more ways than are described by this standard, but the sequences described in
this Standard shall be used to remain compatible with current and future ATAPI Devices.

working draft ATAPI Page 21


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm Status Register Utilization for Packet Commands

5.3 Status Register Utilization for Packet Commands


See "6.6 ATAPI Register Map (Packet Command)" on page 39 for a description of the register definition.

5.4 Byte Count Register (Cylinder Low/High) Usage for Packet Commands
This register is used to control the number of bytes the Host shall transfer at each DRQ. It is only used for the command

nl t
parameter data being transferred via PIO and never for DMA or Command Packet bytes.

O raf
Since the length of data that is actually transferred to and from an ATAPI Device using PIO is controlled by the Host,
and since the ATAPI Device needs to be able to control the number of bytes transferred, an additional capability was
needed. By using the Byte Count Register, a capability to transfer a variable number of bytes has been created. In ATAPI

w D
y
the Device indicates to the Host the number of bytes that shall be transferred on each DRQ Interrupt. Before transferring
data, the Host shall read the 16-bit Byte Count Register, and comply with the length requested. Both the ATAPI Device
and the Host will have their own byte counts and will transfer until those counts go to zero. For some commands, such as

ie ry
Mode Sense, the Host does not know the amount of data that will be transferred, and shall rely on the Byte Count sup-
plied by the Device to transfer the correct amount of data.
ev a
When using DMA to transfer data the Byte Count Register is not used and will contain unspecified data.
n
A further capability of the Byte Count Register is for the Host to signal to the ATAPI Device the maximum amount of
data it can take in a single PIO DRQ packet and or the preferred PIO DRQ packet size. For all commands that require
i
data be transferred, the Host shall set the Byte Count Register to the desired length before issuing the Packet Command.
rR m

This length shall be used by the ATAPI Device as the maximum size for each PIO data packet. The Device can choose to
transfer PIO DRQ packets smaller than those set by the host in the Byte Count Register.
fo eli

For all commands that can transfer all the data in one DRQ Interrupt, the Byte Count shall contain the total data length.
When a Read command is being processed, the ATAPI Device may wish to send all the data that is available in its buff-
ers on just one DRQ Interrupt, with the limitation that only 65535 bytes may be transferred at one time.
Pr

Table 3 - Byte Count Register Usage


Operation Usage (PIO) Usage (DMA)
Send Command Packet Is used as a parameter to the Packet Com- Command Packet is always sent via Pro-
mand and is not used to control the Packet grammed I/O and not DMA.
transfer.
Parameters to the Packet Com- As a parameter to any Packet Command that The Device can ignore the byte count, as the
mand (Task File Contents) will transfer parameter data, the Byte Count actual transfers are controlled via the ATAPI
is used by the Host to communicate the maxi- Device and not the Host.
mum / preferred amount of data to be trans-
ferred on each DRQ.
Parameter Data from the Device At each DRQ the count contains the number The ATAPI Device can transfer data when-
to the Host (e.g. data from a Read, of bytes that the Host shall transfer from the ever it wishes, and as such the Byte Count
or Inquiry command) Device. shall not be used.
Parameter Data from the Host to At each DRQ the count contains the number The ATAPI Device can transfer data when-
the Device (e.g. data for a Write, of bytes that the Host shall transfer to the ever it wishes, and as such the Byte Count
or Mode Select command) Device. shall not be used.

If the Device requests more data be transferred than required by the command protocol, the Host shall pad when sending
data to the Device, and dump extra data into a bit bucket when reading data from the Device.

On odd byte transfers, the only permissible time for an actual Odd Byte Count value will be on the Last DRQ, intermedi-
ate DRQs shall contain even byte counts.

Page 22 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

5.5 Sector Count (ATAPI Interrupt Reason) Register Usage for Packet Commands
The Interrupt Reason Register contains an expanded definition of the ATA DRQ Status. When the DRQ is presented in
the ATAPI Status Register for an ATAPI Packet Command, then the contents of this register indicate if Packet Command
or User Data shall be transferred.

nl t
5.6 Overlapped Command Operation

O raf
Some of the ATAPI Commands are immediate. These commands return Completion Status immediately, with the actual
execution of the command continuing. When the actual completion of the command has occurred, the Device shall set
the DSC bit in the Status Register.

w D
• Immediate Mode commands that report completion before the actual completion (Seek, Play Audio, etc.) shall re-

y
spond in one of the following ways:
(1) The new command is queued; or

ie ry
(2) The new command is executed with the previous command stopped and no error reported; or
(3) The new command is executed with no impact on the immediate mode command.
ev a
• ATA commands operate differently from packet commands. When a new ATA command is written to the Command
Register, before a command has completed, the executing command stops execution and the new command is aborted
n
with an Aborted Command error.
i
• New ATAPI packet commands received while a previous packet command is still executing shall cause both com-
rR m

mands to be aborted with an error, “Check Condition”.

• If an Immediate Mode command is executing when the devices is issued an SRST the DSC bit shall not be cleared
fo eli

with the rest of the status register. Instead the functionality of the DSC bit shall be maintained.
Pr

working draft ATAPI Page 23


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm Flow of Packet Command, PIO Data In to Host

5.7 Flow of Packet Command, PIO Data In to Host


This class includes commands such as Inquiry, Read etc. Execution includes the transfer of some unknown number of
data bytes from the Device to the host.
1. The host Polls for BSY=0, DRQ=0 then initializes the task file by writing the required parameters to the Features,
Byte Count, and Drive/Head registers.

nl t
2. The host writes the Packet Command code (A0h) to the Command Register.

O raf
3. The Device sets BSY, before the next system read of the status register, and prepares for Command Packet trans-
fer.

4. When the Device is ready to accept the Command Packet, the Device sets CoD and clears IO, BSY prior to as-

w D
y
serting DRQ. Some Devices will assert INTRQ following the assertion of DRQ. See section [Link], "General
Configuration Word (0)", on page 57 for command packet DRQ types and other related timing information.

ie ry
5. After detecting DRQ, the host writes the 12 bytes (6 words) of Command to the Data Register.

6. The Device(1) clears DRQ (when the 12th byte is written), (2) sets BSY, (3) reads Features and Byte Count re-
ev a
quested by the host system, (4) prepares for data transfer.
n
7. When data is available, the Device:(1) places the byte count of the data available into the Cylinder High and Low
Registers, (2) sets IO and clears CoD, (3) sets DRQ and clears BSY, (4) sets INTRQ.
i
rR m

8. After detecting INTRQ, the host reads the DRQ bit in the Status Register to determine how it shall proceed with
the command. If DRQ= 0 then the device has terminated the command. If DRQ=1 then the host shall read the data
(number of bytes specified in the Cylinder High/Low Registers) via the Data Register. In response to the Status
fo eli

Register being read, the Device negates INTRQ for both cases.

9. The Device clears DRQ. If transfer of more data is required, the Device also sets BSY and the above sequence is
repeated from step 7.
Pr

10. When the Device is ready to present the status, the Device places the completion status into the Status Register,
sets CoD, IO, DRDY and clears BSY, DRQ, prior to asserting INTRQ.

11. After detecting INTRQ & DRQ=0 the host reads the Status Register and if necessary, the Error Register for the
command completion status.

The DRQ signal is used by the device to indicate when it is ready to transfer data, and is cleared after (during) the last
byte of data to be transferred. This applies for both Command Packet as well as normal read/write data.

Page 24 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

Host Computer ATAPI Device

Clears BSY,

nl t
O raf
Wait for BSY=0, DRQ=0
Initialize Task File
Issue Packet Command
Sets BSY
.
.

w D
y
.
Ready for Command Packet
Set CoD, clear BSY, IO

ie ry
Assert DRQ/ INTRQ
Wait for DRQ or INTRQ
ev a
Write Command Packet Bytes
Negate DRQ after 12th (or 16th) byte
n
Set BSY
Perform command
i
.
rR m

.
Set Byte Count in Cylinder High/Low
Set DRQ, IO clear BSY, CoD
fo eli

Assert INTRQ
Wait for INTRQ
Read Status Negate INTRQ Loop if more
Pr

data to transfer
If DRQ = 1
Read Cylinder High/Low (Byte Count) Set BSY
Transfer Data Bytes
Set status in Status Register
Set IO, CoD, DRDY; Clear DRQ, BSY
If DRQ = 0 (Command terminated)
Assert INTRQ

Read Status
Negate INTRQ

If Error, Read Error Register

Solid Lines indicate control flow, and dotted lines are actions taken but without direct control flow change occurring.
This Diagram is for Visualization only, design to text.

Figure 1 - Packet Command with PIO Data In to Host

working draft ATAPI Page 25


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm Flow of Packet Command with PIO Data Out from the Host

5.8 Flow of Packet Command with PIO Data Out from the Host
This class includes commands such as Mode Select, Write etc. Execution includes the transfer of some known number
of data bytes from the Host to the Device.
1. The host Polls for BSY=0, DRQ=0 then initializes the task file by writing the required parameters to the Features,
Byte Count, and Drive/Head registers.

nl t
2. The host writes the Packet Command code (A0h) to the Command Register.

O raf
3. The Device sets BSY, before the next system read of the status register, and prepares for Command Packet trans-
fer.

4. When the Device is ready to accept the Command Packet, the Device sets CoD and clears IO, BSY prior to as-

w D
y
serting DRQ. Some Devices will assert INTRQ following the assertion of DRQ. See section [Link], "General
Configuration Word (0)", on page 57 for command packet DRQ types and other related timing information.

ie ry
5. After detecting DRQ, the host writes the 12 bytes (6 words) of Command to the Data Register.

6. The Device(1) clears DRQ (when the 12th byte is written), (2) sets BSY, (3) reads Features and Byte Count re-
ev a
quested by the host system, (4) prepares for data transfer.
n
7. When ready to transfer data, the Device:(1) sets the byte count (Cylinder High and Low Registers) to the amount
of data that the Device wishes to be sent , (2) clears IO and CoD, (3) sets DRQ and clears BSY, (4) sets INTRQ.
i
The Byte Count would normally be set to the number of bytes requested by the contents of the register at the re-
rR m

ceipt of the command, but may be any amount that the Device can accommodate in its buffers at this time.

8. After detecting INTRQ, the host reads the DRQ bit in the Status Register to determine how it shall proceed with
fo eli

the command. If DRQ= 0 then the device has terminated the command. If DRQ=1 then the host shall write the
data (number of bytes specified in the Cylinder High/Low Registers) via the Data Register. In response to the Sta-
tus Register being read, the Device negates INTRQ for both cases.
Pr

9. The Device clears DRQ and sets BSY. If transfer of more data is required, the above sequence is repeated from 7.

10. When the Device is ready to present the status, the Device places the completion status into the Status Register,
sets CoD, IO, DRDY and clears BSY, DRQ, prior to asserting INTRQ.

11. After detecting INTRQ & DRQ=0 the host reads the Status Register and if necessary, the Error Register for the
command completion status.

The DRQ signal is used by the device to indicate when it is ready to transfer data, and is cleared after (during) the last
byte of data to be transferred. This applies for both Command Packet as well as normal read/write data.

Page 26 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

Host Computer ATAPI Device

Clears BSY

nl t
O raf
Wait for BSY=0, DRQ=0
Initialize Task File
Issue Packet Command
Sets BSY
.
.

w D
y
.
Ready for Command Packet
Set CoD, clear BSY, IO

ie ry
Assert DRQ/ INTRQ
Wait for DRQ or INTRQ
ev a
Write Command Packet Bytes
Negate DRQ after 12th (or 16th) byte
n
Set BSY
Perform command
i
.
rR m

.
Set Byte Count in Cylinder High/Low
Set DRQ, clear BSY, CoD, IO
fo eli

Assert INTRQ
Wait for INTRQ
Read IRQ Status Negate INTRQ Loop if more
Pr

data to transfer
If DRQ = 1
Read Cylinder High/Low (Byte Count) Set BSY
Transfer Data Bytes
Set status in Status Register
Set IO, CoD, DRDY; Clear DRQ, BSY
If DRQ = 0 (Command terminated)
Assert INTRQ

Read Status
Negate INTRQ

If Error, Read Error Register

Solid Lines indicate control flow, and dotted lines are actions taken but without direct control flow change occurring.
This Diagram is for Visualization only, design to text.

Figure 2 - Packet Command with PIO Data Out from Host

working draft ATAPI Page 27


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm Flow of DMA Data Commands

5.9 Flow of DMA Data Commands


This class includes commands such as Read, Write etc. Execution includes the transfer of some unknown number of data
bytes.
1. The host Polls for BSY=0, DRQ=0 then initializes the task file by writing the required parameters to the Features,
Byte Count, and Drive/Head registers. The host must also initializes the DMA engine which will service the De-
vices requests.

nl t
O raf
2. The host writes the Packet Command code (A0h) to the Command Register.

3. The Device sets BSY and prepares for Command Packet transfer.

4. When the Device is ready to accept the Command Packet, the Device sets CoD and clears IO, BSY prior to as-

w D
y
serting DRQ. Some Devices will assert INTRQ following the assertion of DRQ. See section [Link], "General
Configuration Word (0)", on page 57 for command packet DRQ types and other related timing information.

ie ry
5. After detecting DRQ, the host writes the 12 bytes (6 words) of Command to the Data Register.

6. The Device(1) clears DRQ (when the 12th byte is written), (2) sets BSY, (3) reads Features and Byte Count re-
ev a
quested by the host system, (4) prepares for data transfer.
n
7. When ready to transfer data, the Device transfers via DMARQ/DMACK any amount that the Device can accom-
modate or has in its buffers at this time. This continues until all the data has been transferred.
i
rR m

8. When the Device is ready to present the status, the Device places the completion status into the Status Register,
and sets IO, CoD, DRDY and clears BSY, DRQ, prior to asserting INTRQ.

After detecting INTRQ the host reads the Status Register for the command completion status.
fo eli

5.10 Flow of Non-data Commands


Pr

This class includes commands such as Seek, etc. Execution of these commands involves no data transfer.

1. The host Polls for BSY=0, DRQ=0 then initializes the task file by writing the required parameters to the Features,
Byte Count, and Drive/Head registers.
2. The host writes the Packet Command code (A0h) to the Command Register.

3. The Device sets BSY and prepares for Command Packet transfer.

4. When the Device is ready to accept the Command Packet, the Device sets CoD and clears IO, BSY prior to as-
serting DRQ. Some Devices will assert INTRQ following the assertion of DRQ. See section [Link], "General
Configuration Word (0)", on page 57 for command packet DRQ types and other related timing information.

5. After detecting DRQ, the host writes the 12 bytes (6 words) of Command to the Data Register.

6. The Device sets BSY and executes the command.

7. When the Device is ready to present the status, the Device places the completion status into the Status Register,
and sets IO, CoD, DRDY and clears BSY, DRQ, prior to asserting INTRQ.

8. After detecting INTRQ, the host reads the Status Resister for the command completion status.

Page 28 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

5.11 Timing of Packet Command

Write CMD

nl t
O raf
Read Status

Rd/Wr Data

w D
y
Less than 50µs
or 3MS if using Interrupt

ie ry
BSY
ev a
I/O
n
CoD
i
rR m

Byte Count
fo eli

5µs Maximum
DRQ
Pr

Optional use
of Interrupt

INTRQ

Figure 3 - Timing of Command Packet Transfer

working draft ATAPI Page 29


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm Timing of Data and Status Transfer

5.12 Timing of Data and Status Transfer

Read Status

nl t
O raf
Rd/Wr Data
Data Transfer Completion Status

w D
y
BSY

I/O
ie ry
ev a
CoD
i n
Byte Count
rR m

5µs Maximum
DRQ
fo eli

INTRQ
Pr

Flow

Figure 4 - Timing of Data and Status Transfer

Page 30 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

5.13 Control Signal Timing Requirements and Relationships


The order that the signals change shall adhere to the following conditions:
1. Upon receiving the A0h ATAPI Packet Command the Device shall have BSY asserted until the next host access
of the Status Register where the device can guarantee that CoD=1 and IO=0.
2. The Device shall not assert DRQ until CoD and IO are valid for the command or data packet to be transferred and

nl t
the device is ready to perform that transfer.

O raf
3. DRQ may be set before or after BSY has been deasserted.

4. The Device shall clear BSY and set DRQ within the time-out specified by the CMD DRQ Type. See section
[Link], "General Configuration Word (0)", on page 57 for additional information.

w D
y
5. Devices reporting CMD DRQ Type “Accelerated” shall de-assert DRQ within 5us of the last word transferred for
a command or data packet.

ie ry
6. Devices reporting a CMD DRQ Type other than “Accelerated” shall de-assert DRQ, before asserting INTRQ, fol-
lowing the last word transferred for a command or data packet.
ev a
Implementer’s Note: Early ATAPI Devices reporting CMD DRQ Types other than “Accelerated” may not be able to de-
n
assert DRQ before the next INTRQ. Host systems should therefore wait until the device asserts INTRQ before testing
DRQ following the transfer of the last data word in a command or data packet.
i
rR m

See section [Link], "General Configuration Word (0)", on page 57 for additional DRQ and other timing related informa-
tion.
fo eli
Pr

working draft ATAPI Page 31


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm BIOS and ATAPI Driver Compatibility

5.14 BIOS and ATAPI Driver Compatibility


This section discusses the IDE features and functions that shall be provided by the ATA Device to allow the BIOS and
driver to be content.

5.14.1 Reset Master/Slave Diagnostics Sequence

nl t
A Reset Master/Slave Diagnostics Sequence with a Good Status shall be provided or the BIOS will not continue. When

O raf
the CD-ROM is the slave device, and it does not respond after the Reset or Diagnostic Commands, the Master Device will
return an Error Condition to the Host Computer and all will die.

w D
5.14.2 SRST Initialization Sequence

y
The SRST bit in the ATAPI Device Control Register (See "Figure 12 - ATAPI Device Control Register (ATA Device Con-
trol Register)" on page 42) shall NOT be used by the ATAPI Driver. Instead the ATAPI Device Driver shall reset the

ie ry
ATAPI Device utilizing the ATAPI Soft Reset command (see "6.2 ATAPI Soft Reset Command and Protocol" on page
36). Resetting the ATAPI Device using the ATA SRST would also reset any ATA hard drive attached, and if there are sep-
arate Drivers for an IDE and an ATAPI device, each driver would be resetting the others peripheral without the other driv-
ev a
er being aware of the reset.
After Receipt of an ATAPI Packet Command there are several differences from the ATA Specification:
n
A value other than 00h or 10h in the status register prior to the receipt of the first ATAPI Command Packet from the host
i
may cause ATAPI Devices to be incorrectly identified by pre-ATAPI host BIOS as an ATA-compatible disk drive.
rR m

Initializing the task file upon receipt of an SRST should work since only immediate commands will be executing when
an ATA disk driver issues an SRST. To prevent interruption of ATAPI immediate commands which have not finished exe-
fo eli

cuting, the function of the DSC bit (i.e. command complete) shall be maintained. On a warm boot the BIOS and/or driv-
ers may see a status of 00h or 10h, depending on whether or not an ATAPI immediate command completed at the same
time the system performed the WARM BOOT.
Pr

The signature placed in the task file following an SRST shall remain until the ATAPI device receives its first ATAPI
command, i.e., the ATAPI device will look NOT READY (DRDY=0). This will not affect the ATAPI device drivers abili-
ty to send ATAPI commands to the ATAPI device since it is not required to wait for DRDY=1. However, it will prevent
ATA-compatible drivers, such as those performing power management, from sending commands to an ATAPI device un-
til the ATAPI device has received its first ATAPI command: ATAPI Packet Command, ATAPI Identify Device, ATAPI
Soft Reset.

ATAPI drivers wishing to use ATA power management commands must poll DRDY and, if it is not set, they must also
look at the Cylinder registers for the ATAPI signature. If the signature is present, the ATAPI driver must issue the ATAPI
device an ATAPI command, re-enabling DRDY, before it can issue an ATA Power management command. Operating sys-
tems wishing to use a common ATA power management driver must also be changed to perform this detection and recov-
ery sequence, if they intend to power-manage ATAPI devices.

5.14.3 Special Handling of ATA Read and Identify Drive Commands


ATAPI drivers shall not issue SRST since it may corrupt the state of ATA IDE drives sharing the same cable. Instead,
ATAPI drivers shall use the ATAPI Soft Reset or ATAPI PACKET RESET command to initialize an ATAPI device. Note
that ATAPI commands shall not be issued to a device which has not already been identified as an ATAPI device. In order
to provide ATAPI drivers with the ability to force a device to initialize its ATAPI signature (Cylinder High = EBh, Cylin-
der Low = 14h) without issuing an SRST, ATAPI devices shall abort the ATA Read and Identify Drive commands and
initialize the task file with the ATAPI signature before clearing BSY.

Page 32 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Protocol

5.14.4 ATAPI aware BIOS and Driver Considerations


Pre-ATAPI BIOS will not detect or configure ATAPI devices. Some of these BIOS are capable of configuring ATA hard
disks for ATA Mode 3 IORCHDY operation. This places a special burden on ATAPI drivers to detect the presence of any
ATA disk drives sharing the same port address and configure the ATAPI device for a compatibile mode of operation.

Note that a special IDE port configuration driver must be provided by the IDE card manufacturer to configure the cards

nl t
proprietary IDE configuration control registers. These proprietary IDE card drivers should be loaded before the ATAPI

O raf
driver.

During ATAPI device detection, ATAPI device drivers or ATAPI-aware BIOS should verify that Status=00h (Not BSY,
Not RDY) and that the ATAPI signature Cylinder High = EBh, Cylinder Low = 14h are present. If an ATAPI device is de-

w D
tected, then issue an ATAPI Identify Command to complete the ATAPI detection protocol and re-enable the task file

y
(DRDY=1). If the device is ready to accept an ATA command, but no ATAPI signature is detected, then issue an ATA
Read or Identify Drive command to the device to force the ATAPI device to initialize it’s signature. Then wait for
BSY=0 and re-verify the presence of the ATAPI signature. If there is still no ATAPI signature present, do not configure

ie ry
the device.

ATAPI-aware BIOS and drivers should give special attention to managing configurations where ATAPI drivers share an
ev a
IDE port address (Cable) with ATA IDE drives and their drivers. ATA IDE drivers frequently issue SRSTs to manage er-
rors thereby causing ATAPI devices to clear DRDY as part of their SRST ATAPI signature initialization sequence. If the
n
ATAPI driver already knows that the device it wishes to issue an ATAPI command to is an ATAPI device, then it need
not take special action since issuing any of the ATAPI commands which do not require DRDY=1, will restore the ATAPI
i
rR m

device’s ability to accept ATA commands. If, however, the ATAPI driver wishes to issue an ATA command to an ATAPI
device which has received an SRST from an ATA IDE driver, it should issue the ATAPI device an ATAPI Soft Reset to
restore the ATAPI device’s ability to accept ATA commands.
fo eli

Note that “Newer” BIOS detect the presence of a Drive (see "4.3 ATA Compatibility" on page 17) by using the IDENTI-
FY DRIVE command, but older BIOS use configuration information from outside the IDE/ATA interface. It has also
been discovered that very old BIOS may issue an ATA READ command to detect the presence of an ATA IDE drive.
Pr

Therefore, the ATA READ and IDENTIFY DRIVE commands shall be aborted by ATAPI Devices. It has also been dis-
covered that some BIOS look at the status register to detect the presence of an ATA drive.

5.14.5 Default Timing


ATAPI devices compatible with this specification shall support ATA mode 3 timing without requiring the host system to
configure the ATAPI device using any set features commands. ATAPI devices must therfore either be fast enough to al-
ways supply data at the maximum rate allowed by Mode 3 or the ATAPI device must be shipped with IORDY enabled.

ATAPI devices shall revert to their default interface configuration on a Power On Reset or a Hardware Reset.

working draft ATAPI Page 33


Revision 1.2 ATAPI Protocol
February 23, 1994 2:40 pm BIOS and ATAPI Driver Compatibility

nl t
O raf
w D
y
ie ry
ev a i n
rR m
fo eli
Pr

Page 34 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Transport Mechanism

6.0 ATAPI Transport Mechanism


The Transport Mechanism provides for the hardware support to connect the host computer to the Peripheral. There will
ultimately be two “Models” of operation specified, the Compatibility and Extended Capability Models. The Compatibili-
ty Model will look exactly like an ATA/IDE Drive to all existing Drivers, Operating Systems and Hardware. It will oper-
ate under many restrictions and will be required to support extra capabilities. The Extended Capability Model will be
used to address issues, such as IRQ sharing and multi-threading of commands. The Extended Capability Model will be

nl t
defined at a later time and will not be defined in this standard. The Compatibility Model is described in the remainder of

O raf
this section.

6.1 Reset Conditions

w D
y
There are three types of Reset Condition to which ATAPI Devices shall respond:

• Power On Reset or Hardware Reset: the Device executes a series of electrical circuitry diagnos-

ie ry
tics and sets default values, as well as executing the Master Slave Diagnostic Protocol.
• ATAPI Soft Reset: ATAPI Devices shall reset the interface circuitry according to the Set Features
requirement upon receipt of the ATAPI Soft Reset Command.
ev a
• ATA SRST: ATAPI Devices shall provide the normal ATA PDIAG/ DASP sequence and initialize
n
the task file with the ATAPI signature upon detection of SRST. No actual reset of the ATAPI de-
vice will occur, no commands that may be active will be aborted or stopped.
i
rR m

The Reset Conditions above are listed in order of precedence. That is, Power On or Hardware Reset shall take prece-
dence over ATAPI Soft Reset, which shall take precedence over ATA SRST, which shall take precedence over all other
conditions.
fo eli

6.1.1 Power On or Hardware Reset


Pr

Each ATAPI Device, as it is powered on, shall perform appropriate internal reset operations, and internal test operations.

ATAPI Devices upon detection of reset, shall:


1. Clear all Commands and I/O operations in progress.
2. Return to Devices default configuration.

3. Perform the DASP / PDIAG sequence.

4. Return any ATAPI Device operating modes to their appropriate initial conditions, similar to those conditions that
would be found after a normal power-on reset. MODE SELECT conditions shall be restored to their last saved
values if saved values have been established. MODE SELECT conditions for which no values have been saved
shall be returned to their default values.

5. Initialize the Task File Registers as follows: Status = 00h, Error = 01h, Sector Count = 01h, Sector Number = 01h,
Cylinder Low = 14h, Cylinder High =EBh and Drive/Head = 00h. A value other than 00 in the status register prior
to the receipt of the first ATAPI Command Packet from the host may cause the ATAPI Device to be incorrectly
identified by the host as an ATA compatible disk drive. BSY = 0, following any Reset, indicates to the Host that
the registers within the Task File have been initialized

working draft ATAPI Page 35


Revision 1.2 ATAPI Transport Mechanism
February 23, 1994 2:40 pm ATAPI Soft Reset Command and Protocol

6.2 ATAPI Soft Reset Command and Protocol


ATA specifies a mandatory software reset capability because it provides a recovery mechanism from a class of errors/
problems that are recoverable in no other way. The current CD-ROM drivers invoke this feature at some point in their er-
ror recovery procedures today.

The ATA software reset mechanism, SRST, (bit 2 in the Device Control Register) cannot be used for ATAPI Devices, be-

nl t
cause resets issued by the ATAPI driver would also reset any attached hard disk and vice versa.

O raf
To solve this ATAPI defines an ATAPI Soft Reset command using a reserved ATA opcode which could be decoded by
the interface controller hardware. The ATAPI Soft Reset command shall be “executed” by dedicated hardware as op-
posed to firmware, and the Drive Select bit will be used to qualify the one Device that will accept the ATAPI Soft Reset

w D
command. Only the ATAPI Device that is selected will be reset by the ATAPI Soft reset command.

y
For a software reset to be useful, it must be able to bring the drive’s microprocessor back from a busy or hung condition,
allowing issuance of a diagnostic or some other command. Since the microprocessor is the destination of the reset, we

ie ry
can’t depend on it as part of the reset path. Therefore, ATAPI Soft Reset shall be detected/decoded by the interface con-
troller circuitry and be routed back to the microprocessor as a hardware signal.
ev a
Upon detection of the ATAPI Reset command, shall:
n
1. Return Diagnostics Status from the Slave to the Master Drive via the PDIAG signal. The RESET COMMAND
will not execute any diagnostics, but shall still provide the PDIAG sequence in order to provide Diagnostic Status
i
that may be expected by the Master Device.
rR m

2. Set BSY when the command is decoded. When the reset sequence in the Device is complete the Busy status will
be cleared. This will be the only status returned to the host by the ATAPI Soft Reset command.
fo eli

3. Initialize the task file with the same information as after a Power On Reset. See section 6.1.1, "Power On or Hard-
ware Reset", on page 35 for a description of the initialization sequence, with the exception of the DRV bit which
shall remaine unchanged.
Pr

Page 36 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Transport Mechanism

6.3 ATAPI Implementation of ATA SRST


The ATA software reset mechanism, SRST, (bit 2 in the Device Control Register) cannot be used for ATAPI Devices, be-
cause resets issued by the ATAPI driver would also reset any attached hard disk and vice versa. To solve this ATAPI de-
fines an ATAPI Soft Reset command using a reserved ATA opcode which could be decoded by the interface controller
hardware.

nl t
To maintain Master / Slave compatibility with ATA disk drives and prevent detection of ATAPI Devices by non ATAPI-

O raf
aware BIOS, ATAPI Devices shall implement the following upon receipt of an ATA SRST:

1. Follow the SRST Sequence defined in "Figure 5 - SRST Sequence" on page 37, and not the sequences shown in
the ATA Specification.

w D
y
2. Initialize the task file with Status = 00h or 10h, Error = 01h, Sector Count = 01h, Sector Number = 01h, Cylinder
Low = 14h, Cylinder High =EBh and Drive/Head = 00h.

ie ry
3. Maintain the functionality of the DSC bit, to indicate completion of any immediate command executing when
SRST was detected.
ev a
4. Continue executing commands or play operations.
n
5. Leave Mode settings or Set Feature settings unchanged.
i
6. If an ATAPI Device detects SRST while DRQ=1 and the ATAPI Device is selected, then and only then, shall an
rR m

ATAPI Device abort a command in progress on receipt of an SRST.


fo eli

Host Computer Master (Drive 0) Slave (Drive 1)


Pr

Set SRST
Clear SRST Sets Busy, clears DASP & PDIAG Sets Busy, clears DASP & PDIAG
Within 1ms assert DASP
Waits up to 3ms for Slave to assert DASP
Within 30 seconds deassert Busy
and assert PDIAG
Wait up to 31s for PDIAG to be asserted

Clear Busy After 31 seconds or next command


Deassert DASP

Figure 5 - SRST Sequence

working draft ATAPI Page 37


Revision 1.2 ATAPI Transport Mechanism
February 23, 1994 2:40 pm Physical Connection

6.4 Physical Connection


The ATAPI Devices are selected by the Address field in the Drive Select Register. When a single Device is attached to
the interface it shall be set as Device 0. When the ATAPI Device is attached along with an ATA Mass Storage Device, the
ATAPI Device will be set as Device 1 and respond as a Slave.

nl t
Table 4 - Preferred Drive Connection

O raf
Primary Cable Secondary Cable
Master Slave1 Master Slave Notes
ATA Drive Normal single cable

w D
y
ATAPI Device Normal single cable
ATA Drive ATAPI Device Single cable with CD-ROM
ATAPI Device ATAPI Device Support two ATAPI Devices

ie ry
on the Same Cable.
ATA Drive ATA Drive Two drives on one cable
ATA Drive ATAPI Device One drive and a CD-ROM
ev a
with two cables
ATA Drive ATA Drive ATAPI Device Two drives and CD-ROM
n
with two cables
ATA Drive ATA Drive ATA Drive ATAPI Device Three drives and CD-ROM
i
with two cables
rR m

1. The ATAPI Device shall be capable of either Master or Slave operation.


fo eli
Pr

Page 38 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Transport Mechanism

6.5 Register Mapping


Communication to or from the Devices is through I/O Registers that route the input or output data to or from registers
(selected) by a code on signals from the host (CS1FX-, CS3FX-, DA2, DA1, DA0, DIOR- and DIOW-).

6.6 ATAPI Register Map (Packet Command)

nl t
Logic conventions are: A = signal asserted, N = signal negated, x = does not matter which it is

O raf
Table 5 - I/O Port Functions/Selection Addresses (Compatibility Model)
Addresses Functions

w D
y
CS1FX CS3FX DA2 DA1 DA0 Read (DIOR-) Write (DIOW-)
Control Block Registers

ie ry
N A 0 0 0 Floppy A Status Unused
N A 0 0 1 Floppy B Status Unused
N A 0 1 0 Unused Floppy Digital Output Register
ev a
N A 0 1 1 Floppy ID / Tape Control RESERVED
N A 1 0 0 Floppy Controller Status RESERVED
n
N A 1 0 1 Floppy Data Register
N A 1 1 0 Alternate ATAPI Status Device Control
i
N A 1 1 1 Diskette Change/Drive Address Not Used
rR m

Command Block Registers


A N 0 0 0 Data
fo eli

A N 0 0 1 ATAPI Error Register ATAPI Features


A N 0 1 0 ATAPI Interrupt Reason Register
A N 0 1 1 Reserved For SAM TAG Byte
Pr

A N 1 0 0 ATAPI Byte Count Register (bits 0-7)


A N 1 0 1 ATAPI Byte Count Register (bits 8-15)
A N 1 1 0 Drive Select
A N 1 1 1 ATAPI Status ATA Command

With the exception of the Data Register, all the ATAPI registers are referenced using Byte (8 Bit) Read and Writes. The
Data Register is ALWAYS referenced as a 16 bit word.

working draft ATAPI Page 39


Revision 1.2 ATAPI Transport Mechanism
February 23, 1994 2:40 pm ATAPI Register Map (Packet Command)

The following table is shown for reference only, no word references to the registers (Other than the data register) are al-
lowed by this specification.
.

Table 6 - Word Mapping of Task File Registers

Typical Functions

nl t
Addr Read (DIOR-) Write (DIOW-)

O raf
Control Block Registers
3x0 Floppy B Status Floppy A Status Unused Unused
3x2 Floppy ID / Tape Control Unused Reserved Floppy Digital Output

w D
y
3x4 Floppy Data Register Floppy Controller Status Floppy Data Register Reserved
3x6 Change/Drive Address Alternate ATAPI Status Unused ATAPI Device Control
Command Block Registers

ie ry
1x0 Data Register Data Register
1 ATAPI Error Register ATAPI Feature Register
ev a
1x2 Reserved for SAM Tag ATAPI Interrupt Reason Reserved for SAM Tag Sector Count
1x4 ATAPI Byte Count Register ATAPI Byte Count Register
n
1x6 ATAPI Status Drive Select Register ATA Command Register Drive Select Register
i
rR m

D7 D6 D5 D4 D3 D2 D1 D0
fo eli

BSY DRDY Reserved DSC DRQ CORR Reserved CHECK Read


Figure 6 - ATAPI Status Register (ATA Status Register)
DRDY, DSC, CORR and CHECK shall only be valid at the end of the completion of the command.
Pr

Bit 7 BSY Busy is set whenever the drive has access to the Command Block.

Bit 6 DRDY Indicates that the drive is capable of responding to an ATA command.

Bit 4 DSC Seek Complete indication, used for overlapped Seek operation.

Bit 3 DRQ Data Request - Indicates that the device is ready to transfer a word or byte of
data between the host and the drive. The information in the ATAPI Interrupt
Reason will also be valid during a Packet Command when the DRQ is set.

Bit 2 CORR Indicates if a Correctable Error occurred.

Bit 0 CHECK Indicates that an error occurred during execution of the previous command.
The bits in the Error Register contains the Sense Key and Code.

D7 D6 D5 D4 D3 D2 D1 D0
Sense Key MCR ABRT EOM ILI Read
Figure 7 - ATAPI Error Register (ATA Error Register)
Bits 7-4 Sense Key The sense key is defined in "Table 124 - Sense Key Descriptions" on page 157.

Page 40 working draft ATAPI


ATAPI CD-ROM Specification
ATAPI Transport Mechanism

Bit 3 MCR Media Change Requested, is used and defined as in the ATA Standard.

Bit 2 ABRT Aborted Command, is used and defined as in the ATA Standard.

Bit 1 EOM End Of Media Detected.

Bit 0 ILI Illegal Length Indication.

nl t
O raf
D7 D6 D5 D4 D3 D2 D1 D0
Reserved Reserved for Tag Type Reserved DMA Write
Figure 8 - ATAPI Feature Register (ATA Feature Register)

w D
y
Bit 7 Reserved Reserved for future enhancement.

ie ry
Bit 6,5,4 Reserved Reserved for Tag Type.

Bit 3,2,1 Reserved Reserved for future enhancement.


ev a
Bit 0 DMA (Optional) Any data for the Command will be transferred via the DMA interface. Note
n
this does not apply for the Command Packet.
i
rR m

D7 D6 D5 D4 D3 D2 D1 D0
fo eli

Byte Count (Bits 0-7) R/W


Byte Count (Bits (8-15) R/W
Figure 9 - ATAPI Byte Count Register (ATA Cylinder High/Low Register)
Pr

The Byte Count is used for PIO only; it is ignored on DMA mode operations. The count shall be set prior to the issuance
of the Packet Command. The count contains the total transfer size for commands that transfer only one group of data
(e.g. Mode Sense / Select, Inquiry) For commands that require multiple DRQ Interrupts (e.g. Read, or Write) the count
is set to the desired transfer size. When any data is to be transferred, the ATAPI Device will set the Byte Count to the
amount of data that the Host shall transfer and then issue the DRQ Interrupt. The contents of this register will not
change during the DRQ.

working draft ATAPI Page 41


Revision 1.2 ATAPI Transport Mechanism
February 23, 1994 2:40 pm ATAPI Register Map (Packet Command)

D7 D6 D5 D4 D3 D2 D1 D0
Reserved IO CoD Read
Figure 10 - ATAPI Interrupt Reason Register (ATA Sector Count Register)

nl t
Bit 0 CoD Command or Data. When this bit is zero then the information being trans-

O raf
ferred is user data, when one then the data is Command.

Bit 1 IO Direction for the Information transfer, where in to the Host is indicated by a
value of one and out to the device is zero.

w D
y
IO DRQ CoD
0 1 1 Command - Ready to Accept Command Packet Bytes
1 1 1 Message (Future) - Ready to Send Message data to Host

ie ry
1 1 0 Data To Host- Send command parameter data (e.g. Read
Data) to the host
0 1 0 Data From Host - Receive command parameter data (e.g.
ev a
Write Data) from the host
1 0 1 Status - Register contains Completion Status
i n
rR m

D7 D6 D5 D4 D3 D2 D1 D0
1 Reserved 1 DRV Reserved for SAM LUN R/W
fo eli

Figure 11 - ATAPI Drive Select Register (ATA Drive / Head Select Register)
Bit 4 DRV This bit selects either Device 0 (DRV=0) or 1 (DRV=1).
Pr

D7 D6 D5 D4 D3 D2 D1 D0
Reserved 1 SRST nIEN 0 Write
Figure 12 - ATAPI Device Control Register (ATA Device Control Register)
Bit 2 SRST This bit is the Software Reset. The ATAPI Device shall follow the reset se-
quence for SRST defined in "6.3 ATAPI Implementation of ATA SRST" on
page 37. There is also a new reset capability for ATAPI Devices utilizing a
RESET COMMAND (see "6.2 ATAPI Soft Reset Command and Protocol" on
page 36).

Bit 1 nIEN This bit enables/disables the interrupt to the host. When nIEN=0 and the de-
vice is selected, INTRQ shall be enabled through a tri-state buffer. When
nIEN=1 or the device is not selected, the INTRQ signal shall be in a high im-
pedance state

Page 42 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Model

7.0 CD-ROM Model


CD-ROM devices permit reading data from a rotating media. Writing the media is not currently supported, but will be in
the future (CD-WO and CD-MO). Data transfer can begin with any of the consecutively numbered logical blocks. Data
on CD-ROM devices is addressed the same as for (magnetic) direct-access devices. Some CD-ROM devices support a
separate information stream (e.g. audio and/or video but referred to as audio in this Section) transmitted via a connection
other than the AT Bus. This specification defines commands for controlling these other information streams for CD-ROM

nl t
devices.

O raf
CD-ROM drives are designed to work with any disc that meets IEC. Many new drives read CD-ROM data discs, digital
audio discs, and audio-combined discs (i.e. some tracks are audio, some tracks are data).

w D
y
7.1 New Capabilities Since the SCSI-2 Standardization
Unfortunately, the introduction of Photo CDs (with multiple sessions), CD-ROM XA Format (two different format

ie ry
modes), and CD-I has occurred after the standardization effort. In addition, the SCSI standard did not provide a method
to return the CD-DA data. As is characteristic with “new” functionality, each vendor has devised their own solutions.
This ATAPI Proposal has taken the “Common Command Set (CCS)” approach to the problem and created a minimal
ev a
mandatory command set that includes capabilities that are not currently standardized.
n
7.2 CD-ROM Media Organization
i
The formats written on the CD-ROM and CD-DA (Digital Audio) media require special interfacing considerations.
rR m

NOTE This subsection contains a number of terms that have special meanings peculiar to CD-ROM technology or that may be unfamiliar to many
readers of this Specification. The glossary defines these terms.
fo eli

Discs may contain either audio, data or a mixture of the two. "Table 7 - Example Mixed Mode CD-ROM Disc Layout" on
page 44 gives an example of an audio-combined disc to illustrate the relationship between the logical block addresses re-
ported and the MSF address encoded on the media.
Pr

NOTE: The term “frame” is used in two different ways in the CD-ROM media standard. The intended meaning can only be determined from the con-
text. Whenever possible, this description replaces the larger data unit with the more familiar term sector. The primary exception to this policy is the use
of frame when referring to the MSF address. In the MSF context, one frame (F field unit) equals one sector. On a typical two channel CD-DA media,
each frame (F field unit) is played in 1/75th of a second.

working draft ATAPI Page 43


Revision 1.2 CD-ROM Model
February 23, 1994 2:40 pm CD-ROM Media Organization

Table 7 - Example Mixed Mode CD-ROM Disc Layout


Track Track CD-
Logical Absolute Track Sector is Mode
Relative Relative ROM
Block Description Address MSF and Info or Audio
Logical MSF Data
(Decimal) Address1 Index is Pause or Data

nl t
Address address Mode2

O raf
Lead-in area3 --- --- --- 0/- --- --- Audio ---
Pre-gap3 --- --- 00/00/00 1/0 00/02/00 Pause Data Null
1st track data 00004 0 00/02/005 1/1 00/00/00 Info Data L-EC
2nd track data 60004 0 01/16/005 2/1 00/00/00 Info Data L-EC

w D
y
7500 1500 01/2A/00 2/2 00/16/00 Info Data L-EC
Post-gap 9000 3000 02/02/00 2/3 00/28/00 Pause Data Null
Pause-silence 9150 -1506 02/04/00 3/0 00/02/007 Pause Audio ---

ie ry
3rd track audio 93008 0 02/04/009 3/1 00/00/00 Info Audio ---
1400 2250 02/22/00 3/2 00/1E/00 Info Audio ---
4th track audio 219758 0 04/35/009 4/1 00/00/00 Info Audio ---
ev a
Pre-gap part 1 30000 -2256 06/28/00 5/0 00/03/00 Pause Audio ---
Pre-gap part 2 30075 -150 06/29/00 5/0 00/02/00 Pause Data Null
n
5th track data 30225 0 06/2B/00 5/1 00/00/00 Info Data L-EC
26399910
i
Last information 233 774 3A/27/4A 5/1 33/38/4A Info Data L-EC
rR m

Post-gap --- 233 775 3A/28/00 5/2 33/39/00 Pause Data Null
Lead-out track 26400011 0 58/42/ AA/13 00/00/00 Pause Audio ---
0012
fo eli

1. Absolute MSF address repeated in the header field of data blocks.


2. The CD-ROM data mode is stored in the header of data tracks. This indicates that the block is part of a data pre-
gap or post-gap (null), that this is a data block using the auxiliary field for L-EC symbols (ECC - CD-ROM data
Pr

mode one), or that this is a data block using the auxiliary field for user data (CD-ROM data mode two).
3. Table of contents information is stored in the sub-channel of lead-in area. The lead-in area is coded as track zero.
Track zero and the initial 150 sector pre-gap (or audio pause) are not accessible with logical addressing.
4. Exact value returned by READ TOC command.
5. Value stored in table of contents with zero tolerance.
6. Track relative logical addresses are negative in the pre-gap areas. Pre-gap areas have index values of zero.
7. Track relative MSF value decreases to 0 in pre-gap areas.
8. Value returned by READ TOC command plus or minus 75 blocks.
9. Value stored in table of contents plus or minus 75 sectors.
10. Minimum value returned by READ CD-ROM CAPACITY; exact value depends on encoding of this track and
the lead out track and whether this is derived from the TOC data.
11. Value returned by READ TOC command; exact, if lead-out track is encoded as data, or plus or minus 75 blocks
if encoded as audio.
12. Value stored in table of contents; exact, if lead-out track is coded as data, or plus or minus 75 blocks if coded
as audio.
13. Lead-out track number is defined as 0AAh.

Page 44 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Model

The physical format defined by the CD-ROM media standards provides 2352 bytes per sector. For usual computer data
applications, 2048 bytes are used for user data, 12 bytes for a synchronization field, 4 bytes for a sector address tag field
and 288 bytes - the auxiliary field - for L-EC (CD-ROM data mode 1). In less critical applications, the auxiliary field
may also be used for user data (CD-ROM data Mode 2 / Form 2).

nl t
Sync Header Data EDC 0 ECC (P&Q)

O raf
Mode 1 12 4 2048 4 8 276
Auxiliary Field (288)
Sync Header Data

w D
y
Mode 2 12 4 2336

ie ry
Sync Header Data EDC ECC (P&Q)
XA
Mode 2 Form 1 12 4 8 2048 4 276
SubHeader Auxiliary Field (280)
ev a n
Sync Header Data Spare
XA
i
Mode 2 Form 2 12 4 8 2324 4
rR m

SubHeader
fo eli

SmallFrame(1) SmallFrame(98)

CD Digital Audio 6x4


Pr

SubChannel
Figure 13 - CD-ROM Sector Formats

A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 2340 or 2352 bytes per sector. These values cor-
respond to the user data plus various configurations of header, subheader and EDC/ECC.

This same area of the CD-ROM or CD audio media may store 1/75th of a second of two channel audio information for-
matted according to the CD-DA specification. (These audio channels are usually the left and right components of a ste-
reo pair.) An audio only density code value can be used to declare an area of the media to be invalid for data operations.

For data and mixed mode media (those conforming to ISO/IEC 10149), logical block address zero shall be assigned to
the block at MSF address 00/02/00. For audio media (those conforming only to IEC 908), logical block address zero
shall be assigned to the actual starting address of track 1. This may be approximated by using the starting address of
track 1 contained in the table of contents (TOC) or by assigning logical block address zero to the block at MSF address
00/02/00.

Logical addressing of CD-ROM information may use any logical block length. When the specified logical block length is
an exact divisor or integral multiple of the selected number of bytes per CD-ROM sector, the device shall map (one to
one) the bytes transferred from CD-ROM sectors to the bytes of logical blocks. For instance, if 2048 bytes are transferred
from each CD-ROM sector (specified by the CD-ROM density code value), and the logical block length is 512 bytes,
then each CD-ROM sector shall map to exactly four logical blocks. This Specification does not define the mapping of
logical block lengths which do not evenly divide or are not exact multiples of the selected number of bytes per CD-
ROM sector.

working draft ATAPI Page 45


Revision 1.2 CD-ROM Model
February 23, 1994 2:40 pm CD-ROM Media Organization

A track may be viewed as a partition of the CD-ROM address space. A CD-ROM media contains from one to ninety-
nine tracks. All information sectors of a track are required to be of the same type (audio or data) and mode. Each change
in the type of information on the disc requires a change in track number. A disc containing both audio and data would
have at least two tracks, one for audio and one for data.

The tracks of a CD media are numbered consecutively with values between 1 and 99. However, the first information track
may have a number greater than 1. Tracks have a minimum length of 300 sectors including any transition area that is part

nl t
of a track.

O raf
The CD-ROM media standards require transition areas between tracks encoded with different types of information. In
addition, transition areas may be used at the beginning or end of any track. For audio tracks the transition areas are
called pause areas. For data tracks, transition areas are called pre-gap and post-gap areas. See "Table 7 - Example Mixed

w D
y
Mode CD-ROM Disc Layout" on page 44 for an example. The IEC 908 and ISO/IEC 10149 standards specify minimum
time durations for these areas. Maximum time durations are not specified.

ie ry
Transition areas are formatted and the logical address continues to increment through transition areas. Some media (i.e.
discs with only one track) may not have transition areas. The means to determine the location of the transition areas is
vendor or application-specific and is addressed by other standards (e.g. ISO 9660).
ev a
CD-ROM is a unique device in the respect that some logical blocks on a disc may not be accessible by all commands.
n
SEEK commands may be issued to any logical block address within the reported capacity of the disc. READ commands
cannot be issued to logical blocks that occur in some transition areas, or to logical blocks within an audio track. PLAY
i
commands cannot be issued to logical blocks within a data track.
rR m

CD-ROM media have lead-in and lead-out areas. These areas are outside of the user-accessible area as reported in the
READ CD-ROM CAPACITY data. The lead-in area of the media is designated track zero. The lead-out area is designat-
fo eli

ed track 0AAh. The sub-channel Q in the lead-in track contains a table of contents (TOC) of the disc.

NOTE: The READ CD-ROM CAPACITY command returns the logical block address of the last block prior to the lead-out area. This location may be
in a transition area and therefore not a valid address for read operations.
Pr

The table of contents gives the absolute MSF location of the first information sector of each track. Control information
(audio/data, method of audio encoding, etc.) for each track is also given in the TOC. However, the TOC does not distin-
guish between the different modes of data tracks (i.e. CD-ROM Data Mode 1 vs. CD-ROM Data Mode 2).

The MSF locations of the beginning of data tracks in the TOC are required to be accurate; however, the TOC values for
audio tracks have a tolerance of plus or minus 75 sectors. Information from the TOC can be used to reply to a READ
CD-ROM CAPACITY command. When this is done, the drive implementor shall consider the possible tolerances and
return a value that allows access to all information sectors.

An index is a partition of a track. Pre-gap areas are encoded with an index value of zero. Pause areas at the beginning of
audio tracks are also encoded with an index value of zero. The first information sector of a track has an index value of
one. Consecutive values up to 99 are permitted. Index information is not contained in the TOC. Not all sectors are encod-
ed with the index value in the Q-sub-channel data (the requirement is 9 out of 10). A sector without an index value is pre-
sumed to have the same index as the preceding sector.

Tracks and indexes are not defined to be any particular length, (except for a minimum track length of 300 sectors.) A CD
disc may be created with a single information track that has a single index; or with 99 information tracks, each with 99
indexes.

The sub-channel information which is part of each sector includes a track relative MSF location value giving the dis-
tance from the first information sector of the track. On the media, this value decreases during the pre-gap area (sectors
with index values of 0) and increases for the rest of the track. The data, returned by the READ SUB-CHANNEL com-
mand with MSF bit set to zero, converts this to a track relative logical block address (TRLBA). The TRLBA is continual-

Page 46 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Model

ly increasing over the whole track, and pre-gap areas shall return negative values. When the MSF bit in the read sub-
channel command is set to one, the MSF track relative location value from the media is reported without change.

Note: The purpose of accessing MSF addresses less than 00M 02S 00F is to retrieve information, such as packet size,
from incrementally written discs. This information exists in the track descriptor block in the pre-gap area. Users can read
this information by scanning the area between 00M 01S 00F to 00M 02S 00F. While the media may contain multiple re-
dundant copies of the pre-gap data, the device shall only return one copy. The drive may not be able to read 00M 00S

nl t
00F since there is no Sub-Q information before this frame. Refer to CD-ROM Orange book for additional details.

O raf
7.3 CD-ROM Physical Data Format
The physical format of CD-ROM and CD-DA media uses a smaller unit of synchronization than the more familiar mag-

w D
y
netic or optical recording systems. The basic data stream synchronization unit is a small frame. This is not the same
large frame (sector) as referred to in the MSF unit. Each small frame consists of 588 bits. A sector on CD-ROM media
consists of 98 small frames.

ie ry
A CD-ROM small frame consists of:
1. 1 synchronization pattern (24+3 bits)
ev a
2. 1 byte of sub-channel data (14+3 bits)
n
3. 24 bytes of data (24 x (14+3) bits)
i
rR m

4. 8 bytes of CIRC code (8 x (14+3) bits) Total: 588 bits.


fo eli

Data, sub-channel and CIRC bytes are encoded with an 8-bit to 14-bit code; then three merging bits are added. The merg-
ing bits are chosen to provide minimum low-frequency signal content and optimize phase lock loop performance.
Pr

7.3.1 Frame Format for Audio


Each small frame of an audio track on a two-channel CD-DA or CD-ROM media consists of six digitized 16-bit samples
of each audio channel. These 24 bytes of data are combined with a synchronization pattern, CIRC bytes and a sub-chan-
nel byte to make a frame. Each frame takes approximately 136.05 µs to play. This gives a sampling rate of 44.1 kHz for
each channel. The sub-channel information creates the higher level sector grouping for audio tracks.

7.3.2 Sector Format for Data


The data bytes of 98 small frames comprise the physical unit of data referred to as a sector. (98 small frames times 24
bytes per small frame equals 2352 bytes of data per sector.)

A sector that contains CD-ROM Data Mode 1 data has the following format:

1. 12-byte synchronization field


2. 4-byte CD-ROM data header

Absolute M field
Absolute S field
Absolute F field
CD-ROM data mode field
3. 2048-byte user data field

working draft ATAPI Page 47


Revision 1.2 CD-ROM Model
February 23, 1994 2:40 pm CD-ROM Physical Data Format

4. 4-byte error detection code

5. 8 bytes zero

6. 276-byte layered error correction code

A sector that contains CD-ROM Data Mode 2 data has the following format:

nl t
O raf
1. 12-byte synchronization field
2. 4-byte CD-ROM data header

w D
Absolute M field

y
Absolute S field
Absolute F field
CD-ROM data mode field

ie ry
3. 2336-byte user data field (2048 bytes of mode 1 data plus 288 bytes of auxiliary data)
ev a
NOTE Many drives are capable of returning CD-ROM data mode one data in a CD-ROM data mode two format. This allows the user to investigate the
error detection and error correction codes. However data encoded as CD-ROM data mode two cannot be read as CD-ROM data mode one data.
i n
7.3.3 Sub-channel Information Formats
rR m

The sub-channel byte of each frame is assigned one bit for each of the 8 sub-channels, designated P, Q, R, S, T, U, V, W.
fo eli

Sub-channel P is a simple flag bit that may be used for audio muting control and track boundary determination.

Sub-channel Q has a higher level of structure. All the sub-channel Q bits of a sector define the sub-channel Q informa-
tion block. (For audio tracks, decoding the Q sub-channel is the only way to distinguish sector boundaries.)
Pr

The sub-channel Q block consists of 98 bits, one bit from each small frame in a sector. Three formats are defined for the
sub-channel Q information block. The first format provides location information and is defined as follows:

1. 2-bit sub-channel synchronization field


2. 4-bit ADR field (defines the format)

3. 4-bit control field (defines the type of information in this sector)

4. 8-bit track number

5. 8-bit index number

6. 24-bit track relative MSF address

7. 8 bits Reserved (0)

8. 24-bit Absolute MSF address

9. 16-bit CRC error detection code

This format is required to exist in at least nine out of ten consecutive sectors.

Page 48 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Model

The second and third formats are optional. If used, they shall exist in at least one out of 100 consecutive sectors. They in-
clude the absolute frame byte of the MSF address to provide location information continuity.
The second format gives the catalogue number of the disc (UPC/EAN bar code number). This information is constant
over the whole media.

The third format gives the International Standard Recording Code (ISRC) for each track. The ISRC is defined in ISO
3901. This format is not present on lead-in or lead-out tracks and may change only after the track number changes.

nl t
O raf
7.4 CD Audio Error Reporting
PLAY AUDIO commands with the immediate bit set in the audio control mode return status as soon as the command
has been validated (which may involve a seek to the starting address). The playback operation continues and may com-

w D
y
plete without notification to the Host Computer. Error termination of audio operations shall be reported to the Host Com-
puter by returning immediate CHECK CONDITION status to the next command (except for REQUEST SENSE and
INQUIRY.) The deferred error sense data is used to indicate that the error is not due to the current command.

ie ry
The status of the play operation may be determined by issuing a REQUEST SENSE command. The sense key is set to
NO SENSE and the audio status is reported in the additional sense code qualifier field.
ev a n
7.5 CD-ROM Ready Condition/Not Ready Condition
The ready condition occurs after a cartridge is inserted and the drive has performed its initialization tasks. These may in-
i
rR m

clude reading the table of contents from the media. This “Ready” is different from and shall not be confused with the
ATA Ready Status. A check condition status will be returned for the not ready condition only for commands that require
or imply a disc access.
fo eli

A not ready condition may occur for the following reasons:


1. There is no cartridge inserted.
Pr

2. The drive is unable to load or unload the cartridge.

3. The drive is unable to recover the table of contents.

working draft ATAPI Page 49


Revision 1.2 CD-ROM Model
February 23, 1994 2:40 pm CD-ROM Address Reporting Formats (MSF bit)

7.5.1 Packet Command Not Ready Status Utilization

Table 8 - Not Ready Error Reporting (by Command)


Command Opcode May Return Not Ready Error

nl t
INQUIRY 12h No

O raf
MODE SELECT(10) 55h No
MODE SENSE(10) 5Ah No
READ(10) 28h Yes
READ(12) A8h Yes

w D
y
READ CD-ROM CAPACITY 25h Yes
READ HEADER 44h Yes
READ SUB-CHANNEL 42h Yes

ie ry
READ CD BEh Yes
READ CD MSF B9h Yes
READ CD TRACK/INDEX D6h Yes
ev a
READ TOC 43h Yes
REQUEST SENSE 03h No
n
START STOP UNIT 1Bh Yes
i
TEST UNIT READY 00h Yes
rR m

SET CD-ROM SPEED BBh No


REZERO UNIT 01h Yes
SEEK 2Bh Yes
fo eli

PAUSE/RESUME 4Bh Yes


PLAY AUDIO 45h Yes
PLAY AUDIO EXTENDED A5h Yes
Pr

PLAY AUDIO MSF 47h Yes


PLAY TRACK RELATIVE(10) 49h Yes
PLAY TRACK RELATIVE(12) A9h Yes
AUDIO TRACK SEARCH D8h Yes
AUDIO SCAN BAh Yes
PREVENT/ALLOW MEDIUM REMOVAL 1Eh See Actions for Lock / Unlock / Eject
on page 116 for Actions allowed

7.6 CD-ROM Address Reporting Formats (MSF bit)


Several CD-ROM specific commands can return addresses either in logical or in MSF format. The READ HEADER,
READ SUB-CHANNEL and READ TABLE OF CONTENTS commands have this feature.

Table 9 - MSF Address Format


Bit
7 6 5 4 3 2 1 0
Byte
0 Reserved
1 M Field
2 S Field
3 F Field

Page 50 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Model

An MSF bit of zero requests that the logical block address format be used for the CD-ROM absolute address field or for
the offset from the beginning of the current track expressed as a number of logical blocks in a CD-ROM track relative
address field. This track relative logical block address (TRLBA) value is reported as a negative value in twos-comple-
ment notation for transition areas that have decreasing MSF encoded relative addresses.

An MSF bit of one requests that the MSF format be used for these fields. In certain transition areas, the relative MSF ad-
dresses are decreasing positive values. The absolute MSF addresses are always increasing positive [Link] M, S, and

nl t
F fields are expressed as binary numbers. Sensing Support for CD-Audio Commands

O raf
If any commands related to audio operations are implemented, then all the AUDIO commands shall be implemented. To
allow a method for the Host Computer to determine if audio operations are supported, an ATAPI CD-ROM Drive re-
sponding to a PLAY AUDIO command which has a transfer length of zero, with CHECK CONDITION status, and set-

w D
y
ting the sense key to ILLEGAL REQUEST does not support audio operations.

7.7 Error Reporting

ie ry
If any of the following conditions occur during the execution of a command, the ATAPI CD-ROM Drive shall return
CHECK CONDITION status. The appropriate sense key and additional sense code shall be set. The following list illus-
ev a
trates some error conditions and the applicable sense keys. The list does not provide an exhaustive enumeration of all
conditions that may cause the CHECK CONDITION status.
i n
Table 10 - Error Conditions and Sense Keys
rR m

Condition Sense Key


Invalid logical block address ILLEGAL REQUEST
fo eli

Unsupported option requested ILLEGAL REQUEST


Attempt to read a blank block ILLEGAL REQUEST
Attempt to play a data block as audio ILLEGAL REQUEST
Pr

ATAPI CD-ROM Drive reset or medium change since last command UNIT ATTENTION
Self diagnostic failed HARDWARE ERROR
Unrecovered read error MEDIUM ERROR / HARDWARE ERROR
Recovered read error RECOVERED ERROR
Overrun or other error that might be resolved by repeating the command ABORTED COMMAND

In the case of an invalid logical block address, the sense data information field shall be set to the logical block address
of the first invalid address.

In the case of an attempt to read a blank or previously unwritten block, the sense data information field shall be set to
the logical block address of the first blank block encountered. The data read up to that block shall be transferred.

There are other special error situations for CD-ROM devices. In the following cases the sense key shall be set to ILLE-
GIAL REQUEST and the additional sense code set to END OF USER AREA ENCOUNTERED ON THIS TRACK:
1. a post-gap area is encountered (i.e. a block with CD-ROM Data Mode 0);
2. a pre-gap area is encountered (i.e. a block with index equal to 0);

3. The information type (Data Mode vs. Audio etc.) changes.

When not performing audio playback, if the logical block address requested is not within a data track, the command shall
be terminated with CHECK CONDITION status. The sense key shall be set to ILLEGIAL REQUEST and the addition-
al sense code set to ILLEGAL MODE FOR THIS TRACK. This applies to audio-combined and audio media.

working draft ATAPI Page 51


Revision 1.2 CD-ROM Model
February 23, 1994 2:40 pm Error Reporting

nl t
O raf
w D
y
ie ry
ev a
Intentionally Left Blank
i n
rR m
fo eli
Pr

Page 52 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM ATA (Task File) Commands

8.0 CD-ROM ATA (Task File) Commands

8.1 ATA (Task File) Command Implementation Requirements


This section details the Commands that the CD-ROM Device shall support from the ATA Standard definition of the com-
mands.

nl t
O raf
Table 11 - ATA Command and Status Usage for ATAPI CD-ROM Devices
Command used Code Error Register Status Register

w D
BBK UNC IDNF ABRT TKONF AMNF DRDY DWF DSC CORR ERR

y
Acknowledge Media Change N DB V V
ATAPI Soft Reset M 08

ie ry
Boot - Post-boot N DC V V
Boot - Pre-boot N DD V V
Check Power Mode M E5 V V V V V
ev a
Door Lock N DE V V
Door Unlock N DF V V
n
Execute Drive Diagnostics M 90 Special Drive Diagnostic Errors V
Format Track N1 50 V V
i
rR m

Identify Drive N EC V V
Idle O E3 V V V V V
Idle Immediate M E1 V V V V V
fo eli

Initialize Drive Parameters N1 91 V V


NOP M 00 V V
ATAPI Pkt. Command M A0 Contains Packet Command Status V V V
Pr

ATAPI Identify Device M A1 V V V V


Read Buffer N E4 V V
Read DMA (w/retry) N C8 V V
Read DMA (wo/retry) N C9 V V
Read Long (w/retry) N 22 V V
Read Long (wo/retry) N1 23 V V
Read Multiple N C4 V V
Read Sector(s) (w/retry) N1 20 V V
Read Sector(s) (wo/retry) N1 21 V V
Read Verify Sector(s) N1 40 V V
(w/retry)
Read Verify Sector(S) N1 41 V V
(wo/retry)
Recalibrate N 1x V V
Seek N 7x V V
Set Features M EF V V V V V
Set Multiple Mode N C6 V V
Sleep M E6 V V V V V
Standby O E2 V V V V V
Standby Immediate M E0 V V V V V
Write Buffer N E8 V V
Write DMA (w/retry) N CA V V
Write DMA (wo/retry) N CB V V

working draft ATAPI Page 53


Revision 1.2 CD-ROM ATA (Task File) Commands
February 23, 1994 2:40 pm ATA (Task File) Command Implementation Requirements

Table 11 - ATA Command and Status Usage for ATAPI CD-ROM Devices
Command used Code Error Register Status Register
BBK UNC IDNF ABRT TKONF AMNF DRDY DWF DSC CORR ERR

Write Long (w/retry) N1 32 V V


Write Long (wo/retry) N1 33 V V

nl t
Write Multiple N C5 V V

O raf
Write Same N E9 V V
Write Sector(s) (w/retry) N1 30 V V
Write Sector(s) (wo/retry) N1 31 V V
Write Verify N 3C V V

w D
y
Invalid Command Code V V V V V
V = valid on this command
Y = Used by the CD-ROM ATAPI Drive, as specified by the ATA Standard

ie ry
N = Not supported by ATAPI CD-ROM Drives
M = Mandatory for ATA
Shaded = Commands utilized by the ATAPI CD-ROM Drive
ev a
1. This command is specified as Mandatory for ATA, but shall NOT be supported by ATAPI Devices
n
8.1.1 ATAPI Soft Reset
i
Note: For performance reasons, a soft reset may not force reading of TOC.
rR m

See "6.2 ATAPI Soft Reset Command and Protocol" on page 36


fo eli

8.1.2 Check Power Mode


This command checks the power mode.
Pr

If the drive is in, going to, or recovering from the Standby Mode, the drive shall set BSY, set the Sector Count Register
to 0x00, Clear BSY, and generate an interrupt.

If the drive is in Idle Mode, the drive shall set BSY, set the Sector Count Register to 0xFF, clear BSY, and generate and
Interrupt.

8.1.3 Execute Drive Diagnostics


This command shall perform the internal diagnostic tests implemented by the drive. The DRV bit is ignored. Both
drives, if present, shall execute this command. See the ATA Standard (X3T9.2/791D) for more information.

Implementer’s Note: ATAPI device drivers issuing the Execute Diagnostics command will cause all ATA and ATAPI de-
vices to execute a diagnostic command resulting in a device reset. To prevent unwanted resets and or driver compatibili-
ty issues, ATAPI drivers should not issue the Execute Diagnostics command. The command is implemented by ATAPI
devices for ATA compatibility only.

8.1.4 Idle Immediate


This command causes the drive to set BSY, enter the Idle Mode, clear BSY, and generate an interrupt. The interrupt is
generated even though the drive may not have fully transitioned to Idle Mode.

8.1.5 Nop

Page 54 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM ATA (Task File) Commands

This command enables a host which can only perform 16-bit register accesses to check drive status. The drive shall re-
spond as it does to an unrecognized command by setting Abort in the Error Register, Error in the Status Register, clearing
Busy in the Status Register, and asserting INTRQ.

nl t
O raf
w D
y
ie ry
ev a i n
rR m
fo eli
Pr

working draft ATAPI Page 55


Revision 1.2 CD-ROM ATA (Task File) Commands
February 23, 1994 2:40 pm ATA (Task File) Command Implementation Requirements

8.1.6 Packet Command


See section 5.2, "PACKET Command", on page 21.

8.1.7 ATAPI Identify Device


The ATAPI IDENTIFY DEVICE command enables the host to receive parameter information from the drive. The param-

nl t
eter words in the buffer have the arrangement and meaning defined in the table below. All reserved bits or words shall be

O raf
zero. Although many of the fields of information returned by the ATAPI Identify Device command are inappropriate for a
CD-ROM drive, the fields that shall be returned with meaningful information are shown in "Table 12 - Identify Drive,
Fields Supported by CD-ROM".

w D
y
Like all ATAPI commands (A0h, A1h and 08h), this command can be issued regardless of the state of the DRDY.

Table 12 - Identify Drive, Fields Supported by CD-ROM

ie ry
Word Description Used
0 General Configuration Mandatory
ev a
1 Cylinders No
n
2 Reserved No
3 Heads No
i
4 Number of unformatted bytes per track No
rR m

5 Number of unformatted bytes per sector No


6 Number of sectors per track No
7-9 Reserved No
fo eli

10-19 Serial Number Optional


20 Buffer Type Optional
21 Buffer Size Optional
Pr

22 ECC bytes available No


23-26 Firmware revision Mandatory
27-46 Model Number Mandatory
47 Multiple Sector Command, Sector Count No
48 Double Word I/O (shall be 00h for CD-ROM) No
49 Capabilities: Mandatory
LBA bit shall be supported; DMA, IORDY bits are optional.
50 Reserved No
51 PIO Cycle Timing Mandatory
52 DMA Cycle Timing Mandatory
53 Validity of words 54-58 and 64-70 in this table Mandatory
54 - 56 Current Cylinder/Heads/Sectors No
57-58 Current Capacity No
59 Reserved No
60-61 User Addressable Sectors No
62 Singleword DMA mode Mandatory
63 Multiword DMA mode Mandatory
64 Enhanced PIO mode Mandatory

Page 56 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM ATA (Task File) Commands

Table 12 - Identify Drive, Fields Supported by CD-ROM


Word Description Used
65 Blind PIO minimum cycle time Mandatory
66 Recommended Multi Word DMA Transfer Cycle Time Optional
67 Minimum PIO Transfer Cycle Time without Flow Control Optional

nl t
68 Minimum PIO Transfer Cycle Time with IORDY Flow Control Optional

O raf
69 - 70 Reserved (for advanced PIO support) No
71 - 127 Reserved No
128 - 159 Vendor Unique No
160 - 255 Reserved No

w D
y
“Optional” Identify Drive words, which are not supported, shall be set to zero.

The ATAPI Identify Device command shall not delay the transfer of the Identify Drive data by more than 200 ms after

ie ry
receipt of the command.
ev a
[Link] General Configuration Word (0)
n
Table 13 - Identify Drive Data - General Configuration (Word 0)
i
Bit
7/15 6/14 5/13 4/12 3/11 2/10 1/9 0/8
rR m

Byte
0 Removable CMD DRQ Type Reserved CMD Packet Size
1 Protocol Type Reserved Device Type
fo eli

Bits 15-14 Protocol Type This field indicates the protocol in use by the device.
0Xb = ATA
Pr

10b = ATAPI
11b = Reserved

Bit 13 Reserved This is reserved for future enhancement

Bits 12-8 Device Type This field indicates the device type.
The peripheral types are described in Table 31, “Peripheral Drive Types” on
page 68.
Bit 7 Removable Indicates that the device has removable media.

Bits 6-5 CMD DRQ Type This field indicates the command packet DRQ type used by this device.

00b = Microprocessor DRQ:


ATAPI devices reporting Microprocessor DRQ assertion shall assert DRQ
within 3ms of receiving the A0h ATAPI Packet Command.

Implementer’s Note: Devices reporting Microprocessor DRQ require the de-


vice driver to poll for up to 3ms or accept the granularity of an available tim-
er tick. These issues may result in undesirable system delays when used with
multi-threaded OS drivers.

01b = Interrupt DRQ:


ATAPI devices reporting Interrupt DRQ assertion shall assert INTRQ in
conjunction with the assertion of the command packet DRQ. These

working draft ATAPI Page 57


Revision 1.2 CD-ROM ATA (Task File) Commands
February 23, 1994 2:40 pm ATA (Task File) Command Implementation Requirements

devices shall assert DRQ within 10ms of receiving the A0h ATAPI Packet
Command.

10b = Accelerated DRQ:


ATAPI devices reporting Accelerated DRQ assertion shall assert DRQ within
50us of receiving the A0h ATAPI Packet Command.

nl t
11b = Reserved for future use.

O raf
Bits 4-2 Reserved This field is unique for each protocol and is reserved for future use.

Bits 1-0 Command Packet Size This field indicates the size of the command packets used by this device.

w D
y
00b = 12 bytes (ALL CD-ROM)
01b = 16 bytes (Reserved for SAM Compliant Devices)
1Xb = Reserved for future use.

ie ry
[Link] Serial Number (Words 10 - 19)
ev a
This optional field shall contain the drive’s serial number formatted as right-justified ASCII, padded with spaces (20h). If
n
the field is not supported then it shall be filled with spaces.
i
rR m

[Link] Buffer Type (Word 20)


The contents of the field are determined by the manufacturer. These codes are not typically used by ATAPI devices, how-
fo eli

ever, they maybe useful for diagnostic programs which perform initialization routines.

[Link] Buffer Size (Word 21)


Pr

The contents of this field indicate the size of the buffer used for host transfers and caching by the device.

[Link] Firmware Revision (Words 23-26)


The contents of this field are vendor-specific, left-justified, and padded with spaces.

[Link] Model Number (Words 27 - 46)


The contents of this field are vendor-specific, left-justified, and padded with spaces.

[Link] Capabilities Word (Word 49)

Table 14 - Identify Drive Data - Capabilities Word (49)


Bit
7/15 6/14 5/13 4/12 3/11 2/10 1/9 0/8
Byte
0 Vendor Unique
1 Reserved Reserved Reserved Reserved IORDY IORDY LBA Sup- DMA Sup-
for Future for Future for Pseudo Supported can be dis- ported ported
ATAPI ATAPI DMA Sup- abled
Standard Standard port

Bit 8 DMA Supported This bit indicates that the Device supports the DMA mode of data transfer.

Page 58 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM ATA (Task File) Commands

Bit 9 LBA Supported Indicates that the Device supports the LBA form of addressing. The ATAPI
Devices shall set this bit to one.

Bit 10 IORDY can be disabled Is used to indicate a device’s ability to enable or disable the use of IORDY. If
this bit is set to one, then the device supports the disabling of IORDY.

nl t
Bit 11 IORDY Supported This is used to help determine whether a device supports IORDY. If this bit is

O raf
set to one, then the device supports IORDY operation. If this bit is zero then
the device may support IORDY (this ensures backward compatibility.)

Bit 13 ATAPI Reserved Reserved for a Future ATAPI enhancement.

w D
y
Bit 14 ATAPI Reserved Reserved for a Future ATAPI enhancement.

ie ry
[Link] PIO Data Transfer Cycle Timing (Word 51)
ev a
The PIO transfer timing for each ATA device falls into categories which have unique parametric timing specifications. To
determine the proper device timing category, compare the contents of this field with the Cycle Time specified in Figure 6
n
of the ATA document in Appendix B. The value returned in Bits 15-8 shall fall into one of the categories specified, and if
it does not, then Mode 0 shall be used to serve as the default timing.
i
rR m

[Link] DMA Data Transfer Cycle Timing (Word 52)


fo eli

The DMA transfer timing for each ATA device falls into categories which have unique parametric timing specifications.
To determine the proper device timing category, compare the contents of this field with the Cycle Time specified in Fig-
ures 8 and 9 of the ATA document in Appendix B. The value returned in Bits 15-8 shall fall into one of the categories
specified, and if it does not, then Mode 0 shall be used to serve as the default timing.
Pr

[Link] Field Validity (Word 53)


Bit 0 When = 1, this bit guarentees that the fields contained in words 54-58 are valid.
Bit 1 When = 1, this bit guarentees that the fields contained in words 64-70 are valid.

[Link] Single Word DMA Transfer (Word 62)


The low order byte identifies by bit all of the modes which are supported, e.g., if Mode 0 is supported, bit 0 is set. The
high order byte contains a single bit set to indicate which mode is active, e.g., if Word 0 is active, bit8 is set.

[Link] Multi Word DMA Transfer (Word 63)


The low order byte identifies by bit all of the modes which are supported, e.g., if Mode 0 is supported, bit 0 is set. The
high order byte contains a single bit set to indicate which mode is active, e.g., if Word 0 is active, bit8 is set.

[Link] Enhanced PIO Mode (Word 64)


Bits 7 through 0 of the word 64 of the Identify Drive parameter information is defined as the Advanced PIO Data Trans-
fer Supported Field. This field is bit significant. Any number of bits may be set in this field by the device to indicate
which Advanced PIO Modes that it is capable of supporting. Of these bits, bits 7 through 1 are reserved for future ad-
vanced PIO modes. Bit 0, if set, indicates that the device supports PIO Mode 3.

working draft ATAPI Page 59


Revision 1.2 CD-ROM ATA (Task File) Commands
February 23, 1994 2:40 pm ATA (Task File) Command Implementation Requirements

[Link] Minimum Multi-word DMA Transfer Cycle Time per Word (Word 65)
Word 65 of the parameter information of the IDENTIFY DRIVE command is defined as the Minimum Multi-word
DMA Transfer Cycle Time Per Word. This field defines, in nanoseconds, the minimum cycle time that the device can
support when performing Multi-word DMA transfers on a per word basis.

Any device which supports Multi-word DMA Mode 1 or above shall support this field, and the value in word 65 shall

nl t
not be less than 150.

O raf
If the device does not support this field, the device shall return a value of zero in this field.

[Link] Manufacturer’s Recommended Multi-word DMA Transfer Cycle Time (Word 66)

w D
y
Word 66 of the parameter information of the IDENTIFY DRIVE command is defined as the Manufacturer’s Recom-
mended Multi-word DMA Transfer Cycle Time. This field defines, in nanoseconds, the minimum cycle time per word

ie ry
during a single sector host transfer while performing a multiple sector READ DMA or WRITE DMA commands over
all locations on the media under nominal conditions. A cycle time less than this value may cause DMARQ to be deassert-
ed at a rate which may reduce throughput without data corruption.
ev a
Any device which supports Multi-word DMA Mode 1 or above shall support this field, and the value in word 66 shall
n
not be less than the value in word 65.
i
If the device does not support this field, the device shall return a value of zero in this field.
rR m
fo eli

[Link] Minimum PIO Transfer Cycle Time Without Flow Control (Word 67)
Word 67 of the parameter information of the IDENTIFY DRIVE command is defined as the Minimum PIO Transfer
Without FLow Control Cycle Time. This field defines, in nanoseconds, the minimum cycle time that, if used by the host,
Pr

the device guarantees data integrity during the transfer without utilization of flow control.

Any device which supports PIO Mode 3 or above shall support this field, and the value in word 67 shall not be less than
180.

If the device does not support this field, the device shall return a value of zero in this field.

[Link] Minimum PIO Transfer Cycle Time with IORDY Flow Control (Word 68)
Word 68 of the parameter information of the IDENTIFY DRIVE command is defined as the Minimum PIO Transfer
With IORDY Flow Control Cycle Time. This field defines, in nanoseconds, the minimum cycle time that the device can
support while performing data transfers while utilizing IORDY flow control.

Any device which supports PIO Mode 3 or above shall support this field, and the value in word 68 shall not be less than
180. If the device does not support this field, the device shall return a value of zero in this field.

Page 60 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM ATA (Task File) Commands

8.1.8 Set Features


The Set Features command is used to set some interface timing and protocol modes. These modes are set at Post by
many BIOSes. The contents of the ATAPI Features Register indicates the function to be performed.

Table 15 - Contents of the Feature Register for Set Features Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Set (1)/ Feature Number
Clear (0)

w D
Feature

y
ie ry
Table 16 - Set Feature Register Definitions
Feature Number Set Feature Commands Supported
ev a
01h Enable 8-bit data transfers No
02h Enable write cache No
n
03h Set transfer mode based on value in sector count register Mandatory
33h Disable retry No
i
rR m

44h Vendor unique length of ECC on read long/write long commands No


54h Set cache segments to sector count register value No
5Dh Enable Shared Interrupts Optional
fo eli

55h Disable read look-ahead feature No


66h Disable reverting to power on defaults Mandatory
77h Disable ECC No
Pr

81h Disable 8-bit data transfers No


82h Disable write cache No
88h Enable ECC No
99h Enable retries No
AAh Enable read look-ahead feature No
ABh Set maximum prefetch using sector count register value No
BBh 4 bytes of ECC apply on read long/write long commands No
CCh Enable reverting to power on defaults Mandatory
DDh Disable Shared Interrupts Optional

If the value in the register is not supported or is invalid, the drive posts an Aborted Command error.
At power on, or after a hardware reset, the default mode is the same as that represented by values greater than 80h.

working draft ATAPI Page 61


Revision 1.2 CD-ROM ATA (Task File) Commands
February 23, 1994 2:40 pm ATA (Task File) Command Implementation Requirements

[Link] Set Transfer Mode (03h)


A host can choose the transfer mechanism by Set Transfer Mode and specifying a value in the Sector Count Register.
The upper 5 bits define the type of transfer and the low order 3 bits encode the mode value. Since both PIO and DMA
settings can be active simultaneously, the Device shall maintain independent transfer mode settings for both PIO and
DMA.

nl t
Table 17 - Feature Number Description for Set Feature Command

O raf
Feature Number Default Setting
03h Data Transfer Mode. Mode contained in Sector Count Register. PIO & DMA Mode 0
Value in Sector

w D
Count Register Definition

y
00000 00x PIO Default Transfer Mode
00001 xxx PIO Flow Control Transfer mode x

ie ry
00010 xxx Single Word DMA mode x
00011 xxx Reserved (For Pseudo DMA mode)
ev a
If a device which supports this specification receives a Set Feature command with a Set Transfer Mode parameter and a
Sector count Register value of 00000 000, it shall set its default PIO transfer mode.
n
If a device which supports this specification receives a Set Feature command with a Set Transfer Mode parameter and a
i
Sector Count Register value of 00000 001 and the device supports disabling of IORDY, then the device shall set its de-
rR m

fault PIO transfer mode and disable IORDY.


fo eli

[Link] Disable Reverting to Power On Defaults (66h)


A setting of 66h allows settings of greater than 80h which may have been modified since power on to remain at the same
setting after a software reset. At power on, or after a hardware reset, the default mode is the same as that represented by
Pr

values greater than 80h.

[Link] Enable Reverting to Power On Defaults (CCh)


A setting of CCh will cause the Device to revert back to the default for settings of greater than 80h, which may have
been modified since power on, after a software reset.

[Link] Disable Shared Interrupts (DDh)


A setting of DDh will disable shared interrupts. Devices supporting Enable Shared Interrupts shall support this com-
mand.

[Link] Enable Shared Interrupts (5Dh)


A setting of 5Dh allows the selection of shared interrupts. Devices supporting this command shall assert interrupts via a
low true open collector driver.

8.1.9 Sleep
This command is the only way to cause the drive to enter Sleep Mode. The drive is spun down, and when it is stopped,
BSY is cleared, an interrupt is generated, and the interface becomes inactive.

Page 62 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM ATA (Task File) Commands

The only way to recover from Sleep mode is with a software reset or a hardware reset.

NOTE: The use of hardware reset to recover from Sleep mode may be incompatible with continued operation of the host system.

A drive shall not power on in Sleep Mode nor remain in Sleep Mode following a reset sequence. If the drive is already
spun down, the spin down sequence is not executed.

nl t
O raf
8.1.10 Standby Immediate
This command causes the drive to enter the Standby Mode. The drive may return the interrupt before the transition to
Standby Mode is completed.

w D
y
If the drive has already spun down, the spin down sequence is not executed.

For Standby immediate the drive may return the interrupt before the transition to Standby Mode is completed.

ie ry
ev a i n
rR m
fo eli
Pr

working draft ATAPI Page 63


Revision 1.2 CD-ROM ATA (Task File) Commands
February 23, 1994 2:40 pm ATA (Task File) Command Implementation Requirements

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 64 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Packet Commands

9.0 CD-ROM Packet Commands

9.1 Packet Command Implementation Requirements


The first byte of all ATAPI CD-ROM Drive Command Packets shall contain an operation code as defined in this Specifi-
cation. ATAPI CD-ROM Drives shall implement all commands with mandatory operation codes.

9.1.1 Reserved
Reserved bits, fields, bytes, and code values are set aside for future standardization. Their use and interpretation may be
specified by future extensions to this or other standards. A reserved bit, field, or byte shall be set to zero, or in accor-
dance with a future extension to this standard. The recipient shall not check reserved fields.

9.1.2 Operation Code Types


The operation code types are defined in Table 18 - below.

Table 18 - Operation Code Types


Operation
Description
Code Type
M Mandatory - Commands so designated shall be implemented in order to meet the minimum require-
ment of this Specification.
O Optional - Commands so designated, if implemented, shall be implemented as defined in this Specifi-
cation.
V Vendor-specific - Operation codes so designated are available for vendor defined commands. See the
vendor specifications where compatibility is desired.
R Reserved - Operation codes so designated shall not be used. They are reserved for future extensions
to this Specification.

working draft ATAPI Page 65


Revision 1.2 CD-ROM Packet Commands
February 23, 1994 2:41 pm ATAPI Command Packet Description

9.2 ATAPI Command Packet Description


An ATAPI command is communicated by sending a Command Packet to the ATAPI CD-ROM Drive. For several com-
mands, the Command Packet is accompanied by a list of parameters sent upon receiving an interrupt following the Com-
mand Packet being sent. See the specific commands for detailed information.

The Command Packet always has an operation code as its first byte.

nl t
O raf
For all commands, if there is an invalid parameter in the Command Packet, then the ATAPI Device shall abort the com-
mand without altering the medium.

w D
y
Table 19 - Typical Command Packet for Most Commands
Bit
7 6 5 4 3 2 1 0

ie ry
Byte
0 Operation Code
1 Reserved Reserved
ev a
2 (MSB)
n
3 Logical Block Address (if required)
4
i
5 (LSB)
rR m

6 Reserved
7-8 (MSB) Transfer Length (if required) or
Parameter List Length (if required) or
fo eli

Allocation Length (if required)(LSB)


9 Reserved
10 Reserved
Pr

11 Reserved

Table 20 - Typical Command Packet for Some Extended Commands


Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code
1 Reserved Reserved
2 (MSB)
3 Logical Block Address (if required)
4
5 (LSB)
6 (MSB)
7 Transfer Length (if required) or
8 Parameter List Length (if required) or
Allocation Length (if required)
9
(LSB)
10 Reserved
11 Reserved

Page 66 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Packet Commands

9.2.1 Operation Code


The operation code of the Command Packet has a group code field and a command code field. The three-bit group code
field provides for eight groups of command codes. The five-bit command code field provides for thirty-two command
codes in each group. Thus, a total of 256 possible operation codes exist. Operation codes are defined in the subsequent
sections.

Table 21 - Operation Code


Bit 7 6 5 4 3 2 1 0
Group Code Command Code

Note that the Group / Command code fields have been kept for backward compatibility and are not used by ATAPI.

9.2.2 Logical Block Address


The logical block address shall begin with block zero and be contiguous up to the last logical block.

9.2.3 Transfer Length


The Transfer Length Field specifies the amount of data to be transferred, usually the number of blocks. For several com-
mands the transfer length indicates the requested number of bytes to be sent as defined in the command description. For
these commands the Transfer Length Field may be identified by a different name. See the following descriptions and the
individual command descriptions for further information.

In commands that use multiple bytes for the transfer length, a transfer length of zero indicates that no data transfer shall
take place. A value of one or greater indicates the number of blocks that shall be transferred.

9.2.4 Parameter List Length


The Parameter List Length is used to specify the number of bytes to be sent to the Drive. This field is typically used in
Command Packets for parameters that are sent to a Drive (e.g. mode parameters, diagnostic parameters, etc.). A parame-
ter length of zero indicates that no data shall be transferred. This condition shall not be considered as an error.

9.2.5 Allocation Length


The Allocation Length Field specifies the maximum number of bytes that a Host Computer has allocated for returned
data. An allocation length of zero indicates that no data shall be transferred. This condition shall not be considered as an
error. The Drive shall terminate the data transfer when allocation length bytes have been transferred or when all available
data have been transferred to the Host Computer, whichever is less. The allocation length is used to limit the maximum
amount of data (e.g. sense data, mode data, etc.) returned to a Host.

9.3 Status
A Status byte shall be sent from the Drive to the Host Computer at the completion of each command unless the com-
mand is terminated by one of the following events:
1. a hard reset condition;
2. an unexpected event

working draft ATAPI Page 67


Revision 1.2 CD-ROM Packet Commands
February 23, 1994 2:41 pm Immediate Command Processing Considerations

Status is normally presented at the end of a command, but in some cases may occur prior to transferring the Command
Packet.

For a description of the Status Byte see "Figure 6 - ATAPI Status Register (ATA Status Register)" on page 40.

9.4 Immediate Command Processing Considerations

nl t
O raf
Immediate commands are a class of commands which return completion status to the host system before they are finished
executing the command. The purpose of immediate commands is to allow the host to execute more than one command at
a time on the same IDE cable. An example of a typical overlapped cd-rom command execution would be to Play audio
while accessing data from a disk drive on the same cable. In this example the host system would issue a Play Audio com-
mand. The ATAPI CD-Rom device would accept the command, and if valid return status to the host immediately. The

w D
y
host system is now free to issue additional commands to any other device at the same IDE port address including the
ATAPI device executing the immediate command.

ie ry
ATAPI devices use the DSC bit to indicate the completion status of immediate commands. No INTRQ is issued by these
device when the DSC bit is set, so it the responsibility of the ATAPI driver to poll this bit to determine the completion
status of the immediate command. See also"5.6 Overlapped Command Operation" on page 23.
ev a n
9.5 Command Processing Considerations and Exception Conditions
The following sections describe some exception conditions and errors associated with command processing and the se-
i
rR m

quencing of commands.

9.5.1 Parameter Rounding


fo eli

Certain parameters sent to an ATAPI CD-ROM Drive with various commands contain a range of values. ATAPI CD-
ROM Drives may choose to implement only selected values from this range. When the ATAPI CD-ROM Drive receives
a value that it does not support, it either rejects the command (CHECK CONDITION status with ILLEGAL REQUEST
Pr

sense key) or it rounds the value received to a supported value. The ATAPI CD-ROM Drive shall reject unsupported val-
ues unless rounding is permitted in the description of the parameter.

Rounding of parameter values, when permitted1, shall be performed as follows - An ATAPI CD-ROM Drive that re-
ceives a parameter value that is not an exact supported value shall adjust the value to one that it supports and shall re-
turn CHECK CONDITION status with a sense key of RECOVERED ERROR. The additional sense code shall be set to
ROUNDED PARAMETER. The Host Computer is responsible for issuing an appropriate command to learn what value
the ATAPI CD-ROM Drive has selected.

9.6 Unit Attention Condition


The ATAPI CD-ROM Drive shall generate a unit attention whenever the ATAPI CD-ROM Drive has been reset by a hard
reset condition, or by a power-on reset. The ATAPI CD-ROM Drive shall also generate a unit attention condition when-
ever one of the following events occurs:
1. A removable medium may have been changed;
2. The version or level of microcode has been changed;

3. INQUIRY or Packet Identify Drive Data has been changed;

1. Generally, the ATAPI CD-ROM Drive should adjust maximum-value fields down to the next lower supported
value than the one specified by the Host Computer. Minimum-value fields should be rounded up to the next higher
supported value than the one specified by the Host Computer. In some cases, the type of rounding (up or down)
is explicitly specified in the description of the parameter.

Page 68 working draft ATAPI


ATAPI CD-ROM Specification
CD-ROM Packet Commands

4. The mode parameters in effect for the Host Computer have been restored from non-volatile memory;

5. Any other event occurs that requires the attention of the Host Computer.

The ATAPI CD-ROM Drive may queue unit attention conditions. After the first unit attention condition is cleared, anoth-
er unit attention condition may exist (e.g. a power on condition followed by a microcode change condition).

The unit attention condition shall persist, until the Host Computer clears the condition as described in the following para-
graphs.

If an INQUIRY command is received from an Host Computer with a pending unit attention condition, the ATAPI CD-
ROM Drive shall perform the INQUIRY command and shall not clear the unit attention condition.
If a REQUEST SENSE command is received from a Host Computer with a pending unit attention condition, then the
ATAPI CD-ROM Drive shall either:
1. report any pending sense data and preserve the unit attention condition, or,
2. report the unit attention condition, may discard any pending sense data, and clear the unit attention condition.

If an Host Computer issues a command other than INQUIRY or REQUEST SENSE while a unit attention condition ex-
ists for that Host, the ATAPI CD-ROM Drive shall not perform the command and shall report CHECK CONDITION
status unless a higher priority status as defined by the ATAPI CD-ROM Drive is also pending (e.g. BUSY).

9.7 Commands and Parameters


The ATAPI CD-ROM commands are derived from the SCSI CD-ROM command set.

With the exception of the CD-ROM Track/Index and MSF addressing techniques, the interface uses logical rather than
physical addressing for all data blocks. Each Device may be interrogated to determine how many blocks it contains.

Commands are classified as mandatory, optional, or vendor-specific. ATAPI CD-ROM drives are required to implement
all mandatory commands and may implement other commands as well. ATAPI CD-ROM Drives contain commands that
facilitate the writing of self-configuring software drivers that can discover all necessary attributes without prior knowl-
edge of specific peripheral characteristics (such as storage capacity).

working draft ATAPI Page 69


Revision 1.2 CD-ROM Packet Commands
February 23, 1994 2:41 pm ATAPI Packet Commands for CD-ROM Devices

9.8 ATAPI Packet Commands for CD-ROM Devices

Table 22 - Packet Commands Supported by CD-ROM Drives


Command Description Opcode Type Reference

nl t
AUDIO SCAN BAh O section 9.8.1 on page 71

O raf
INQUIRY 12h M section 9.8.2 on page 75
MODE SELECT (10) 55h M section 9.8.3 on page 83
MODE SENSE (10) 5Ah M section 9.8.4 on page 85
PAUSE/RESUME 4Bh O* section 9.8.6 on page 103

w D
y
PLAY AUDIO (10) 45h O* section 9.8.7 on page 105
PLAY AUDIO (12) A5h O* section 9.8.8 on page 108
PLAY AUDIO MSF 47h O* section 9.8.9 on page 109

ie ry
PLAY TRACK RELATIVE(10) 49h O* section 9.8.10 on page 111
PLAY TRACK RELATIVE(12) A9h O* section 9.8.11 on page 113
Reserved for - PLAY CD-ROM XA (12) BDh R** section B.1.1 on page 179
ev a
Reserved for SEND CD-ROM XA ADPCM DATA BCh R** section B.1.2 on page 181
PREVENT/ALLOW MEDIUM REMOVAL 1Eh M section 9.8.12 on page 115
n
READ (10) 28h M section 9.8.13 on page 117
i
READ (12) A8h O section 9.8.13 on page 117
rR m

READ CD-ROM CAPACITY 25h M section 9.8.15 on page 121


READ CD BEh M section 9.8.16 on page 123
READ CD MSF B9h M section 9.8.17 on page 133
fo eli

READ HEADER 44h M section 9.8.18 on page 135


READ SUB-CHANNEL 42h M section 9.8.19 on page 137
READ TOC 43h M section 9.8.20 on page 145
Pr

REQUEST SENSE 03h M section 9.8.21 on page 153


REZERO UNIT 01h O section 9.8.22 on page 161
SEEK 2Bh M section 9.8.23 on page 163
SET CD-ROM SPEED BBh O section 9.8.24 on page 165
STOP PLAY / SCAN 4Eh M section 9.8.25 on page 167
START STOP UNIT 1Bh M section 9.8.26 on page 169
TEST UNIT READY 00h M section 9.8.27 on page 171
Reserved for future use B4h
Reserved for future use BFh
Key: M = command implementation is mandatory.
O = command implementation is optional.
* = indicates a PLAY AUDIO command. If any of the PLAY AUDIO commands (indicated by an * in the type
column) are implemented, all the PLAY AUDIO commands shall be implemented by the ATAPI CD-ROM
Drive.
** = indicates a CD-ROM XA command. If any of the CD-ROM XA commands (indicated by an ** in the type
column) are implemented, all the CD-ROM XA commands shall be implemented by the ATAPI CD-ROM
Drive.

Page 70 working draft ATAPI


ATAPI CD-ROM Specification
AUDIO SCAN Command

9.8.1 AUDIO SCAN Command


The AUDIO SCAN command requests a fast-forward or fast-reverse audio scan operation starting from the Scan Starting
Address. The command shall scan all the way to the end of the media (last audio track).

This command responds with immediate status, allowing overlapped commands. This command shall set the DSC bit
upon command completion. See also "9.4 Immediate Command Processing Considerations" on page 68.

nl t
O raf
A Direction (DIRECT) bit of zero indicates a fast-forward. A DIRECT bit of one indicates a fast-reversed operation.

The Scan Starting Address specifies the address at which the Audio Fast Scan shall begin. The Type Field determines the
interpretation of the address.

w D
y
Like the Audio Play Command, the AUDIO SCAN Command shall terminate the scan at the last audio track or upon re-
ceipt of the STOP PLAY / SCAN Command. Upon receipt of the STOP PLAY / SCAN Command the Device shall set
the current address to the last address output during the AUDIO SCAN Command. Subsequent Audio Play Commands

ie ry
shall cause the device to begin playing at the location last output by the AUDIO SCAN Command. Therefore, the host
must issue an AUDIO PLAY Command immediately following a STOP PLAY / SCAN Command to resume playing au-
dio at normal speed. See "Figure 17 - Stop Play/Play Audio/Audio Scan/Pause/Resume Sequencing" on page 168 for ad-
ev a
ditional information.
n
Table 23 - AUDIO SCAN Command
i
rR m

Bit
7 6 5 4 3 2 1 0
Byte
fo eli

0 Operation code (BAh)


1 Reserved DIRECT Reserved
2 Scan Starting Address Field
3
Pr

4
5
6 Reserved
7
8
9 Type Reserved
10 Reserved
11 Reserved

Bits 7-6 Type This field specifies the “Type” of address contained in the Scan Starting Ad-
dress Field.

0 0 Logical Block Address format


0 1 AMIN, ASEC and AFRAME format
1 0 Track Number (TNO) format
1 1 Reserved

See "[Link] Play Audio with Overlapped Packet Commands" on page 106 for information on overlapped commands
during an Audio Scan operation.

working draft ATAPI Page 71


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm AUDIO SCAN Command

Table 24 - Scan Starting Address in Logical Block Format


Bit
7 6 5 4 3 2 1 0
Byte
2 Starting Logical Block Address

nl t
3

O raf
4
5

w D
y
ie ry
Table 25 - Scan Starting Address in AMIN, ASEC and AFRAME Format
Bit
7 6 5 4 3 2 1 0
ev a
Byte
2 Reserved
n
3 CD-absolute time (AMIN)
4 CD-absolute time (ASEC)
i
5 CD-absolute time (AFRAME)
rR m

The AMIN, ASEC and AFRAME fields specifies the relative running time from the beginning of the disc. The AMIN
fo eli

field has a range of 00 to 99d (63h). The ASEC ranges from 00 to 59d (3Bh). The AFRAME field has a range of 00 to
74d (4Ah). All MSF fields shall be Binary.
Pr

Table 26 - Scan Starting Address in Track Number (TNO) Format


Bit
7 6 5 4 3 2 1 0
Byte
2 Reserved
3 Reserved
4 Reserved
5 Track Number (TNO)

The Track Number field specifies the track in binary notation at which the scan operation will begin. This field has a
range of 01h to 63h.

Page 72 working draft ATAPI


ATAPI CD-ROM Specification
AUDIO SCAN Command

Table 27 - Recommended Sense Key, ASC and ASCQ for Audio Scan Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 3A MEDIUM NOT PRESENT

ie ry
03 02 NO SEEK COMPLETE
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
ev a
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
n
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
i
05 54 ILLEGAL MODE FOR THIS TRACK
rR m
fo eli
Pr

working draft ATAPI Page 73


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm AUDIO SCAN Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 74 working draft ATAPI


ATAPI CD-ROM Specification
INQUIRY Command

9.8.2 INQUIRY Command


The INQUIRY command requests that information regarding parameters of the ATAPI CD-ROM Drive be sent to the
Host Computer. An option allows the Host Computer to request additional information about the ATAPI CD-ROM Drive.

Table 28 - INQUIRY Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (12h)
1 Reserved EVPD

w D
2 Page Code

y
3 Reserved
4 Allocation Length

ie ry
5 Reserved
6 Reserved
7 Reserved
ev a
8 Reserved
9 Reserved
n
10 Reserved
11 Reserved
i
rR m

An Enable Vital Product Data (EVPD) bit of one specifies that the ATAPI CD-ROM Drive shall return the optional vital
fo eli

product data specified by the page code field. If the ATAPI CD-ROM Drive does not support vital product data and this
bit is set to one, the ATAPI CD-ROM Drive shall return CHECK CONDITION status with the sense key set to ILLE-
GAL REQUEST and an additional sense code of INVALID FIELD IN COMMAND PACKET.
Pr

An EVPD bit of zero specifies that the ATAPI CD-ROM Drive shall return the standard INQUIRY data. If EVPD is zero
and the Page Code field is not zero, the ATAPI CD-ROM Drive shall return CHECK CONDITION status with the sense
key set to ILLEGAL REQUEST and an additional sense code of INVALID FIELD IN COMMAND PACKET.

The Page Code field specifies which page of vital product data information the ATAPI CD-ROM Drive shall return to
this Host.

The INQUIRY command shall return CHECK CONDITION status only when the ATAPI CD-ROM Drive cannot return
the requested INQUIRY data. The INQUIRY data should be returned even though the peripheral device may not be ready
for other commands.

If an INQUIRY command is received with a pending unit attention condition (i.e. before the ATAPI CD-ROM Drive re-
ports CHECK CONDITION status), the ATAPI CD-ROM Drive shall perform the INQUIRY command and shall not
clear the unit attention condition.

[Link] Standard INQUIRY Data


The standard INQUIRY data contains 36 required bytes, followed by a variable number of vendor-specific parameters.
Bytes 56 through 95, if returned, are reserved for future standardization.

working draft ATAPI Page 75


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm INQUIRY Command

Table 29 - INQUIRY Data Format


Bit
7 6 5 4 3 2 1 0
Byte
0 Reserved Peripheral Device Type

nl t
1 RMB Reserved

O raf
2 ISO Version ECMA Version ANSI Version (00)
3 Reserved Response Data Format
4 Additional Length (n-4)

w D
5 Reserved

y
6 Reserved
7 Reserved
8 Vendor Identification

ie ry
15
16 Product Identification
ev a
31
32 Product Revision Level
n
35
36 Vendor-specific
i
55
rR m

56 Reserved
95
Vendor Specific Parameters
fo eli

96
n
Pr

The device-type fields identifies the device. It is defined in "Table 30 - Peripheral Device Types" on page 76.

[Link] Using the INQUIRY Command


The INQUIRY command may be used by a Host Computer to determine the configuration of the ATAPI CD-ROM
Drive. ATAPI CD-ROM Drives respond with information that includes their type and Specification level and may in-
clude the vendor’s identification, model number and other useful information.

Table 30 - Peripheral Device Types


Code Description
00h Direct-access device (e.g. magnetic disk)
01h - 04h Reserved
05h CD-ROM device
06h Reserved
07h Optical memory device (e.g. some optical disks)
08h - 1Eh Reserved
1Fh Unknown or no device type

The Peripheral Device Type shall be set to 05h to indicate a CD-ROM Device.

Page 76 working draft ATAPI


ATAPI CD-ROM Specification
INQUIRY Command

A Removable Medium Bit (RMB) of zero indicates that the medium is not removable. A RMB bit of one indicates that
the medium is removable. CD-ROM Devices should always report “Removable”.

The usage of non-zero code values in the ISO version and ECMA version fields are defined by the International Organi-
zation for Standardization and the European Computer Manufacturers Association, respectively.

The ANSI-approved version field must contain a zero to comply with this version of the Specification.

nl t
O raf
A response data format value of 01h indicates that the data shall be in the format specified in this Specification. Re-
sponse data format values greater than one are reserved.

The Additional Length field shall specify the length in bytes of the parameters. If the allocation length of the Command

w D
y
Packet is too small to transfer all of the parameters, the additional length shall not be adjusted to reflect the truncation.

ASCII data fields shall contain only graphic codes (i.e. code values 20h through 7Eh). Left-aligned fields shall place

ie ry
any unused bytes at the end of the field (highest offset) and the unused bytes shall be filled with space characters (20h).
Right-aligned fields shall place any unused bytes at the start of the field (lowest offset) and the unused bytes shall be
filled with space characters (20h).
ev a
The Vendor Identification field contains 8 bytes of ASCII data identifying the vendor of the product1. The data shall be
n
left aligned within this field.
i
The Product Identification field contains 16 bytes of ASCII data as defined by the vendor. The data shall be left-aligned
rR m

within this field.

The Product Revision Level field contains 4 bytes of ASCII data as defined by the vendor. The data shall be left-aligned
fo eli

within this field.

[Link] Vital Product Data


Pr

Implementation of vital product data is optional. The information returned consists of configuration data (e.g. vendor
identification, product identification, model, serial number), manufacturing data (e.g. plant and date of manufacture),
field replaceable unit data and other vendor-specific or device-specific data.

The Host Computer requests the vital product data information by setting the EVPD bit to one and specifying the page
code of the desired vital product data. If the ATAPI CD-ROM Drive does not implement the requested page, it shall re-
turn CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST and the additional sense code
shall be set to INVALID FIELD IN COMMAND PACKET.

This Specification does not define the location or method of storing the vital product data. The retrieval of the data may
require completion of initialization operations within the device that may induce delays before the data is available to the
Host Computer. Time-critical requirements are an implementation consideration and are not addressed in this Specifica-
tion.

[Link] Vital Product Data Parameters


This section describes the optional vital product data page structure and the vital product data pages. The vital product
data may include vendor identification, product identification, unit serial numbers, device operating definitions, manufac-

1. It is intended that this field provide a unique vendor identification of the manufacturer of the ATAPI CD-ROM
Drive. In the absence of a formal registration procedure, X3T9.2 maintains a list of vendor identification codes in
use. Vendors are requested to voluntarily submit their identification codes to X3T9.2 to prevent duplication of
codes.

working draft ATAPI Page 77


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm INQUIRY Command

turing data, field replaceable unit information, and other vendor-specific information. This Specification defines the
structure of the vital product data, but not the contents.

Table 31 - Vital Product Data Page Codes


Page code Description Section

nl t
82h ASCII Implemented Operating Definition Page

O raf
01h - 7Fh ASCII Information Page
81h Implemented Operating Definitions Page
00h Supported Vital Product Data Pages

w D
80h Unit Serial Number Page

y
83h - BFh Reserved
C0h - FFh Vendor-specific

ie ry
[Link].1 ASCII Implemented Operating Definition Page
ev a
The ASCII Implemented Operation Definition Page contains operating definition description data for all operating defi-
nitions implemented by the ATAPI CD-ROM Drive. The contents of this data is not defined by this Specification.
n
Table 32 - ASCII Implemented Operating Definition
i
rR m

Bit
7 6 5 4 3 2 1 0
Byte
fo eli

0 Peripheral Qualifier Peripheral Device Type


1 Page Code (82h)
2 Reserved
Pr

3 Page Length
4 ASCII Operating Definition Description Length (m-4)
5 ASCII Operating Definition Description Data
m
m+1 Vendor-specific Description Data
n

The Peripheral Device Type field is defined in "Table 30 - Peripheral Device Types" on page 76.

The Page Length field specifies the length of the following page data. If the allocation length is less than the length of the
data to be returned, the page length shall not be adjusted to reflect the truncation.

The ASCII Operating Definition Description Length field specifies the length in bytes of the ASCII operating definition
description data that follows. If the allocation length is less than the length of data to be returned, the ASCII Operating
Definition Description Length shall not be adjusted to reflect the truncation. A value of zero in this field indicates that no
ASCII Operating Definition Description Data is available.

The ASCII Operating Definition Description Data field contains the ASCII operating definition description data for the
ATAPI CD-ROM Drive. The data in this field shall be formatted in lines (or character strings). Each line shall contain
only graphic codes (i.e. code values 20h through 7Eh) and shall be terminated with a NULL (00h) character.

Page 78 working draft ATAPI


ATAPI CD-ROM Specification
INQUIRY Command

[Link].2 ASCII Information Page


The ASCII Information Page returns information for the field replaceable unit code returned in the REQUEST SENSE
data.

nl t
Table 33 - ASCII Information Page

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Peripheral Qualifier Peripheral Device Type

w D
1 Page Code (01h - 7Fh)

y
2 Reserved
3 Page Length (n-3)

ie ry
4 ASCII Length (m-4)
5 ASCII Information
m
ev a
m+1 Vendor-specific Description Information
n
n
The Peripheral Device Type field is defined in "Table 30 - Peripheral Device Types" on page 76.
i
rR m

The Page Code field contains the same value as in the page code field of the INQUIRY Command Packet and is associat-
ed with the field replaceable unit code returned by the REQUEST SENSE command.
fo eli

The Page Length field specifies the length of the following page data. If the allocation length of the Command Packet is
too small to transfer all of the page, the page length shall not be adjusted to reflect the truncation.
Pr

The ASCII Length field specifies the length in bytes of the ASCII information that follows. If the allocation length of
the Command Packet is less than the length of the data to be returned, the ASCII length shall not be adjusted to reflect
the truncation. A value of zero in this field indicates that no ASCII information is available for the specified page code.

The ASCII Information field contains ASCII information concerning the field replaceable unit identified by the page
code. The data in this field shall be formatted in one or more lines (or character strings). Each line shall contain only
graphic codes (i.e. code values 20h through 7Eh) and shall be terminated with a NULL (00h) character.

The contents of the Vendor-specific Information field is not defined in this Specification.

working draft ATAPI Page 79


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm INQUIRY Command

[Link].3 Supported Vital Product Data Pages


The Supported Vital Product Data Pages are shown in "Table 34 - Page Code 0: Supported VPD Pages" on page 80.

Table 34 - Page Code 0: Supported VPD Pages

nl t
Bit
7 6 5 4 3 2 1 0
Byte

O raf
0 Peripheral Qualifier Peripheral Device Type
1 Page Code (00h)
2 Reserved

w D
3 Page Length (n-3)

y
4 Supported Page List
n

ie ry
The Peripheral Device Type field is defined in "Table 30 - Peripheral Device Types" on page 76.
ev a
The Page Code field shall be set to the value of the page code field in the INQUIRY Command Packet.
n
The Page Length field specifies the length of the supported page list. If the allocation length of the Command Packet is
too small to transfer all of the page, the page length shall not be adjusted to reflect the truncation.
i
rR m

The Supported Page List field shall contain a list of all vital product data page codes implemented for the ATAPI CD-
ROM Drive in ascending order beginning with page code 00h.
fo eli

[Link].4 Unit Serial Number Page


This page provides a product serial number for the ATAPI CD-ROM Drive.
Pr

Table 35 - Unit Serial Number Page


Bit
7 6 5 4 3 2 1 0
Byte
0 Peripheral Qualifier Peripheral Device Type
1 Page Code (80h)
2 Reserved
3 Page Length (n-3)
4 Product Serial Number
n

The Peripheral Device Type field is defined in "Table 30 - Peripheral Device Types" on page 76.

The Page Length Field specifies the length of the product serial number. If the allocation length of the Command Packet
is too small to transfer all of the page, the page length shall not be adjusted to reflect the truncation.

The Product Serial Number field contains ASCII data that is vendor-specific. The least significant ASCII character of
the serial number shall appear as the last byte of a successful data transfer. If the product serial number is not available,
the ATAPI CD-ROM Drive shall return ASCII spaces (20h) in this field.

Page 80 working draft ATAPI


ATAPI CD-ROM Specification
INQUIRY Command

Table 36 - Recommended Sense Key, ASC and ASCQ for Inquiry Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
w D
y
ie ry
ev a i n
rR m
fo eli
Pr

working draft ATAPI Page 81


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm INQUIRY Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 82 working draft ATAPI


ATAPI CD-ROM Specification
MODE SELECT Command

9.8.3 MODE SELECT Command


The MODE SELECT command provides a means for the Host Computer to specify medium, or peripheral device param-
eters to the ATAPI CD-ROM Drive. Host Computers shall issue MODE SENSE prior to each MODE SELECT to deter-
mine supported pages, page lengths, and other parameters.

nl t
Table 37 - Mode Select Command

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (55h)

w D
1 Reserved 1 Reserved SP

y
2 Page Code
3 Reserved

ie ry
4 Reserved
5 Reserved
6 Reserved
ev a
7 Parameter List Length (MSB)
8 Parameter List Length (LSB)
n
9 Reserved
10 Reserved
i
11 Reserved
rR m
fo eli

A Save Pages (SP) bit of zero indicates the ATAPI CD-ROM Drive shall perform the specified MODE SELECT opera-
tion, and shall not save any pages. An SP bit of one indicates that the ATAPI CD-ROM Drive shall perform the specified
MODE SELECT operation, and shall save to a non-volatile vendor-specific location all the savable pages. If an ATAPI
CD-ROM Drive supports saved pages, it shall save only one copy of the page. The SP bit is optional, even when mode
Pr

pages are supported by the ATAPI CD-ROM Drive. Pages that are saved are identified by the parameter savable bit that
is returned in the page header by the MODE SENSE command. If the PS bit is set in the MODE SENSE data then the
page shall be savable by issuing a MODE SELECT command with the SP bit set. If the ATAPI CD-ROM Drive does
not implement saved pages and the SP bit is set to one, the command shall be terminated with CHECK CONDITION
status. The sense key shall be set to ILLEGAL REQUEST, and the additional sense code set to INVALID FIELD IN
COMMAND PACKET.

The Parameter List Length field specifies the length in bytes of the mode parameter list that shall be transferred from the
Host Computer to the ATAPI CD-ROM Drive after the Command Packet is transferred. A parameter list length of zero
indicates that no data shall be transferred. This condition shall not be considered as an error.

The ATAPI CD-ROM Drive shall terminate the command with CHECK CONDITION status if the parameter list length
results in the truncation of any mode parameter header, or mode page. The sense key shall be set to ILLEGAL RE-
QUEST, and the additional sense code shall be set to PARAMETER LIST LENGTH ERROR.

The mode parameter list for the MODE SELECT and MODE SENSE commands is defined in "9.8.5 Mode Select/Sense
Parameters" on page 88.

The ATAPI CD-ROM Drive shall terminate the MODE SELECT command with CHECK CONDITION status, set the
sense key to ILLEGAL REQUEST, set the additional sense code to INVALID FIELD IN PARAMETER LIST, and shall
not change any mode parameters for the following conditions:
1. If the Host Computer sets any field that is reported as not changeable by the ATAPI CD-ROM Drive to a value
other than its current value.

working draft ATAPI Page 83


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm MODE SELECT Command

2. If the Host Computer sets any field in the mode parameter header to an unsupported value.

3. If an Host Computer sends a mode page with a page length not equal to the page length returned by the MODE
SENSE command for that page.

4. If the Host Computer sends an unsupported value for a mode parameter and rounding is not implemented for that
mode parameter.

nl t
O raf
5. If the Host Computer sets any reserved field in the mode parameter list to a non-zero value.

If the Host Computer sends a value for a mode parameter that is outside the range supported by the ATAPI CD-ROM

w D
Drive and rounding is implemented for that mode parameter, the ATAPI CD-ROM Drive may either:

y
1. round the parameter to an acceptable value and terminate the command;
2. terminate the command with CHECK CONDITION status, the sense key set to ILLEGAL REQUEST, and set the

ie ry
additional sense code to INVALID FIELD IN PARAMETER LIST.
ev a
An ATAPI CD-ROM Drive may alter any mode parameter in any mode page (even those reported as non-changeable) as
a result of changes to other mode parameters1.
n
The ATAPI CD-ROM Drive validates the non-changeable mode parameters against the current values that existed for
i
those mode parameters prior to the MODE SELECT command.
rR m

Table 38 - Recommended Sense Key, ASC and ASCQ for Mode Select Command Errors
fo eli

Sense Key ASC ASCQ Description of Error


05 20 INVALID COMMAND OPERATION CODE
Pr

05 24 INVALID FIELD IN COMMAND PACKET


06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
06 2A MODE PARAMETER CHANGED
05 26 INVALID FIELD IN PARAMETER LIST
05 00 11 AUDIO PLAY OPERATION IN PROCESS

1. If the current values calculated by the ATAPI CD-ROM Drive affect the Host Computer’s operation, the Host
Computer shall issue a MODE SENSE command after each MODE SELECT command.

Page 84 working draft ATAPI


ATAPI CD-ROM Specification
MODE SENSE Command

9.8.4 MODE SENSE Command


The MODE SENSE command provides a means for an ATAPI CD-ROM Drive to report parameters to the Host Comput-
er. It is a complementary command to the MODE SELECT command.

Table 39 - Mode Sense command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (5Ah)
1 Reserved Reserved Reserved Reserved

w D
2 PC Page Code

y
3 Reserved
4 Reserved

ie ry
5 Reserved
6 Reserved
7 Allocation Length (MSB)
ev a
8 Allocation Length (LSB)
9 Reserved
n
10 Reserved
11 Reserved
i
rR m

The Page Control (PC) field defines the type of mode parameter values to be returned in the mode pages. See sections
fo eli

"[Link] Current Values" - "[Link] Saved Values" below.

Table 40 - Page Control Field


Pr

Code Type of Parameter Section


00b Current values [Link] on page 86
01b Changeable values [Link] on page 86
10b Default values [Link] on page 86
11b Saved values [Link] on page 86

NOTE The Page Control field only affects the mode parameters within the mode pages, however the PS bit, Page Code and Page Length fields shall re-
turn current values since they have no meaning when used with other types. The mode parameter header shall return current values. (see also "9.8.5
Mode Select/Sense Parameters" on page 88)

The Page Code specifies which mode page(s) to return1. See "Table 43 - Mode Page Codes for CD-ROM" on page 88
for a description of the Mode pages.

A Host Computer may request any one or all of the supported mode pages from an ATAPI CD-ROM Drive. If a Host
Computer issues a MODE SENSE command with a page code value not implemented by the ATAPI CD-ROM Drive, the
ATAPI CD-ROM Drive shall return CHECK CONDITION status and shall set the sense key to ILLEGAL REQUEST
and the additional sense code to INVALID FIELD IN COMMAND PACKET.

A Page Code of 3Fh indicates that all mode pages implemented by the ATAPI CD-ROM Drive shall be returned to the
Host Computer. If the mode parameter list exceeds 65536 bytes for a MODE SENSE command, the ATAPI CD-ROM
Drive shall return CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST and the addition-

1. Mode pages shall be returned in ascending page code order except for mode page 00h.

working draft ATAPI Page 85


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm MODE SENSE Command

al sense code set to INVALID FIELD IN COMMAND PACKET.

Mode page 00h, if implemented, shall be returned after all other mode pages.

[Link] Current Values

nl t
A PC field value of 0h requests that the ATAPI CD-ROM Drive return the current values of the mode parameters. The

O raf
current values returned are:
1. the current values of the mode parameters established by last successful MODE SELECT command.
2. the saved values of the mode parameters if a MODE SELECT command has not successfully completed since the
last power-on, hard RESET condition.

w D
y
3. the default values of the mode parameters, if saved values, are not available or not supported.

ie ry
[Link] Changeable Values
A PC field value of 1h requests that the ATAPI CD-ROM Drive return a mask denoting those mode parameters that are
ev a
changeable. In the mask, the fields of the mode parameters that are changeable shall be set to all one bits and the fields of
the mode parameters that are non-changeable (i.e. defined by the ATAPI CD-ROM Drive) shall be set to all zero bits.
n
An attempt to change a non-changeable mode parameter (via MODE SELECT) results in an error condition.
i
.
rR m

The Host Computer shall issue a MODE SENSE command with the PC field set to 1h and the Page Code field set to
3Fh to determine which mode pages are supported, which mode parameters within the mode pages are changeable, and
the supported length of each mode page prior to issuing any MODE SELECT commands.
fo eli

[Link] Default Values


Pr

A PC field value of 2h requests that the ATAPI CD-ROM Drive return the default values of the mode parameters. Param-
eters not supported by the ATAPI CD-ROM Drive shall be set to zero. Default values are accessible even if the device is
not ready.

[Link] Saved Values


A PC field value of 3h requests that the ATAPI CD-ROM Drive return the saved values of the mode parameters. Imple-
mentation of saved page parameters is optional. Mode parameters not supported by the ATAPI CD-ROM Drive shall be
set to zero. If saved values are not implemented, the command shall be terminated with CHECK CONDITION status,
the sense key set to ILLEGAL REQUEST and the additional sense code set to SAVING PARAMETERS NOT SUP-
PORTED.

The method of saving parameters is vendor-specific. The parameters are preserved in such a manner that they are re-
tained when the ATAPI CD-ROM Drive is powered down. All savable pages can be considered saved when a MODE SE-
LECT command issued with the SP bit set to one has returned a “good” status.

Note: As CD-ROM devices do not have writable media and the media is removable, most will not support Saved Values. It is recommended that the
Host software not make use of saved pages.

[Link] Initial Responses


After a power-up condition or hard reset condition, the ATAPI CD-ROM Drive shall respond in the following manner:
1. If default values are requested, report the default values.

Page 86 working draft ATAPI


ATAPI CD-ROM Specification
MODE SENSE Command

2. If saved values are requested, report valid restored mode parameters, or restore the mode parameters and report
them. If the saved values of the mode parameters are not able to be accessed from the non-volatile, vendor-
specific location, terminate the command with CHECK CONDITION status and set the sense key set to NOT
READY. If saved parameters are not implemented, respond as defined in "[Link] Saved Values" on page 86.

If current values are requested and the current values of the mode parameters have not been sent by the Host Computer
(via a MODE SELECT command), the ATAPI CD-ROM Drive may return either the default or saved values as defined

nl t
above. If current values have been sent, the current values shall be reported.

O raf
Table 41 - Recommended Sense Key, ASC and ASCQ for Mode Sense Command Errors

w D
Sense Key ASC ASCQ Description of Error

y
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

ie ry
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
05 1A PARAMETER LIST LENGTH ERROR
ev a
05 39 SAVING PARAMETERS NOT SUPPORTED
i n
rR m
fo eli
Pr

working draft ATAPI Page 87


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

9.8.5 Mode Select/Sense Parameters


This section describes the pages used with MODE SELECT and MODE SENSE commands.

The Mode Parameter List contains a header, followed by zero or more variable-length pages.

nl t
Table 42 - Mode Parameter List

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0-n Mode Parameter Header

w D
0-n Page(s)

y
Each mode page contains a page code, a page length, and a set of mode parameters.

ie ry
ev a
Table 43 - Mode Page Codes for CD-ROM
n
Page code Description Section Type
00h Vendor-specific (does not require page format)
i
rR m

01h Read error recovery page [Link] on page 95 M


02h - 0Ch Reserved
0Dh CD-ROM page [Link] on page 94 M
fo eli

0Eh CD-ROM audio control page [Link] on page 90 M


2Ah CD-ROM Capabilities & Mechanical Status Page [Link] on page 99 M
0Fh - 1Fh Reserved
Pr

20h-29h, 2Bh-3Eh Vendor-specific (page format required)


3Fh Return all pages (valid only for the MODE SENSE command)

Table 44 - Mode Page Format


Bit
7 6 5 4 3 2 1 0
Byte
0 PS/ Reserved Page Code
Reserved
1 Page Length (n-1)
2 Mode Parameters
n

When using the MODE SENSE command, a Parameters Savable (PS) bit of one indicates that the mode page can be
saved by the ATAPI CD-ROM Drive in a non-volatile, vendor-specific location. A PS bit of zero indicates that the sup-
ported parameters cannot be saved. When using the MODE SELECT command, the PS bit is reserved.

The Page Code field identifies the format and parameters defined for that mode page.

When using the MODE SENSE command, if Page Code 00h (vendor-specific page) is implemented, the ATAPI CD-
ROM Drive shall return that page last in response to a request to return all pages (page code 3Fh). When using the

Page 88 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

MODE SELECT command, this page shall be sent last.

The Page Length field specifies the length in bytes of the mode parameters that follow. If the Host Computer does not
set this value to the value that is returned for the page by the MODE SENSE command, the ATAPI CD-ROM Drive
shall terminate the command with CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST
with the additional sense code set to INVALID FIELD IN PARAMETER LIST. The ATAPI CD-ROM Drive is permitted
to implement a mode page that is less than the full page length defined in this Specification, provided no field is truncat-

nl t
ed and the Page Length field correctly specifies the actual length implemented.

O raf
The mode parameters for each page are defined here. Mode parameters not implemented by the ATAPI CD-ROM Drive
shall be set to zero.

w D
y
Table 45 - Mode Parameter Header
Bit

ie ry
7 6 5 4 3 2 1 0
Byte
0 Mode Data Length
ev a
1
2 Medium Type
n
3 Reserved
4 Reserved
i
5 Reserved
rR m

6 Reserved
7
fo eli

When using the MODE SENSE command, the mode data length field specifies the length in bytes of the following data
that is available to be transferred. The mode data length is the total byte count of all data following the mode data length
field. When using the MODE SELECT command, this field is reserved.
Pr

Table 46 - CD-ROM Medium Type Codes


Code Medium Type Description
00h Door closed / caddy inserted, medium type unknown
01h 120 mm CD-ROM data only, door closed or caddy inserted
02h 120 mm CD-DA audio only, door closed or caddy inserted
03h 120 mm CD-ROM data and audio combined, door closed or caddy inserted
04h 120 mm CD-ROM Hybrid disc (Photo CD), door closed or caddy inserted
05h 80 mm CD-ROM data only, door closed or caddy inserted
06h 80 mm CD-DA audio only, door closed or caddy inserted
07h 80 mm CD-ROM data and audio combined, door closed or caddy inserted
08h 80 mm CD-ROM Hybrid disc (Photo CD), door closed or caddy inserted
09h - 6Fh Reserved
70h Door closed, no disc present
71h Door open or no caddy inserted
72h Door closed or caddy inserted, medium format error
73h - 7Fh Reserved
80h - FFh Vendor-specific

working draft ATAPI Page 89


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

[Link] CD-ROM Audio Control Parameters Page


The CD-ROM Audio Control Parameters Page sets the playback modes and output controls for subsequent PLAY AU-
DIO commands and any current audio playback operation.

Table 47 - CD-ROM Audio Control Mode Page Format

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 PS Reserved Page Code (0Eh)
(Optional)

w D
1 Page Length (0Eh or (0Eh * 8 * The Number of Stereo ADPCM Decoders))

y
2 Reserved Immed SOTC Reserved
(Mandatory) (Mandatory)
Always 1 Default 0

ie ry
3 Reserved
4 Reserved
5 Reserved
ev a
6 Logical Block Per Second of Audio Playback
Default 0
n
7
8 Reserved CDDA Output Port 0 Channel Selection
i
9 Output Port 0 Volume (Mandatory) Default FFh
rR m

10 Reserved CDDA Output Port 1 Channel Selection


11 Output Port 1 Volume (Mandatory) Default FFh
12 Reserved CDDA Output Port 2 Channel Selection
fo eli

13 Output Port 2 Volume (Optional) Default 00h


14 Reserved CDDA Output Port 3 Channel Selection
15 Output Port 3 Volume (Optional) Default 00h
Pr

16 Buffer Reserved ADPCM Device 0 Channel Selection (Default 00)


Status
17 Volume Right to Output Port 0 (Optional)*
18 Reserved
19 Volume Right to Output Port 1 (Optional)*
20 Reserved
21 Volume Left to Output Port 0 (Optional)*
22 Reserved
23 Volume Left to Output Port 1 (Optional)*
... Repeat Bytes 16-23 fifteen times
for sixteen possible ADPCM devices)
143 Volume Left to Output Port 1 (Optional)*

* Note: ADPCM volume control bytes are optional, and are not required for a valid audio control mode page. However, if any one of the 8 bytes which
control the audio for a given ADPCM device are supported, then all 8 bytes shall be supported.

The audio control mode page is split into three sections. Bytes 0-7 define the audio control bytes common to both the
Red Book audio decoders and the ADPCM decoders. Bytes 8-15 define the audio control bytes specific to the four Red
Book audio decoders. Bytes 16-143, define the audio control bytes specific to the sixteen optional stereo ADPCM decod-
ers. Note that Byte 1, Page Length, indicates to the Host how many of the Optional Stereo ADPCM decoders are sup-
ported by the device.

The Parameters Savable (PS) bit is only used with the MODE SENSE command. The PS bit is optional. This bit is re-
served with the MODE SELECT command. A PS bit of one indicates that the ATAPI CD-ROM Drive is capable of sav-

Page 90 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

ing the page in a non-volatile vendor-specific location.

The Immediate Bit (Immed) is used for information purposes only; the audio commands will always send completion
status as soon as the playback operation has been started. This bit shall always be set to 1.

A Stop On Track Crossing (SOTC) bit of zero indicates the ATAPI CD-ROM Drive shall terminate the audio playback
operation when the transfer length is satisfied. Multiple tracks shall be played as necessary. Periods of time encoded as

nl t
audio pause/silence at the beginning of tracks, (index 0) shall also be played. A SOTC bit of one indicates the ATAPI

O raf
CD-ROM Drive shall terminate the audio playback operation when the beginning of a following track is encountered.
The SOTC bit is mandatory.

The CDDA Output Port Channel Selection field specifies the Red Book audio channels from the disc to which a specific

w D
y
output port shall be connected. More than one output port may be connected to an audio channel. More than one audio
channel may be connected to an output port.

ie ry
Table 48 - CDDA Output Port Channel Selection Codes
Code Description
ev a
0000b Output port muted
n
0001b Connect audio channel 0 to this output port
0010b Connect audio channel 1 to this output port
i
0011b Connect audio channel 1 and audio channel 2 to this output port
rR m

0100b Connect audio channel 2 to this output port


1000b Connect audio channel 3 to this output port
fo eli

The Output Port Volume Control indicates the relative volume level for this audio output port. The value used is speci-
fied as an attenuation of the normal volume level. A value of zero indicates the minimum volume level (Mute), and a val-
ue of FFh indicates maximum volume (No attenuation) level. It is recommended that the MUTE and volume functions
Pr

should be supported on a per channel basis. The attenuation used shall be as specified in "Table 49 - Attenuation Levels
for Audio". All values not shown in the table shall be valid, with the attenuation selected by interpolating using the
known table values.

It is recommended that the Drive support at least 16 volume levels. The actual attenuation levels for any given Binary at-
tenuation value shall be given by the following equation: 20 Log (Binary Level / 256)

Note: Audio channel volume control regarding channel selection of MUTE vs. Volume Level setting of 0. It is recommend that drives allow the setting of
the Channel Selection fields to MUTE and also allow the setting of the Volume Level field to 0. It is up to the drive to determine how to shut off the vol-
ume, either via muting circuitry or via the volume control.

working draft ATAPI Page 91


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

Table 49 - Attenuation Levels for Audio


Binary Level Attenuation
FFh 0db (On)
F0h -0.56

nl t
E0h -1.16

O raf
C0h -2.50
80h -6.00
40h -12.0

w D
20h -18.0

y
10h -24.0
0Fh -24.6
0Eh -25.2

ie ry
0Ch -26.6
08h -30.0
ev a
04h -36.0
02h -42.1
n
01h -48.0
00h Mute (Off)
i
rR m
fo eli
Pr

Page 92 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

nl t
CD-ROM XA Media Up to 16 channels of stereo audio simultaneously

O raf
providing up to 32 channels total.

CD-ROM drive may have up to 16 independent


ADPCM Decoder 0

w D
stereo ADPCM decoders.

y
ADPCM Decoder 1
Drives supporting CD-ROM XA commands shall
. have at least one stereo ADPCM decoder.

ie ry
.
.
ADPCM Decoder 15 Drives supporting CD-ROM XA commands shall
ev a
support the mixing of any decoder output to any
L R Output Port.
i n
Volume Left Volume Right Volume Left Volume Right “MSDEX” Device Driver
rR m

to to to
Output Port 0 Output Port 0 Output Port 1 OutputtoPort 1 Requires this mixing capability.
fo eli

Output Port 0 Output Port 1


Pr

Figure 14 - ADPCM Volume MUX / Control

The ADPCM Device Channel Selection field specifies the XA ADPCM audio channels from the disc to which a specific
output port shall be connected. More than one output port may be connected to an audio channel. More than one audio
channel may be connected to an output port. Note that there are four volume controls for each of the sixteen possible ste-
reo ADPCM devices.

working draft ATAPI Page 93


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

[Link] CD-ROM Device Parameters Page


The CD-ROM Device parameters page specifies parameters that affect all CD-ROM data types.

Table 50 - CD-ROM Parameters Page Format

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 PS Reserved Page Code (0Dh)
(Optional)

w D
Default 0

y
1 Page Length (06h)
2 Reserved
3 Reserved Inactivity Time Multiplier

ie ry
4 Number of MSF - S Units per MSF - M Unit
5 Default 60 (3Ch)
ev a
6 Number of MSF - F Units per MSF - S Unit
7 Default 75 (4Bh)
n
The Parameters Savable (PS) bit is only used with the MODE SENSE command. This bit is reserved with the MODE
i
SELECT command. A PS bit of one indicates that the ATAPI CD-ROM Drive is capable of saving the page in a non-vol-
rR m

atile vendor-specific location. The PS bit is optional.

The Inactivity Timer Multiplier specifies the length of time that the drive shall remain in the hold track state after com-
fo eli

pletion of a seek or read operation.

NOTE Higher values in this parameter may have an adverse effect on the drive MTBF, in some implementations.
Pr

Table 51 - Inactivity Time Multiplier Values


Minimum Time
Inactivity Timer Inactivity Timer Minimum Time in
in Hold Track
Multiplier Multiplier Hold Track State
State
0h Vendor-specific 8h 16s
1h 125 ms 9h 32s
2h 250 ms Ah 1 min
3h 500 ms Bh 2 min
4h 1s Ch 4 min
5h 2s Dh 8 min
6h 4s Eh 16 min
7h 8s Fh 32 min

The number of S units per M unit field gives the ratio of these MSF address values. For media conforming to the CD-
ROM and CD-DA Specification, this value is 60.

The number of F units per S unit field gives the ratio of these MSF address values. For media conforming to the CD-
ROM and CD-DA Specification, this value is 75.

Page 94 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

[Link] Read Error Recovery Parameters Page


The Read Error Recovery Parameters Page specifies the error recovery parameters the ATAPI CD-ROM Drive shall use
during any command that performs a data read operation from the media (e.g. READ, READ TOC, etc.).

Table 52 - Read Error Recovery Parameters Page Format

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 PS Reserved Page Code (01h)
(Optional)

w D
Default 0

y
1 Page Length (06h)
2 Error Recovery Parameter, Default 0
Reserved TB RC Reserved PER DTE DCR

ie ry
3 Read Retry Count
4 Reserved
ev a
5 Reserved
6 Reserved
n
7 Reserved
i
The Parameters Savable (PS) bit is only used with the MODE SENSE command. This bit is reserved with the MODE
rR m

SELECT command. A PS bit of one indicates that the ATAPI CD-ROM Drive is capable of saving the page in a non-vol-
atile vendor-specific location. The PS bit is optional.
fo eli

NOTE The implementation of error recovery procedures for CD-ROM devices is markedly different from those used for magnetic medium disk drives. At
least one level of error correction (i.e. CIRC) is required to transfer the data stream. Therefore, the performance of the drive may differ substantially
from what would be expected by sending the same error recovery parameters to a magnetic medium device.
Pr

A Transfer Block (TB) bit of one indicates that a data block that is not recovered within the recovery limits specified,
shall be transferred to the Host Computer before CHECK CONDITION status is returned. A TB bit of zero indicates that
such a data block shall not be transferred to the Host Computer. The TB bit does not affect the action taken for recov-
ered data.

A Read Continuous (RC) bit of one indicates that the CD-ROM drive shall transfer the entire requested length of data
without adding delays to perform error recovery procedures. This implies that the CD-ROM drive may send data that is
erroneous or fabricated in order to maintain a continuous flow of data. A RC bit of zero indicates that error recovery op-
erations that cause delays are acceptable during the data transfer.

A Post Error (PE) bit of one indicates that the CD-ROM drive shall report recovered errors. A PER bit of zero indicates
that the CD-ROM drive shall not report recovered errors. Error recovery procedures shall be performed within the lim-
its established by the error recovery parameters.

A Disable Transfer on Error (DTE) bit of one indicates that the CD-ROM drive shall terminate the data transfer to the
Host upon detection of a recovered error. A DTE bit of zero indicates that the CD-ROM drive shall not terminate the
data transfer upon detection of a recovered error.

A Disable Correction (DCR) bit of one indicates that error correction codes shall not be used for data error recovery. A
DCR bit of zero allows the use of error correction codes for data error recovery.

The correlation of the error recovery parameter and the bit settings defined for CD-ROM devices is given in "Table 53 -
Error Recovery Bit Settings" on page 96. The interpretation of these bit settings for CD-ROM devices is given in "Table
54 - CD-ROM Error Recovery Descriptions" on page 96. If the error recovery parameter is set to any other value, the

working draft ATAPI Page 95


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

command shall be terminated with CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST
and the additional sense code set to INVALID FIELD IN PARAMETER LIST.

Table 53 - Error Recovery Bit Settings

Error Recovery Bit Settings Error Recovery Bit Settings

nl t
Parameter 76543210 Parameter 76543210

O raf
00h RR00R000 20h RR10R000
01h RR00R001 21h RR10R001
04h RR00R100 24h RR10R100
05h RR00R101 25h RR10R101

w D
y
06h RR00R110 26h RR10R110
07h RR00R111 27h RR10R111
10h RR01R000 30h RR11R000

ie ry
11h RR01R001 31h RR11R001
14h RR01R100 34h RR11R100
15h RR01R101 35h RR11R101
ev a
NOTE Reserved bits shall be set to zero.
i n
rR m
fo eli

Table 54 - CD-ROM Error Recovery Descriptions


Code Error Recovery Description
Pr

00h The maximum error recovery procedures available are used. If an error occurs which is uncorrectable with the error cor-
rection codes (ECC) on the media, data transfer is terminated with CHECK CONDITION status. The block with the error
is not transferred. The sense key is set to MEDIUM ERROR. The information bytes give the address of the block where
the unrecovered error was detected. Recovered errors are not reported.
01h Only retries of the read operation and CIRC are used (layered error correction is not used). Only CIRC unrecovered data
errors are reported. If a CIRC unrecovered data error occurs, data transfer is terminated with CHECK CONDITION status.
The block with the error is not transferred. The sense key is set to MEDIUM ERROR. The information bytes give the
address of the block where the unrecovered error was detected. Recovered errors are not reported.
04h The maximum error recovery procedures available are used. Recovered data errors are reported. If a recovered data error
occurs, data transfer is not terminated. However, when the data transfer has completed CHECK CONDITION status is
reported. The sense key is set to RECOVERED ERROR. The information bytes give the address of the last block where a
recovered data error was detected. If a data error occurs that is uncorrectable with the ECC information available on the
media, data transfer is terminated and CHECK CONDITION status is reported. The block with the error is not transferred.
The sense key is set to MEDIUM ERROR. The information bytes give the address of the block where the uncorrectable
error was detected.
05h Only retries of the read operation and CIRC are used (layered error correction is not used). Recovered data errors are
reported. If a recovered data error occurs, data transfer is not terminated. However, when the data transfer has completed
CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR. The information bytes give the
address of the last block where a CIRC recovered data error was detected. If an unrecovered data error occurs, data trans-
fer is terminated and CHECK CONDITION status is reported. The block with the error is not transferred. The sense key is
set to MEDIUM ERROR. The information bytes give the address of the block where the unrecovered error was detected.

Page 96 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

Table 54 - CD-ROM Error Recovery Descriptions


Code Error Recovery Description
06h The maximum error recovery procedures are used. Recovered data errors are reported. If a recovered data error occurs data
transfer is terminated and CHECK CONDITION status is reported. The block with the recovered error is not transferred.
The sense key is set to RECOVERED ERROR. The information bytes give the address of the block where the recovered
data error was detected. If a data error occurs that is uncorrectable with the ECC information on the medium, data transfer

nl t
is terminated with CHECK CONDITION status. The block with the error is not transferred. The sense key is set to

O raf
MEDIUM ERROR. The information bytes give the address of the block where the uncorrectable error was detected.
07h Only retries of the read operation are used (layered error correction is not used) and CIRC recovered data errors are
reported. If a CIRC recovered data error occurs, data transfer is terminated with CHECK CONDITION status. The block
with the recovered error is not transferred. The sense key is set to RECOVERED ERROR. The information bytes give the

w D
address of the block where the recovered data error was detected. If a CIRC unrecovered data error occurs, data transfer is

y
terminated with CHECK CONDITION status. The block with the error is not transferred. The sense key is set to
MEDIUM ERROR. The information bytes give the address of the block where the unrecovered error was detected.
10h If data transfer can be maintained, the maximum error recovery procedures available are used. (RC = 1.) If an error occurs

ie ry
which is uncorrectable with the error correction codes (ECC) on the media, or is uncorrectable in time to maintain data
transfer, the data transfer is not terminated. However, when the data transfer has completed, CHECK CONDITION status
is reported. The sense key is set to MEDIUM ERROR. The information bytes give the address of the block where the first
ev a
unrecovered error was detected. Recovered errors are not reported.
11h If data transfer can be maintained, retries of the read operation and CIRC are used (layered error correction is not used).
n
(RC = 1.) Only CIRC unrecovered data errors are reported. If a CIRC unrecovered data error occurs, data transfer is not
terminated. However, when the data transfer has completed, CHECK CONDITION status is reported. The sense key is set
i
to MEDIUM ERROR. The information bytes give the address of the block where the first unrecovered error was detected.
rR m

Recovered errors are not reported.


14h If data transfer can be maintained, the maximum error recovery procedures available are used. (RC = 1.) Recovered data
errors are reported. If a recovered data error occurs, data transfer is not terminated. However, when the data transfer has
fo eli

completed, CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR. The information
bytes give the address of the block where a recovered data error was detected. If an data error occurs that is uncorrectable
with the ECC information available on the media, or is uncorrectable in time to maintain data transfer, the data transfer is
not terminated. However, when the data transfer has completed CHECK CONDITION, status is reported. The sense key is
Pr

set to MEDIUM ERROR. The information bytes give the address of the block where the first uncorrectable error was
detected. Reporting unrecovered errors takes precedence over reporting recovered errors.
15h If data transfer can be maintained, retries of the read operation and CIRC are used (layered error correction is not used).
(RC = 1.) Recovered data errors are reported. If a recovered data error occurs, data transfer is not terminated. However,
when the data transfer has completed CHECK CONDITION status is reported. The sense key is set to RECOVERED
ERROR. The information bytes give the address of the block where a CIRC recovered data error was detected. If an unre-
covered data error occurs, data transfer is not terminated. However, when the data transfer has completed CHECK CON-
DITION status is reported. The sense key is set to MEDIUM ERROR. The information bytes give the address of the block
where the first unrecovered error was detected. Reporting unrecovered errors takes precedence over reporting recovered
errors.
20h The maximum error recovery procedures available are used. If an error occurs which is uncorrectable with the error cor-
rection codes (ECC) on the media, data transfer is terminated with CHECK CONDITION status. The block with the error
is transferred. The sense key is set to MEDIUM ERROR. The information bytes give the address of the block where the
unrecovered error was detected. Recovered errors are not reported.
21h Only retries of the read operation and CIRC are used (layered error correction is not used). Only CIRC unrecovered data
errors are reported. If a CIRC unrecovered data error occurs data transfer is terminated with CHECK CONDITION status.
The block with the error is transferred. The sense key is set to MEDIUM ERROR. The information bytes give the address
of the block where the unrecovered error was detected. Recovered errors are not reported.
24h The maximum error recovery procedures available are used. Recovered data errors are reported. If a recovered data error
occurs data transfer is not terminated. However, when the data transfer has completed, CHECK CONDITION status is
reported. The sense key is set to RECOVERED ERROR. The information bytes give the address of the last block where a
recovered data error was detected. If a data error occurs that is uncorrectable with the ECC information available on the
media data transfer is terminated and CHECK CONDITION status is reported. The block with the error is transferred. The
sense key is set to MEDIUM ERROR. The information bytes give the address of the block where the uncorrectable error
was detected.

working draft ATAPI Page 97


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

Table 54 - CD-ROM Error Recovery Descriptions


Code Error Recovery Description
25h Only retries of the read operation and CIRC are used (layered error correction is not used). Recovered data errors are
reported. If a recovered data error occurs, data transfer is not terminated. However, when the data transfer has completed,
CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR. The information bytes give the
address of the last block where a CIRC recovered data error was detected. If an unrecovered data error occurs, data trans-

nl t
fer is terminated and CHECK CONDITION status is reported. The block with the error is transferred. The sense key is set

O raf
to MEDIUM ERROR. The information bytes give the address of the block where the unrecovered error was detected.
26h The maximum error recovery procedures are used. Recovered data errors are reported. If a recovered data error occurs,
data transfer is terminated and CHECK CONDITION status is reported. The block with the recovered error is transferred.
The sense key is set to RECOVERED ERROR. The information bytes give the address of the block where the recovered

w D
data error was detected. If a data error occurs that is uncorrectable with the ECC information on the media, data transfer is

y
terminated with CHECK CONDITION status. The block with the error is transferred. The sense key is set to MEDIUM
ERROR. The information bytes give the address of the block where the uncorrectable error was detected.
27h Only retries of the read operation are used (layered error correction is not used). CIRC recovered data errors are reported.

ie ry
If a CIRC recovered data error occurs, data transfer is terminated with CHECK CONDITION status. The block with the
recovered error is transferred. The sense key is set to RECOVERED ERROR. The information bytes give the address of
the block where the recovered data error was detected. If a CIRC unrecovered data error occurs, data transfer is terminated
ev a
with CHECK CONDITION status. The block with the error is transferred. The sense key is set to MEDIUM ERROR. The
information bytes give the address of the block where the unrecovered error was detected.
n
30h Same as code 10H.
31h Same as code 11H.
i
34h Same as code 14H.
rR m

35h Same as code 15H.


fo eli

The Read Retry Count field specifies the number of times that the controller shall attempt its read recovery algorithm.

A CIRC Recovered Data Error is defined as a block for which the CIRC based error correction algorithm was unsuccess-
Pr

ful for a read attempt, but on a subsequent read operation no error was reported. The number of subsequent read opera-
tions is limited to the read retry count. Layered error correction was not used.

A CIRC Unrecovered Data Error is defined as a block for which the CIRC based error correction algorithm was unsuc-
cessful on all read attempts up to the read retry count. Layered error correction was not used.

An L-EC Recovered Data Error is defined as a block for which the CIRC based error correction algorithm was unsuc-
cessful, but the layered error correction was able to correct the block within the read retry count.

An L-EC Uncorrectable Data Error is defined as a block which could not be corrected by layered error correction within
the read retry count.

Page 98 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

[Link] CD-ROM Capabilities and Mechanical Status Page


The Capabilities Page is read only and may not be set with Mode Select.

Table 55 - CD-ROM Capabilities and Mechanical Status Page Format

nl t
Bit
7 6 5 4 3 2 1 0
Byte

O raf
0 PS Reserved Page Code (2Ah)
(Optional)
Default 0

w D
1 Page Length (0Eh)

y
2 Reserved
3 Reserved
4-7 Reserved Multi Mode 2 Mode 2 Reserved Reserved XA Cmds AudioPlay

ie ry
32 bit field Session Form 2 Form 1 Supported
of Capabil- Reserved UPC ISRC C2 Pointers R-W R-W CD-DA CD DA
ity bits are De-inter- Supported Stream is Commands
ev a
supported leaved Accurate Supported
& corrected
n
Loading Mechanism Type Reserved Eject Prevent Lock Lock
Jumper State
i
Reserved Separate Separate
rR m

Channel volume
Mute Sup- levels per
ported channel
fo eli

8 MSB Maximum Speed Supported (in KBps)


9 LSB
10 MSB Number of Volume Levels Supported
Pr

11 LSB
12 MSB Buffer Size supported by Drive (in KBytes)
13 LSB
14 MSB Current Speed Selected (in KBps)
15 LSB
16 Reserved for number of ADPCM Decoders
17 - 20 Reserved

The individual capabilities of the drive are specified by bytes 4 through 7. Each of the bits indicate if that specific capa-
bility is supported. A value of zero indicates that the capability is NOT supported; a value of one indicates the capability
IS supported.

Bit 0 Audio Play The drive is capable of Audio Play operation. This also indicates that the
drive is capable of overlapping Play and other commands such as reading of
the Sub-channel information.

Bit 1 XA Commands Supported This bit has been reserved for future support of CD-ROM XA commands.
The bit indicates that the drive supports CD-ROM XA commands. Drives
which set this bit shall support all CD-ROM XA commands.

Bit 4 Mode 2 Form 1 The drive is capable of reading sectors in Mode 2 Form 1 (XA) format.

Bit 5 Mode 2 Form 2 The drive is capable of reading sectors in Mode 2 Form 2 format.

working draft ATAPI Page 99


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

Bit 6 Multi Session The drive is capable of reading multiple session or Photo-CD discs.

Bit 8 READ CD-DA Red Book audio can be read using the READ-CD command.

Bit 9 CD-DA Stream is Accurate This bit indicates that the drive supports an advanced feature that allows it to
return to an audio location without losing place to continue the READ CD-
DA command.

nl t
0 The drive is incapable of accurately restarting the CD-DA read opera-

O raf
tion, and a BUFFER OVERFLOW error shall be reported whenever a
loss of streaming occurs. This error will be fatal and the command will
have to be repeated from the beginning.
1 The drive can continue from a loss of streaming condition and no error

w D
y
will be generated.

Bit 10 R-W Supported The commands that return Sub-channel data can return the combined R-W in-

ie ry
formation.

Bit 11 R-W De-interleaved &


ev a
Corrected This indicates that the R-W sub-channel data will be returned de-interleaved
and error corrected.
n
Bit 12 C2 Pointers are Supported This indicates that the drive supports the C2 Error Pointers. This also indi-
i
cates that the drive is capable of returning the C2 Error Pointers and C2 Block
rR m

Error flags in the READ CD command.


Bit 13 UPC The drive can return the Media Catalog Number (UPC)
fo eli

Bit 14 ISRC The drive can return the International Standard Recording Code Information.

Bit 16 Lock The PREVENT/ALLOW command is capable of actually locking the media
Pr

into the drive.

Bit 17 Lock State This indicates the current state of the drive.
0 The drive is currently in the allow (Unlocked) state. Media may be in-
serted or ejected.
1 The drive is currently in the prevent (Locked) state. Media loaded in
the drive may not be removed via a soft or hard eject. If the drive is
empty, media may not be inserted if the Prevent Jumper is not present.
If the jumper is present, then media may be inserted.

Bit 18 Prevent Jumper This indicates the state of the (Optional) Prevent/Allow Jumper.
0 Jumper is present. Drive will power up to the allow state. Locking the
drive with the Prevent/Allow Command shall NOT prevent the inser-
tion of media.
1 Jumper is not present. Drive will power up to the Prevent State
(Locked). The drive will not accept new media or allow the ejection of
media already loaded until an allow command is issued.

Bit 19 Eject Command The drive can eject the disc via the normal START/STOP command with the
LoEj bit set.

Page 100 working draft ATAPI


ATAPI CD-ROM Specification
Mode Select/Sense Parameters

Bit 23-21 Loading Mechanism Type This field specifies the type of disc loading the drive supports.
23 22 21
0 0 0 Caddy type loading mechanism
0 0 1 Tray type loading mechanism
0 1 0 Pop-up type loading mechanism
0 1 1 Reserved
1 x x Reserved

nl t
O raf
Bit 24 Separate Volume Levels The audio level for each channel can be controlled independently.

Bit 24 Separate Channel Mute The mute capability for each channel can be controlled independently.

w D
y
The Maximum Speed Supported field indicates the actual maximum data rate that the drive supports. This value is re-
turned as the number of kilobytes per/second (Speed/1000) that the data is read from the drive.

ie ry Table 56 - Example Data Rates


ev a
Speed Data Rate
n
X1 176 KBytes/second
X2 353 KBytes/second
i
X2.2 387 KBytes/second
rR m

X3 528 KBytes/second
X4 706 KBytes/second
fo eli

Note that these are the raw data rates and do not reflect any overhead resulting from headers, error correction data, etc. It
is also important to understand that the reported data rate is a theoretical maximum and the actual data rates to the host
will be lower.
Pr

The Number of Volume Levels Supported field returns the number of discrete levels. If the drive only supports turning
audio on and off, the Number of Volume Levels field shall be set to 2.

The Buffer Size Supported field returns the number of bytes of buffer dedicated to the data stream returned to the Host
Computer. This value is returned in Kbytes (Size/1024). If the drive does not have a buffer cache, the value returned
shall be zero.

The Current Speed Selected field indicates the actual data rate that the drive is currently using. This value is returned as
the number of kilobytes per/second (Speed/1000) that the data is read from the drive.

working draft ATAPI Page 101


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm Mode Select/Sense Parameters

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 102 working draft ATAPI


ATAPI CD-ROM Specification
PAUSE/RESUME Command

9.8.6 PAUSE/RESUME Command


The PAUSE/RESUME command requests that the device stop or start an audio play operation. This command is used
with PLAY AUDIO commands that are currently executing.

Table 57 - PAUSE/RESUME Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code (4Bh)
1 Reserved

w D
2 Reserved

y
3 Reserved
4 Reserved

ie ry
5 Reserved
6 Reserved
7 Reserved
ev a
8 Reserved Resume
9 Reserved
n
10 Reserved
11 Reserved
i
rR m

A Resume bit of zero causes the drive to enter the hold track state with the audio output muted after the current block is
played. A Resume bit of one causes the drive to release the pause and begin play at the block following the last block
fo eli

played.

If an audio play operation cannot be resumed and the resume bit is one, the command is terminated with CHECK CON-
DITION status. If the resume bit is zero and an audio play operation cannot be paused, (no audio play operation has
Pr

been requested, or the requested audio play operation has been completed), the command is terminated with CHECK
CONDITION status. See "Figure 17 - Stop Play/Play Audio/Audio Scan/Pause/Resume Sequencing" on page 168 for ad-
ditional information.

It shall not be considered an error to request a PAUSE when a pause is already in effect or to request a RESUME when a
play operation is in progress.

Table 58 - Recommended Sense Key, ASC and ASCQ for Pause/Resume Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 3A MEDIUM NOT PRESENT
0B B9 AUDIO PLAY OPERATION ABORTED

working draft ATAPI Page 103


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PAUSE/RESUME Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 104 working draft ATAPI


ATAPI CD-ROM Specification
PLAY AUDIO (10) Command

9.8.7 PLAY AUDIO (10) Command


The PLAY AUDIO command requests that the ATAPI CD-ROM Drive begin an audio playback operation. The com-
mand function and the output of audio signals shall be as specified by the settings of the mode parameters, including the
SOTC bit.

nl t
Table 59 - PLAY AUDIO Command

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code (45h)

w D
1 Reserved

y
2 Starting Logical Block Address
3

ie ry
4
5
6 Reserved
ev a
7 Transfer Length
8
n
9 Reserved
10 Reserved
i
11 Reserved
rR m

This command responds with immediate status, allowing overlapped commands. This command shall set the DSC bit
fo eli

upon command completion. See also "9.4 Immediate Command Processing Considerations" on page 68.

If any commands related to audio operations are implemented then the PLAY AUDIO (10) command shall be imple-
mented to allow a method for the Host Computer to determine if audio operations are supported. An ATAPI CD-ROM
Pr

Drive responding to a PLAY AUDIO (10) command that has a transfer length of zero with CHECK CONDITION status
and setting the sense key to ILLEGAL REQUEST does not support audio play operations.

The Starting Logical Block Address field specifies the logical block at which the audio playback operation shall begin.
PLAY AUDIO commands with a starting logical block address of FFFF FFFFh shall implement audio play from the cur-
rent location of the optics.

The Transfer Length Field specifies the number of contiguous logical blocks that shall be played. A Transfer Length
Field of zero indicates that no audio operation shall occur. This condition shall not be considered an error.

If the starting address is not found, if the address is not within an audio track, or if a not ready condition exists, the com-
mand shall be terminated with CHECK CONDITION status.

If the CD-ROM information type (data vs. audio) changes within the transfer length, the command shall be terminated
with a CHECK CONDITION and the sense key shall be set to ILLEGAL REQUEST and the additional sense code set to
END OF USER AREA ENCOUNTERED ON THIS TRACK.

If the logical block address requested is not within an audio track, the command shall be terminated with CHECK CON-
DITION status. The sense key shall be set to ILLEGAL REQUEST and the additional sense code set to ILLEGAL
MODE FOR THIS TRACK.

working draft ATAPI Page 105


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PLAY AUDIO (10) Command

Table 60 - Recommended Sense Key, ASC and ASCQ for Play Audio Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 3A MEDIUM NOT PRESENT

ie ry
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
ev a
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
n
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
i
05 54 ILLEGAL MODE FOR THIS TRACK
rR m

05 63 END OF USER AREA ENCOUNTERED ON THIS TRACK


fo eli

[Link] Play Audio with Overlapped Packet Commands


The PLAY AUDIO commands will continue to play while other commands are processed by the drive. Some commands
can be accepted without disrupting the audio operations, while others will cause the Play operation to stop. The following
Pr

section describes the operation of other commands while playing audio.

A PLAY AUDIO command will be terminated when any of the commands in "Table 61 - Commands That Will Stop a
Play Operation" are received.

Page 106 working draft ATAPI


ATAPI CD-ROM Specification
PLAY AUDIO (10) Command

Table 61 - Commands That Will Stop a Play Operation


Opcode(s) Command Description
4Bh PAUSE/RESUME
45h & A5h PLAY AUDIO (10) & PLAY AUDIO (12)

nl t
47h PLAY AUDIO MSF

O raf
48h PLAY AUDIO TRACK/INDEX
49h & A9h PLAY AUDIO TRACK RELATIVE (10 & 12)
28h & A8h READ (10) & READ (12)

w D
D4h READ CD

y
44h READ HEADER
D5h READ CD MSF
01h REZERO UNIT

ie ry
2Bh SEEK
DAh SET CD-ROM SPEED
ev a
1Bh START/STOP UNIT
08h RESET COMMAND
i n
The CD-ROM drive should accept and perform the commands specified in "Table 61 - Commands That Will Stop a
rR m

Play Operation" without terminating an AUDIO PLAY command already in progress. See "Figure 17 - Stop Play/Play
Audio/Audio Scan/Pause/Resume Sequencing" on page 168 for additional information.
fo eli

Table 62 - Commands That Will Not Stop a Play Operation


Opcode Command Description Action Taken
Pr

D8h AUDIO SCAN SCAN command will be executed and the PLAY command will
resume at completion of the scan
12h INQUIRY The Inquiry data will be returned
55h MODE SELECT The Mode Select will be accepted and executed as long as no
Media or Mode information is changed. If parameters that affect
the play are changed, the Mode Select will terminate with a
CHECK CONDITION without being executed.
5Ah MODE SENSE Will execute normally
1Eh PREVENT/ALLOW MEDIA REMOVAL Will execute normally
25h READ CD-ROM CAPACITY Will execute normally
42h READ SUB-CHANNEL Only the current position information (Format Code 01h) will be
supported while the play is in progress. If any other type of infor-
mation is requested the READ SUB-CHANNEL will not be exe-
cuted and a CHECK CONDITION will be generated.
43h READ TOC Only drives that cache the TOC will be able to respond to this com-
mand while the play is in progress. If the drive does not support
caching the TOC, the command will not be executed and a
CHECK CONDITION will be generated.
03h REQUEST SENSE Will execute normally
00h TEST UNIT READY Will execute normally

working draft ATAPI Page 107


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PLAY AUDIO (12) Command

9.8.8 PLAY AUDIO (12) Command


The PLAY AUDIO(12) command requests that the ATAPI CD-ROM Drive begin an audio playback operation. The com-
mand function and the output of audio signals shall be as specified by the settings of the mode parameters including the
SOTC bit. See the PLAY AUDIO (10) command for a description of the fields in this command as well as for informa-
tion on overlapped command operation.

nl t
O raf
Table 63 - PLAY AUDIO (12) Command
Bit
7 6 5 4 3 2 1 0
Byte

w D
0 Operation code (A5h)

y
1 Reserved
2 Starting Logical Block Address
3

ie ry
4
5
ev a
6 Transfer Length
7
n
8
9
i
10 Reserved
rR m

11 Reserved
fo eli

This command responds with immediate status, allowing overlapped commands. This command shall set the DSC bit
upon command completion. See also "9.4 Immediate Command Processing Considerations" on page 68.
Pr

Table 64 - Recommended Sense Key, ASC and ASCQ for Play Audio (12) Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
05 54 ILLEGAL MODE FOR THIS TRACK

Page 108 working draft ATAPI


ATAPI CD-ROM Specification
PLAY AUDIO MSF Command

9.8.9 PLAY AUDIO MSF Command


The PLAY AUDIO MSF command requests that the ATAPI CD-ROM Drive begin an audio playback operation. The
command function and the output of audio signals shall be as specified by the settings of the mode parameters including
the SOTC bit.

nl t
Table 65 - PLAY AUDIO MSF Command

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code (47h)

w D
1 Reserved

y
2 Reserved
3 Starting M Field

ie ry
4 Starting S Field
5 Starting F Field
6 Ending M Field
ev a
7 Ending S Field
8 Ending F Field
n
9 Reserved
10 Reserved
i
11 Reserved
rR m

This command responds with immediate status, allowing overlapped commands. This command shall set the DSC bit
fo eli

upon command completion. See also "9.4 Immediate Command Processing Considerations" on page 68.

The Starting M field, the Starting S field, and the Starting F field specify the absolute MSF address at which the audio
play operation shall begin. The Ending M field, the Ending S field, and the Ending F field specify the absolute MSF ad-
Pr

dress where the audio play operation shall end. All contiguous audio sectors between the starting and the ending MSF
address shall be played.

If the Starting Minutes, Seconds and Frame Fields are set to FFh, the Starting address is taken from the Current Optical
Head location. This allows the Audio Ending address to be changed without interrupting the current playback operation.

A Starting MSF address equal to an ending MSF address causes no audio play operation to occur. This shall not be con-
sidered an error. If the Starting MSF address is greater than the Ending MSF address, the command shall be terminated
with CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST.

If the starting address is not found, if the address is not within an audio track, or if a not ready condition exists, the com-
mand shall be terminated with CHECK CONDITION status.

See "[Link] Play Audio with Overlapped Packet Commands" on page 106 for information on overlapped commands
during an Audio Playback.

working draft ATAPI Page 109


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PLAY AUDIO MSF Command

Table 66 - Recommended Sense Key, ASC and ASCQ for Play Audio MSF Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)

ie ry
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM- INCOMPATIBLE FORMAT
ev a
02 3A MEDIUM NOT PRESENT
n
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
i
05 54 ILLEGAL MODE FOR THIS TRACK
rR m

05 63 END OF USER AREA ENCOUNTERED ON THIS TRACK


fo eli
Pr

Page 110 working draft ATAPI


ATAPI CD-ROM Specification
PLAY AUDIO TRACK RELATIVE (10) Command

9.8.10 PLAY AUDIO TRACK RELATIVE (10) Command

The PLAY AUDIO TRACK RELATIVE (10) command requests that the device begin an audio playback operation. The
starting address is specified as a track relative logical block address within the specified starting track. The command
function and the output of audio signals shall be as specified by the settings of the mode parameters including the SOTC
bit.

nl t
O raf
Table 67 - PLAY AUDIO TRACK RELATIVE (10) Command
Bit
7 6 5 4 3 2 1 0
Byte

w D
y
0 Operation Code (49h)
1 Reserved
2 Track Relative Logical Block Address

ie ry
3
4
ev a
5
6 Starting Track
n
7 Transfer Length
8
i
9 Reserved
rR m

10 Reserved
11 Reserved
fo eli

This command responds with immediate status, allowing overlapped commands. This command shall set the DSC bit
upon command completion. See also "9.4 Immediate Command Processing Considerations" on page 68.
Pr

The Starting Track field specifies the track number of the Starting Audio Track.

The Track Relative Logical Block Address (TRLBA) field specifies the two’s complement Starting Logical Block Ad-
dress relative to the beginning of the first sector on the track with an index value of one. Negative values indicate a start-
ing location within the audio pause area at the beginning of the requested track.

The Transfer Length field specifies the number of contiguous logical blocks that shall be output as audio data. A Trans-
fer Length field of zero indicates that no audio playback operation shall occur. This condition shall not be considered an
error. Any other value indicates the number of logical blocks that shall be output.

If the Logical Block Length is not equal to the sector size the ATAPI CD-ROM Drive may adjust the Starting Logical
Block Address and the Transfer Length. In such a case, it is recommended that the ATAPI CD-ROM Drive start the au-
dio play operation with the beginning of a sector whenever the starting logical address falls within that sector (MSF unit).
If the requested Transfer Length causes the end of an audio play operation to fall within a sector, the ATAPI CD-ROM
Drive may continue the play operation through the end of that sector.

If the Starting Address is not found, or if the address is not within an audio track, or if a NOT READY condition exists,
the command is terminated with CHECK CONDITION status.

See "[Link] Play Audio with Overlapped Packet Commands" on page 106 for information on overlapped commands
during an Audio Playback.

working draft ATAPI Page 111


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PLAY AUDIO TRACK RELATIVE (10) Command

Table 68 - Recommended Sense Key, ASC and ASCQ for Play Track Relative (10) Command
Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE

nl t
O raf
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE

w D
y
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED

ie ry
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
ev a
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
n
02 3A MEDIUM NOT PRESENT
03 02 NO SEEK COMPLETE
i
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
rR m

05 54 ILLEGAL MODE FOR THIS TRACK


05 63 END OF USER AREA ENCOUNTERED ON THIS TRACK
fo eli
Pr

Page 112 working draft ATAPI


ATAPI CD-ROM Specification
PLAY AUDIO TRACK RELATIVE (12) Command

9.8.11 PLAY AUDIO TRACK RELATIVE (12) Command


The PLAY AUDIO TRACK RELATIVE(12) command requests that the device begin an audio playback operation. The
command function and the output of audio signals shall be as specified by the settings of the mode parameters including
the SOTC bit. See the PLAY AUDIO TRACK RELATIVE (10) command for a description of the fields in this command.

nl t
Table 69 - PLAY AUDIO TRACK RELATIVE (12) Command

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code (A9h)

w D
1 Reserved

y
2 Track Relative Logical Block Address
3

ie ry
4
5
6 Transfer Length
ev a
7
8
n
9
10 Starting Track
i
11 Reserved
rR m

This command responds with immediate status, allowing overlapped commands. This command shall set the DSC bit
fo eli

upon command completion. See also "9.4 Immediate Command Processing Considerations" on page 68.

Table 70 - Recommended Sense Key, ASC & ASCQ for Play Track Relative (12) Command Errors
Pr

Sense Key ASC ASCQ Description of Error


05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
05 54 ILLEGAL MODE FOR THIS TRACK
05 63 END OF USER AREA ENCOUNTERED ON THIS TRACK

See "[Link] Play Audio with Overlapped Packet Commands" on page 106 for information on overlapped commands
during an Audio Playback.

working draft ATAPI Page 113


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PLAY AUDIO TRACK RELATIVE (12) Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 114 working draft ATAPI


ATAPI CD-ROM Specification
PREVENT/ALLOW MEDIUM REMOVAL Command

9.8.12 PREVENT/ALLOW MEDIUM REMOVAL Command


The PREVENT/ALLOW MEDIUM REMOVAL command requests that the ATAPI CD-ROM Drive enable or disable
the removal of the medium. The prevention of media removal (when implemented) shall be accomplished through the
use of a Locking Mechanism. The locking mechanism is optional and an error shall be returned if a command to prevent
medium removal is issued (Sense key 05 ILLEGAL REQUEST, Sense Code 24 INVALID FIELD IN COMMAND
PACKET).

nl t
O raf
Table 71 - PREVENT ALLOW MEDIUM REMOVAL Command
Bit
7 6 5 4 3 2 1 0
Byte

w D
y
0 Operation Code (1Eh)
1 Reserved
2 Reserved

ie ry
3 Reserved
4 Reserved Prevent
ev a
5 Reserved
6 Reserved
n
7 Reserved
8 Reserved
i
9 Reserved
rR m

10 Reserved
11 Reserved
fo eli

The prevention of medium removal shall begin when the Host Computer issues a PREVENT/ALLOW MEDIUM RE-
MOVAL command with a prevent bit of one (medium removal prevented). The prevention of medium removal shall ter-
minate:
Pr

1. after the Host Computer has issued a PREVENT ALLOW MEDIUM REMOVAL command with a prevent bit of
zero (Unlock), and the ATAPI CD-ROM Drive has successfully performed a synchronize cache operation; or
2. upon a hard RESET condition; or

3. if the drive does not support a locking mechanism.

While a prevention of medium removal condition is in effect (Locked) the ATAPI CD-ROM Drive shall inhibit mecha-
nisms that normally allow removal of the medium by an operator.

The default state of the drive at power on is unlocked, unless the drive supports a prevent/allow jumper and the jumper is
in the prevent state (See "[Link] CD-ROM Capabilities and Mechanical Status Page" on page 99.)

This command will affect the actions of the START/STOP UNIT command (See "9.8.26 START/STOP UNIT Command"
on page 169) and other mechanisms external to this specification (manual ejection / media removal systems.)

working draft ATAPI Page 115


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm PREVENT/ALLOW MEDIUM REMOVAL Command

Table 72 - Actions for Lock / Unlock / Eject


Locked / If Drive Not Ready If Drive Ready
Operation
Unlocked (No Media) (Media Present)
Unlock Unlocked No Error No Error

nl t
(Prevent = 0) Locked No Error, Now media may be inserted No Error, Now media may be removed

O raf
Lock Unlocked No Error, Drive door locked and will not No Error, Drive door locked and will not allow
(Prevent = 1) allow media to be inserted media to be removed
Locked No Error No Error
Lock when the Would Error: Error:

w D
y
drive does not always be 05 ILLEGAL REQUEST, 24 INVALID 05 ILLEGAL REQUEST, 24 INVALID
support a Lock- Unlocked FIELD IN COMMAND PACKET FIELD IN COMMAND PACKET
ing Mechanism

ie ry
Eject Unlocked No Error and Tray is opened No Error:
(START/STOP Media Ejects
UNIT com- Locked Error: Error:
mand with LoEj
ev a
02 Not ready, 53 Media Removal Prevented 02 Not ready, 53 Media Removal Prevented
set)
n
Manual Eject Unlocked Tray opens (If tray exists) Media is Ejected
Locked No operation occurs No operation, Media stays locked in drive
i
rR m

Table 73 - Recommended Sense Key, ASC and ASCQ for Prevent/Allow Command Errors
fo eli

Sense Key ASC ASCQ Description of Error


05 20 INVALID COMMAND OPERATION CODE
Pr

05 24 INVALID FIELD IN COMMAND PACKET


06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 3A MEDIUM NOT PRESENT
02 53 02 MEDIA REMOVAL PREVENTED

Page 116 working draft ATAPI


ATAPI CD-ROM Specification
READ (10) Command

9.8.13 READ (10) Command


The READ (10) command requests that the ATAPI CD-ROM Drive transfer data to the Host Computer. The most recent
data value written in the addressed logical block shall be returned.

Table 74 - READ (10) Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code (28h)
1 Reserved

w D
2 Logical Block Address

y
3
4

ie ry
5
6 Reserved
7 Transfer Length
ev a
8
9 Reserved
n
10 Reserved
11 Reserved
i
rR m

The Transfer Length field specifies the number of contiguous logical blocks of data that shall be transferred. A transfer
fo eli

length of zero indicates that no logical blocks shall be transferred. This condition shall not be considered an error. Any
other value indicates the number of logical blocks that shall be transferred.

Although the CD-ROM is capable of returning a variety of data, this command shall only return the “User Data” portion
Pr

of the sector. This field is always 2048 bytes in length for Mode 1 and Mode 2 Form 1 sectors, which are the only sector
types allowed. For all other sector types, the device shall set the ILI bit in the Request Sense Standard Data and return a
“CANNOT READ MEDIUM - INCOMPATIBLE FORMAT” error if any read to them using this command is attempted.

working draft ATAPI Page 117


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ (10) Command

Table 75 - Recommended Sense Key, ASC and ASCQ for READ (10) Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)

ie ry
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
ev a
02 3A MEDIUM NOT PRESENT
n
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
i
05 64 ILLEGAL MODE FOR THIS TRACK
rR m

03 11 05 L-EC UNCORRECTABLE ERROR


03 11 06 CIRC UNRECOVERED ERROR
fo eli

01 17 01 RECOVERED DATA WITH RETRIES


01 18 01 RECOVERED DATA WITH ERROR CORRECTION & RETRIES
APPLIED
Pr

01 18 04 RECOVERED DATA WITH L-EC

Page 118 working draft ATAPI


ATAPI CD-ROM Specification
READ (12) Command

9.8.14 READ (12) Command


The READ (12) command requests that the ATAPI CD-ROM Drive transfer data to the Host Computer. The most recent
data value written in the addressed logical block shall be returned. See "9.8.13 READ (10) Command" on page 117 for a
definition of the operation of this command.

nl t
Table 76 - READ (12) Command

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation Code (A8h)

w D
1 Reserved

y
2 Logical Block Address
3

ie ry
4
5
6 Transfer Length
ev a
7
8
n
9
10 Reserved
i
11 Reserved
rR m
fo eli

Table 77 - Recommended Sense Key, ASC and ASCQ for READ (12) Command Errors
Sense Key ASC ASCQ Description of Error
Pr

05 20 INVALID COMMAND OPERATION CODE


05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT

working draft ATAPI Page 119


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ (12) Command

Table 77 - Recommended Sense Key, ASC and ASCQ for READ (12) Command Errors
Sense Key ASC ASCQ Description of Error
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
05 64 ILLEGAL MODE FOR THIS TRACK

nl t
03 11 05 L-EC UNCORRECTABLE ERROR

O raf
03 11 06 CIRC UNRECOVERED ERROR
01 17 01 RECOVERED DATA WITH RETRIES
01 18 01 RECOVERED DATA WITH ERROR CORRECTION & RETRIES
APPLIED

w D
y
01 18 04 RECOVERED DATA WITH L-EC

ie ry
ev a i n
rR m
fo eli
Pr

Page 120 working draft ATAPI


ATAPI CD-ROM Specification
READ CD-ROM CAPACITY Command

9.8.15 READ CD-ROM CAPACITY Command


The READ CD-ROM CAPACITY command provides a means for the Host Computer to request information regarding
the capacity of the Device. The general function of the CD-ROM version of READ CAPACITY is the same but the exact
definition of the returned logical block address is modified to allow returning a possibly inexact value (but one with a
known error boundary) based on CD-ROM table of contents data. For many CD-ROM devices, this implementation al-
lows a quicker response.

nl t
O raf
Table 78 - READ CD-ROM CAPACITY Command
Bit
7 6 5 4 3 2 1 0
Byte

w D
y
0 Operation code (25h)
1 Reserved
2 Reserved

ie ry
3 Reserved
4 Reserved
ev a
5 Reserved
6 Reserved
n
7 Reserved
8 Reserved
i
9 Reserved
rR m

10 Reserved
11 Reserved
fo eli

Eight bytes of READ CD-ROM CAPACITY data shall be returned to the Host Computer.
Pr

Table 79 - READ CAPACITY DATA


Bit
7 6 5 4 3 2 1 0
Byte
0 Logical Block Address
1
2
3
4 Block Length in Bytes
5
6
7

working draft ATAPI Page 121


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD-ROM CAPACITY Command

Table 80 - Recommended Sense Key, ASC and ASCQ for Read Capacity Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)

ie ry
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
ev a
02 3A MEDIUM NOT PRESENT
i n
rR m
fo eli
Pr

Page 122 working draft ATAPI


ATAPI CD-ROM Specification
READ CD Command

9.8.16 READ CD Command


The READ CD command (Family) provides one standard, universal way of accessing CD data. Rather than breaking the
types of data into several related commands, this command is generic to all CD data types.

This command returns any of the CD data streams, including the headers, EDC and ECC, ROM data and CD-DA data.
Each type of data is enabled via the use of flags. These flags indicate which information from the CD is to be returned in

nl t
the data stream. If a flag is cleared, then that particular information will not be returned. If all the flags are cleared, no

O raf
data will be returned to the host and this condition is not treated as an error.

w D
y
Table 81 - READ CD Command
Bit
7 6 5 4 3 2 1 0
Byte

ie ry
0 Operation Code (BEh)
1 Reserved Expected Sector Type Reserved
ev a
2 Starting Logical Block Address
3
n
4
5
i
rR m

6 Transfer Length in Blocks


7
8
fo eli

9 Flag Bits
Synch Header(s) Code User Data EDC & Error Flag(s) Reserved
Field ECC
10 Reserved Sub-Channel Data Selection Bits
Pr

11 Reserved

The Expected Sector Type field is used to limit the amount of information returned to the Host. If the Requested Sec-
tor(s) do not match the specified type, the command will be terminated with a CHECK CONDITION. The Sector that
does not match will not be transferred to the Host. The sense key shall be set to ILLEGAL MODE FOR THIS TRACK.

Implementer’s Note: The Expected Sector Type is used to generate an error and terminate the transfer when the sectors
found on the media, do not match the type desired. This field has NO control of the actual number of bytes transfer.

working draft ATAPI Page 123


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD Command

Table 82 - READ-CD, Expected Sector Type Field Definition


Expected
Sector Definition Description
Type

nl t
000b Any Type No checking of the Sector Type will be performed. The device shall always termi-

O raf
(Mandatory) nate a command, at the sector where a transition between CD-Rom and CD-DA
occurs.
001b CD DA Only Red Book (CD-DA) sectors shall be allowed. An attempt to read any other
(Optional) format shall result in the reporting of an error.

w D
010b Mode 1 Form 1 Only Yellow Book sectors which have a “user” data field of 2048 bytes shall be

y
(Mandatory) allowed. An attempt to read any other format shall result in the reporting of an
error.
011b Mode 1 Form 2 Only Yellow Book sectors which have a “user” data field of 2336 bytes shall be

ie ry
(Mandatory) allowed. An attempt to read any other format shall result in the reporting of an
error.
100b Mode 2 Form 1 Only Green Book sectors which have a “user” data field of 2048 shall be allowed.
ev a
(Mandatory) An attempt to read any other format shall result in the reporting of an error.
101b Mode 2 Form 2 Only Green Book sectors which have a “user” data field of 2324 shall be allowed.
n
(Mandatory) An attempt to read any other format shall result in the reporting of an error. Note
that the spare data is included in the user data making the size 2324+4= 2328.
i
rR m

110b - Reserved
111b
fo eli

See also, CD-ROM Sector Formats on page 45.

The Synch Field Bit, when set to one indicates that the Synch Field from the sector will be included in the data stream.
Pr

Note that the data fields that are requested to be included in the data stream shall be contiguous. The Synch Field infor-
mation (if selected) will be the first information in the data stream; all other fields will follow.

The Header(s) Code is an encoded field that indicates the Header / Subheader information to be placed in the data stream.

Table 83 - READ CD, Header Code Field Definition


Header(s)
Definition Description
Code
00b None None of the header data shall be placed in the data stream.
01b HdrOnly Only the Mode 1 or Form 1 4-byte header will be returned in the data stream.
10b SubheaderOnly Only the Mode 2 Form 1 or 2 Subheader will be placed into the data stream.
11b All Headers Both the Header and Subheader will be placed in the data stream.

The User Data Flag, when set to one, indicates that the Data part of a CD Sector shall be returned in the data stream.
When set to 1, the whole user data will be returned to the host. Note that the setting of the Mode Select Density Code
does not apply to this command, and the physical user data will be returned. If the current track is an Audio Track then
the Audio Data will be returned, else the normal CD-ROM data will be returned. The possible data lengths are 2048,
2336, 2328 and 2352.

The EDC and ECC Flag, when set to one, indicates that the EDC and ECC (L-EC) field shall be included in the data

Page 124 working draft ATAPI


ATAPI CD-ROM Specification
READ CD Command

stream. For Mode 1 CDs this will include the 8 bytes of pad data.

Error Flag(s) is an encoded field that indicates which (if any) of the C2 and/or Block Error data will be included in the
data stream. All the field types are mandatory. If the drive does not support the C2 pointers (as reported in the Mode
sense Capabilities page) the data returned shall be zero filled.

nl t
Table 84 - READ CD, Error Flag Field Definition

O raf
Error
Definition Description
Flags
00b None No Error information will be included in the data stream.

w D
y
01b C2 Error Flag data The C2 Error Flag (Pointer) bits (2352 bits or 294 bytes) will be included in the data
stream. When the C2 Error pointer bits are included in the data stream, there will be
one bit for each byte in error in the sector (2352 total). The bit ordering is from the
most significant bit to the least significant bit in each byte. The first bytes in the sector

ie ry
will be the first bits/bytes in the data stream.
10b C2 & Block Error Flags Both the C2 Error Flags (2352 bits or 294 bytes) and the Block Error Byte will be
included in the data stream. The Block Error byte is just the longitudinal parity of all
ev a
the C2 Error Flag bytes. So that the data stream will always be an even number of
bytes, the Block Error byte will be padded with a 0 byte. The Block Error byte will be
n
first in the data stream followed by the pad byte.
11b Reserved Reserved for future enhancement.
i
rR m

The Sub-Channel Data Selection bits indicate which CD Sub-Channel information is to be included in the data stream,
fo eli

the Q information and/or the “Raw” Sub-channel information (All eight channels, one byte from each of the small
frames.) If the bit is set, then that Sub-channel data will be included in the data stream to the Host.
Pr

Table 85 - READ CD, Sub-channel Data Selection Field Definition


Sub-channel
Data Definition Description Type
Selection
000b No Sub-channel Data No Sub-channel data will be transferred Mandatory
001b RAW Raw Sub-channel data will be transferred Optional
010b Q Q data will be transferred Mandatory
011b Reserved
100b R-W R-W data will be transferred Optional
101b - 111b Reserved

Support of Sub-channel data is optional. In the case of R-W the drive may return the data de-interleaved and error-cor-
rected, RAW or padded with zeros depending on the R-W Supported and R-W de-interleaved and error-corrected bits in
the CD-ROM capabilities and mechanical status page.

If the Starting Logical Block Address is set to FFFFFFFFh and the only information requested to be placed in the data
stream is the Sub-channel data and there is currently a PLAY AUDIO command in process, the actual address used will
be from the current location (of the Audio play).

working draft ATAPI Page 125


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD Command

Table 86 - Number of Bytes Returned Based on Data Selection Field

Flag Mode 1 Mode 1 Mode 2 Mode 2


CD-DA
Bits Form 1 Form 2 Form 1 Form 2
Sync 80h 0 12 12 12 12
Header 20h 0 4 4 4 4

nl t
Sync & Header A0h 0 16 16 16 16

O raf
Sub Header 40h 0 0 0 8 8
All Headers 60h 0 4 4 12 12
Sync & Headers E0h 0 16 16 24 24
User Data 10h 2352 2048 2336 2048 2328

w D
y
Sub Header & User Data 50h 2352 2048 2336 2056 2336
Header & User Data 30h 2352 2052 2340 2052 2332
All Headers & User Data 70h 2352 2052 2340 2060 2340

ie ry
Sync & All Headers & User Data F0h 2352 2064 2352 2072 2352
Repeat All Above and Add 08h 0 288 0 280 0
EDC / ECC
ev a
Repeat All Above and Add 02h 294 294 294 294 294
Error Flags
n
Repeat All Above and Add 04h 296 296 296 296 296
Block & Error Flags
i
rR m

The number of bytes returned is based on which bits are set in the Data Selection Field.
The table above allows you to calculate the number of bytes returned based on which Data Selection field bits are set.
fo eli

Example: A Data Selection field value of 3Ah= 30h+08h+02h would return the following:

• 2352+0+294 bytes for a CD-DA sector.


Pr

• 2052+288+294 bytes for a Mode 1 Form 1 sector.

• 2340+0+294 bytes for a Mode 1 Form 2 sector.

• 2052+280+294 bytes for a Mode 2 Form 1 sector.

• 2332+0+294 bytes for a Mode 2 Form 2 sector.

See "Figure 13 - CD-ROM Sector Formats" on page 45 for a description of the data available for each sector type.

Page 126 working draft ATAPI


ATAPI CD-ROM Specification
READ CD Command

Table 87 - Recommended Sense Key, ASC and ASCQ for Read CD Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)

ie ry
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
ev a
02 3A MEDIUM NOT PRESENT
n
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
i
05 54 ILLEGAL MODE FOR THIS TRACK
rR m

05 00 11 AUDIO PLAY OPERATION IN PROGRESS


0B BF LOSS OF STREAMING
fo eli

The number of bytes returned is based on which bits are set in the Data Selection Field. The table above allows you to c

The CD-DA audio data includes 16 bits of information for each channel, and will be formatted as follows when an audio
Pr

track is read.

Table 88 - CD-DA (Digital Audio) Data Block Format


Bit
7 6 5 4 3 2 1 0
Byte
Cell 1 (1st of 588)
0 Left Channel (Lower Byte)
b7 b6 b5 b4 b3 b2 b1 b0
1 Left Channel Upper Byte
b15 b14 b13 b12 b11 b10 b9 b8
2 Right Channel (Lower Byte)
b7 b6 b5 b4 b3 b2 b1 b0
3 Right Channel Upper Byte
b15 b14 b13 b12 b11 b10 b9 b8
...
Cell 588 (last)

working draft ATAPI Page 127


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD Command

Table 88 - CD-DA (Digital Audio) Data Block Format


Bit
7 6 5 4 3 2 1 0
Byte
2348 Left Channel (Lower Byte)
b7 b6 b5 b4 b3 b2 b1 b0

nl t
2349 Left Channel Upper Byte

O raf
b15 b14 b13 b12 b11 b10 b9 b8
2350 Right Channel (Lower Byte)
b7 b6 b5 b4 b3 b2 b1 b0
2351 Right Channel Upper Byte

w D
b15 b14 b13 b12 b11 b10 b9 b8

y
If the CD-ROM Drive does not support the CD-DA Stream-Is-Accurate capability (See "[Link] CD-ROM Capabilities

ie ry
and Mechanical Status Page" on page 99) then the Digital Audio data must be read as a continuous stream. If while
streaming the drive must stop, there will be a non-recoverable error generated (Sense Key 0Bh ABORTED Command,
Sense Code BFh LOSS OF STREAMING). This is due to the 1 second uncertainty of the address (There is no header in
ev a
CD-DA Data). Reissuing the command may not return exactly the same data as the previous try. When the drive sup-
ports the Stream Accurate capability, there will be no error, only some time delay for rotational latency.
i n
rR m
fo eli
Pr

Page 128 working draft ATAPI


ATAPI CD-ROM Specification
READ CD Command

Sync Header Data EDC ECC (P&Q)

nl t
O raf
Raw Sub-channel

Q-Formatted

w D
y
ie ry
R-W de-interleaved and
error-corrected
ev a
SubHeader C2 Error Flags
n
Block Error Flags
i
rR m

Sub-channel Q
SmallFrame(1) SmallFrame(98)
fo eli

CD Digital Audio

C2 Error Flags Raw Sub-channel


Block Error Flags
Pr

Figure 15 - Read CD Data Stream Order

working draft ATAPI Page 129


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD Command

[Link] Description of Sub-channels R-W

Sync

Sync

p Q R-W

nl t
98 Bytes

O raf
.
. 96 Bytes (RAW)
.

w D
p Q R-W

y
96 six-bit symbols

ie ry
ev a n
Sec. 5.1.6 Red Book (How to cook Packet Data)
i
rR m
fo eli

PACKET PACKET
Synch 4 Groups of 24 words Synch 4 Groups of 24 words
Pr

2 24 24 24 24 2 24 24 24 24
PACK PACK PACK PACK PACK PACK PACK PACK

Mode & EDC/ECC User Data EDC/ECC


Item Parity Q0/1 Parity P0-P3
1 1 2 16 4
Instruction

Note: the sizes shown are in 6 bit words.

Figure 16 - Read CD Sub-channel, R-W (100b)

Page 130 working draft ATAPI


ATAPI CD-ROM Specification
READ CD Command

Table 89 - R-W Raw


Bit
7 6 5 4 3 2 1 0
Byte
0 P2W (0)

nl t
1 P2W (1)

O raf
... ...
95 P2W (95)

R-W Raw is returned in the format and order found on the media. It is the responsibility of the device driver to deinter-

w D
y
leave and perform error detection and correction on the RAW data to make it usable to higher level applications.

ie ry
Table 90 - R-W De-Interleaved & Error Corrected
ev a
Bit
7 6 5 4 3 2 1 0
Byte
n
0 P Q PACK1(0)
1 P Q PACK1(1)
i
... ...
rR m

23 P Q PACK1(23)
24 P Q PACK2(0)
fo eli

25 P Q PACK2(1)
... ...
47 P Q PACK2(23)
48 P Q PACK3(0)
Pr

49 P Q PACK3(1)
... ...
71 P Q PACK3(23)
72 P Q PACK4(0)
73 P Q PACK4(1)
... ...
95 P Q PACK4(23)

Drives that can not return P or Q code with PACK data will return 0 in the unsupported P or Q bits. Each PACK is gener-
ated after 2 contiguous Sub Channel data frames consisting of 24 bytes with 6 bits of PACK data per [Link] 96 byte
Packet consists of 4 PACKs of 24 bytes each.

The basic RAW format is shown in "Figure 16 - Read CD Sub-channel, R-W (100b)" on page 130. The data is synchro-
nized with the subcode synch patterns S0 and S1. Each group of 6 bits (R-W) is called a “symbol”. The symbol following
the synchs S0 and S1 is the first symbol of the first pack in a packet.

To guard the data in the subcoding channels R-W, a (24,20) Reed-Solomon Error Correction Code is used. To improve
the burst error correction capability, eight-way interleaving is added to this error correction system.

The first two symbols in a pack have additional protection with a (4,2) Read-Solomon Error Correction Code. The first
symbol of a pack contains a mode-switch of 3 bits and a 3-bit subdivision of mode, called “item”. The defined mode-item

working draft ATAPI Page 131


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD Command

combinations are defined in the following table.

Table 91 - Sub-channel R-W, Allowed Mode/Item Combinations


Mode Item Description
000b (0d) 000b (0d) The ZERO mode

nl t
001b (1d) 000b (0d) The LINE GRAPHICS mode

O raf
001b (1d) The TV GRAPHICS mode
111b (7d) 000b (0d) The USER mode
All Others Reserved for future use

w D
y
The R-W information is returned as part of the “raw” sub-channel data. The lower 6 bits of each of the bytes contain the
R-W data. This data follows the format shown in "Figure 16 - Read CD Sub-channel, R-W (100b)" on page 130. If the Q

ie ry
information needs to be taken from the raw data, then it shall be deinterleaved according the Red book formats.
ev a i n
rR m
fo eli
Pr

Page 132 working draft ATAPI


ATAPI CD-ROM Specification
READ CD MSF Command

9.8.17 READ CD MSF Command

Table 92 - READ CD MSF Command


Bit
7 6 5 4 3 2 1 0
Byte

nl t
O raf
0 Operation code (D5h)
1 Reserved Expected User data type Reserved
2 Reserved
3 Starting M Field

w D
y
4 Starting S Field
5 Starting F Field
6 Ending M Field

ie ry
7 Ending S Field
8 Ending F Field
9 Flag Bits
ev a
Synch Header(s) Code User Data EDC & Reserved for Error Type Reserved
Field ECC
n
10 Reserved Sub-Channel Data Selection Bits
Sub Q Raw Reserved
i
rR m

11 Reserved
fo eli

The Starting M field, the Starting S field, and the Starting F field specify the absolute MSF address at which the Read op-
eration shall begin. The Ending M field, the Ending S field, and the Ending F field specify the absolute MSF address
where the Read operation shall end. All contiguous sectors between the starting and the ending MSF address shall be
read.
Pr

A starting MSF address equal to an ending MSF address prevents a read operation. This shall not be considered an error.
If the starting MSF address is greater than the ending MSF address, the command shall be terminated with CHECK
CONDITION status. The sense key shall be set to ILLEGAL REQUEST.

If the starting address is not found, or if a not ready condition exists, the command shall be terminated with CHECK
CONDITION status.

See "9.8.16 READ CD Command" on page 123 for a description of Expected User Data Type, Flag Bits and Sub-channel
Data Selection Bits.

Table 93 - Recommended Sense Key, ASC and ASCQ for Read CD MSF Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 01 LOGICAL UNIT IS IN PROCESS OF BECOMING READY
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)

working draft ATAPI Page 133


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ CD MSF Command

Table 93 - Recommended Sense Key, ASC and ASCQ for Read CD MSF Command Errors
Sense Key ASC ASCQ Description of Error
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT

nl t
02 3A MEDIUM NOT PRESENT

O raf
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
05 00 11 AUDIO PLAY OPERATION IN PROGRESS

w D
05 54 ILLEGAL MODE FOR THIS TRACK

y
ie ry
ev a i n
rR m
fo eli
Pr

Page 134 working draft ATAPI


ATAPI CD-ROM Specification
READ HEADER Command

9.8.18 READ HEADER Command


The READ HEADER command requests that the device return the CD-ROM Data Block Address Header of the request-
ed logical block.

Table 94 - READ HEADER Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (44h)
1 Reserved MSF Reserved

w D
2 Logical Block Address

y
3
4

ie ry
5
6 Reserved
7 Allocation Length
ev a
8
9 Reserved
n
10 Reserved
11 Reserved
i
rR m

See "7.6 CD-ROM Address Reporting Formats (MSF bit)" on page 50 for a description of the MSF bit.
fo eli

The Logical Block Address field specifies the logical block at which the read header operation shall begin.

See the READ (10) command for exception handling. If the logical block size is other than the physical block size, it
Pr

shall be mapped into the appropriate physical block from which the data would have been read.

The READ HEADER data format below defines the format for the returned CD-ROM data block address header of the
requested logical block.

Table 95 - READ HEADER Data Format


Bit
7 6 5 4 3 2 1 0
Byte
0 CD-ROM Data Mode
1 Reserved
2 Reserved
3 Reserved
4 Absolute CD-ROM Address
5
6
7

working draft ATAPI Page 135


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ HEADER Command

The CD-ROM Data Mode field specifies the CD-ROM data mode of the logical blocks in this sector of data. The values
in this field are defined in "Table 96 - CD-ROM Data Mode Codes" on page 136.

Table 96 - CD-ROM Data Mode Codes


User Data Field Contents Auxiliary Field Contents
CD-ROM Data Mode

nl t
(2048 Bytes) (288 bytes)

O raf
00h All bytes zero All bytes zero
01h User data L-EC symbols
02h User data User data
03h - FFh Reserved Reserved

w D
y
If the MSF bit is zero, the Absolute Address field gives the logical block address of the first logical block in the physical

ie ry
sector where the data for the requested logical block address is found. If the MSF bit is one, the Absolute Address field
gives the MSF address of the sector where the data for the requested logical block address is found.
ev a
Table 97 - Recommended Sense Key, ASC and ASCQ for Read Header Command Errors
n
Sense Key ASC ASCQ Description of Error
i
05 20 INVALID COMMAND OPERATION CODE
rR m

05 24 INVALID FIELD IN COMMAND PACKET


06 28 NOT READY TO READY TRANSITION
fo eli

06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED


02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
Pr

02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED


02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
05 54 ILLEGAL MODE FOR THIS TRACK

Page 136 working draft ATAPI


ATAPI CD-ROM Specification
READ SUB-CHANNEL Command

9.8.19 READ SUB-CHANNEL Command


The READ SUB-CHANNEL command requests that the ATAPI CD-ROM Drive return the requested sub-channel data
plus the state of audio play operations.

Table 98 - READ SUB-CHANNEL Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (42h)
1 Reserved MSF Reserved

w D
(Mandatory)

y
2 Reserved SubQ Reserved
(Mandatory)
3 Sub-channel Data Format

ie ry
4 Reserved
5 Reserved
6 Track Number
ev a
7 Allocation Length
8
n
9 Reserved
i
10 Reserved
rR m

11 Reserved
fo eli

Sub-channel data returned by this command may be from the last appropriate sector encountered by a current or previ-
ous media accessing operation. When there is no current audio play operation, the ATAPI CD-ROM Drive may access
the media to read the sub-channel data. The ATAPI CD-ROM Drive is responsible for ensuring that the data returned are
Pr

current and consistent.

See "7.6 CD-ROM Address Reporting Formats (MSF bit)" on page 50 for a description of the MSF bit. Support for the
MSF bit is mandatory.

The sub Q bit set to one requests that the ATAPI CD-ROM Drive return the Q sub-channel data. The sub Q bit set to zero
requests that no sub-channel data be returned. This shall not be considered an error. Support for the SubQ bit is mandato-
ry. When the sub Q bit is Zero, only the Sub-Channel header is returned.

working draft ATAPI Page 137


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ SUB-CHANNEL Command

Table 99 - )Sub-channel Data Format Header

Bit
7 6 5 4 3 2 1 0
Byte

nl t
O raf
Sub Channel Data Header
0 Reserved
1 Audio Status
2 Sub-channel Data Length

w D
y
3

ie ry
The sub-channel data format field specifies the returned sub channel data. If this field is 01h, 02h or 03h, the requested
sub-Q data item is returned.
ev a n
Table 100 - Sub-channel Data Format Codes
i
Support
Format Code Returned data
rR m

Requirement
00h Reserved Reserved
01h CD-ROM current position Mandatory
fo eli

02h Media catalogue number (UPC/bar code) Mandatory


03h Track international standard recording code (ISRC) Mandatory
04h - EFh Reserved
Pr

F0h - FFh Vendor-specific Optional

The track number field specifies the track number from which the ISRC code is transferred. This field shall have a value
from 01h to 63h (99d), and is valid only when the sub-channel data format is 03h. If this field is nonzero for all sub-
channel data formats other than 03h the drive will terminate the command with a check condition (INVALID REQUEST
/ INVALID FIELD IN COMMAND PACKET).

[Link] CD-ROM Current Position Data Format

Table 101 - CD-ROM Current Position Data Format (Format Code 01h)
Bit
7 6 5 4 3 2 1 0
Byte
Sub Channel Data Header
0 Reserved
1 Audio Status
2 Sub-channel Data Length
3
CD-ROM Current Position Data Block

Page 138 working draft ATAPI


ATAPI CD-ROM Specification
READ SUB-CHANNEL Command

Table 101 - CD-ROM Current Position Data Format (Format Code 01h)
Bit
7 6 5 4 3 2 1 0
Byte
4 Sub Channel Data Format Code (01h)
5 ADR Control

nl t
6 Track Number

O raf
7 Index Number
8 Absolute CD-ROM Address
11
12 Track Relative CD-ROM Address

w D
15

y
The Audio Status field indicates the status of audio play operations. The audio status values are defined in "Table 102 -

ie ry
Audio Status Codes" on page 139. Audio status values 13h and 14h return information on previous audio operations;
they are returned only once after the condition has occurred. If another audio play operation is not requested, the audio
status returned for subsequent READ SUB-CHANNEL commands is 15h.
ev a n
Table 102 - Audio Status Codes
i
Status Description
rR m

00h Audio status byte not supported or not valid


11h Audio play operation in progress
fo eli

12h Audio play operation paused


13h Audio play operation successfully completed
14h Audio play operation stopped due to error
Pr

15h No current audio status to return

The Sub-channel Data Length specifies the length in bytes of the following sub-channel data block. A sub-channel data
length of zero indicates that no sub-channel data block is included in the returned data. Sub-channel data length does not
include the sub channel header.

The Sub-Q Channel Data Block consists of control data (bytes 4 - 5), current position data (bytes 6 - 15) and identifica-
tion data (bytes 16 - 47). The control data and current position data is obtained from the Q sub-channel information of the
current block. Identification data may be reported that was obtained from a previous block. If identification data is re-
ported, the data shall be valid for the sector addressed by the current position data.
1. If an audio play operation is proceeding in the background, position data for the last sector played shall be report-
ed.
2. In other cases, for instance after a READ command, the ATAPI CD-ROM Drive may either report position data
for the last sector processed for that operation or may report position data from the sector at the current read head
position.

The ADR field gives the type of information encoded in the Q sub-channel of this block, as shown in the following table.

working draft ATAPI Page 139


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ SUB-CHANNEL Command

Table 103 - ADR Sub-channel Q Field


ADR code Description
0h Sub-channel Q mode information not supplied
1h Sub-channel Q encodes current position data (i.e. track, index, absolute address, relative address)

nl t
2h Sub-channel Q encodes media catalogue number

O raf
3h Sub-channel Q encodes ISRC
4h - Fh Reserved

w D
y
Table 104 - Sub-channel Q Control Bits

ie ry
Bit Equals zero Equals one
0 Audio without pre-emphasis Audio with pre-emphasis
ev a
1 Digital copy prohibited Digital copy permitted
2 Audio track Data track
n
3 Two-channel audio Four-channel audio
i
rR m

The Track Number field specifies the track from which ISRC data is read. This field must have a value between 01h and
63h and is valid only when the sub-channel data format field is 03h. In this case, the ATAPI CD-ROM Drive returns
fo eli

ISRC data for this track.

The Index Number specifies the index number in the current track.
Pr

The Absolute CD-ROM Address field gives the current location relative to the logical beginning of the media. If the
MSF bit is zero, this field is a logical block address. If the MSF bit is one, this field is an absolute MSF address.

The Track Relative CD-ROM Address field gives the current location relative to the logical beginning of the current
track. If the MSF bit is zero, this field is a track relative logical block address. (If the current block is in the pre-gap area
of a track, this will be a negative value, expressed as a twos-complement number.) If the MSF bit is one, this field is the
relative MSF address from the Q sub-channel.

Page 140 working draft ATAPI


ATAPI CD-ROM Specification
READ SUB-CHANNEL Command

[Link] Media Catalogue Number Data Format


A Media Catalogue Valid (MCVal) bit of one indicates that the media catalogue number field is valid. A MCVal bit of
zero indicates that the media catalogue number field is not valid.

The Media Catalogue Number field contains the identifying number of this media according to the uniform product code
values (UPC/EAN bar coding) expressed in ASCII. Non-zero values in this field are controlled by the Uniform Product

nl t
Code Council1) and the European Article Number Council2. A value in this field of all ASCII zeros indicates that the

O raf
media catalog number is not supplied.

If media catalogue number data is found, the MCVal bit is set to one. If MCN data is not detected, the MCVal bit is set to
zero to indicate the Media Catalogue Number field is invalid.

w D
y
Media catalogue number data returned by this command with sub-channel data format field code 02h may be from any
block that has UPC bar code Q sub-channel data. (This code is constant anywhere in every applicable disc.)

ie ry
The CD-ROM Drive may either return the UPC information that it has previously read (Cached data) or may scan for the
information. As the UPC is only guaranteed to be contained in 1 out of 100 sectors and errors may be encountered, the
time required to return the UPC data could be several seconds.
ev a n
Table 105 - Media Catalogue Number Data Format (Format Code 02h)
i
Bit
rR m

7 6 5 4 3 2 1 0
Byte
Sub Channel Data Header
fo eli

0 Reserved
1 Audio Status
2 Sub-channel Data Length
Pr

3
Media Catalogue Number Data Block
4 Sub Channel Data Format Code (02h)
5 Reserved
6 Reserved
7 Reserved
8 MCVal Reserved
9 Media Catalogue Number (UPC/Bar Code)
23 (See "Table 106 - UPC Format" on page 142)

1. The Uniform Product Code Council is located at 8163 Old Yankee Road, Suite J, Dayton, Ohio 45459.
2. The European Article Number Council is located at Rue des Colonies, 54-BTE8, 1000 Brussels, Belgium.

working draft ATAPI Page 141


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ SUB-CHANNEL Command

Table 106 - UPC Format


Bit
7 6 5 4 3 2 1 0
Byte
8 MCVal Reserved

nl t
9 N1 (Most significant)

O raf
10 N2
11 N3
12 N4

w D
13 N5

y
14 N6
15 N7
16 N8

ie ry
17 N9
18 N10
ev a
19 N11
20 N12
n
21 N13
22 Zero
i
23 AFrame (Binary)
rR m

N1 through N13 shall be retrieved from the Q channel in mode 2. The data shall be encoded as ASCII characters (i.e. if
N1 of the UPC is 01bcd, then N1 of the above field shall be 49d or 31h).
fo eli

[Link] Track International Standard Recording Code Data Format


Pr

The Track ISRC field contains the identifying number of this media according to the ISRC standards (DIN-31-621).

Table 107 - Track International Standard Recording Code Data Format


Bit
7 6 5 4 3 2 1 0
Byte
Sub Channel Data Header
0 Reserved
1 Audio Status
2 Sub-channel Data Length
3
Track ISRC Data Block
4 Sub Channel Data Format Code (03h)
5 ADR (03) Control
6 Reserved
7 Reserved
8 TCVal Reserved
9 Track International Standard Recording Code (ISRC)
23 )

Page 142 working draft ATAPI


ATAPI CD-ROM Specification
READ SUB-CHANNEL Command

If ISRC data is detected, the TCVal bit is set to one. If ISRC data is not detected, the TCVal bit is set to zero to indicate
the ISRC field is invalid.

Track ISRC data returned by this command with sub-channel data format field 03h may be from any block in the speci-
fied track that has ISRC data. When ADR field is 3 (0011), it is used to assign a unique number to an audio track. This is
done by means of the ISRC which is 12 characters long (represented by I1 to I12.) The ISRC can only change immedi-
ately after the TNO has been changed.

nl t
O raf
Table 108 - Raw ISRC Format on the CD-ROM Disc
S0,
Control ADR I1 I2 I3 I4 I5 00 I6 I7 I8 I9 I10 I11 I12 zero A Frame CRC

w D
S1

y
3 ISRC 60 bits

ie ry
00: These 2 bits are zero.
zero: These 4 bits are zero.
ev a
I1,I2 are the country code; I3,I4,I5 are the owner code; I6,I7 are the year of recording; I8,I9,I10,I11,I12 are the serial
number of the recording. The characters from I1 to I5 are coded in a 6-bit format as given below; the characters from I6
n
to I12 are 4-bit BCD numbers. AFrame is the absolute frame number.
i
ISRC data returned is encoded as ASCII characters.
rR m
fo eli

Table 109 - ISRC Format of Data Returned to Host


Bit
7 6 5 4 3 2 1 0
Byte
Pr

8 TCVal Reserved
9 Reserved I1 (Country Code)
10 Reserved I2 (A - Z)
11 Reserved I3 (Owner Code)
12 Reserved I4
13 Reserved I5 (A - Z, 0 - 9)
14 Reserved 1 1 I6 (Year of Recording)
15 Reserved 1 1 I7
16 Reserved 1 1 I8 (Serial Number)
17 Reserved 1 1 I9
18 Reserved 1 1 I10
19 Reserved 1 1 I11
20 Reserved 1 1 I12
21 Zero
22 AFrame
23 Reserved

working draft ATAPI Page 143


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:41 pm READ SUB-CHANNEL Command

Table 110 - Recommended Sense Key, ASC and ASCQ for Read Sub-channel Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET

nl t
O raf
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY

w D
y
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)

ie ry
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
ev a
02 3A MEDIUM NOT PRESENT
n
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE
i
05 54 ILLEGAL MODE FOR THIS TRACK
rR m

05 00 11 AUDIO PLAY OPERATION IN PROGRESS


05 00 12 AUDIO PLAY OPERATION PAUSED
fo eli

05 00 13 AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED


05 00 14 AUDIO PLAY OPERATION STOPPED DUE TO ERROR
05 00 15 NO CURRENT AUDIO STATUS TO RETURN
Pr

[Link] Caching of Sub-Channel Data


Sub-Channel Q data shall be cached by the drive while playing audio. This is neccissary so that the Read Sub-Channel or
Read CDcommands can access the Sub-Channel Q data while executing an immediate command. The device shall gen-
erate an error if the data is not in the cache.

Read header will return the “Current” data, while Read CD will will return the specified data and remove any previous
(older) data from the cache.

Using “FFFFFFF” on Read CD will work just like Read Sub-Channel.

Page 144 working draft ATAPI


ATAPI CD-ROM Specification
READ TOC Command

9.8.20 READ TOC Command


The READ TOC command requests that the ATAPI CD-ROM Drive transfer data from the table of contents to the Host
Computer. Some drives will cache the TOC data and will be able to return it during an Audio play command. Drives that
do not cache the data will generate an error and not complete the command.

nl t
Table 111 - READ TOC Command

O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (43h)

w D
1 Reserved MSF Reserved

y
(Mandatory)
2 Reserved
3 Reserved

ie ry
4 Reserved
5 Reserved
6 Starting Track / Session Number
ev a
7 Allocation Length
n
8
9 Format Reserved
i
10 Reserved
rR m

11 Reserved

See "7.6 CD-ROM Address Reporting Formats (MSF bit)" on page 50 for a description of the MSF bit. Support for the
fo eli

MSF bit is mandatory.

To identify the multi-session CD TOC, the most significant 2 bits of the byte at offset 9 (Format) have been assigned to
Pr

identify this information. For handling multi-session and/or the Kodak PhotoCD, format 01b can be used. For drives that
do not support multi-session, the First session number should be equal to the Last session number in the returned TOC
information. Format field definition:

00b Mandatory This mode is a backward compatible mode where the starting track field speci-
fies the starting track number for which the data shall be returned. If this val-
ue is zero, the table of contents data shall begin with the first track on the
medium. The data are returned in contiguous ascending track number order.

01b Mandatory Multi-session mode and returns the first session number, last session number
and last session address. In this format the Starting Track is reserved and must
be zero. The allocation length must be 10 (0Ah) bytes.

10b Mandatory Returns all Sub-channel Q data in the lead in (TOC) area, starting from a spec-
ified session number as specified in the Session Number Field. In this mode,
the drive will support Q Subcode Point field values of A0h, A1h, A2h; Track
Numbers of B0h, B1h, B2h, B3h, B4h and C0h.

11b Reserved

The Starting Track Field specifies the starting track number for which the TOC data will be returned. The data is returned
in contiguous ascending order. Valid values for the starting track field are 0h to 63h. A value of AAh requests that the
starting address of the lead out area be returned. If this value is zero, the table of contents data will begin with the first
track on the disc.

working draft ATAPI Page 145


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm READ TOC Command

If the starting track field is not valid for the currently installed medium, the command shall be terminated with CHECK
CONDITION status. The sense key shall be set to ILLEGAL REQUEST and the additional sense code set to INVALID
FIELD IN COMMAND PACKET.

NOTE The maximum TOC data length possible on currently available CD-ROM media is 804 bytes, or 100 TOC track descriptors.

nl t
O raf
Table 112 - Read TOC Data Format (With Format Field = 00b)
Bit
7 6 5 4 3 2 1 0
Byte

w D
0 TOC Data Length

y
1
2 First Track Number

ie ry
3 Last Track Number
TOC Track Descriptors
0 Reserved
ev a
1 ADR Control
n
2 Track Number
3 Reserved
i
4 Absolute CD-ROM Address
rR m

The TOC Data Block contains a four-byte header followed by zero or more TOC track descriptors.
fo eli

The TOC Data Length specifies the length in bytes of the following TOC data that is available to be transferred to the
Host. The TOC Data Length Value does not include the TOC Data Length field itself.
Pr

The First Track Number field indicates the first track number in the table of contents. Valid track numbers are from 01d
to 99d (63h).

The Last Track Number field indicates the last track number in the table of contents before the lead-out track number.

The First Track Number is not required to be one. A disc may start at any valid track number. The track numbers between
the First Track Number and the Last Track Number are required to be in contiguous ascending order, except for the lead-
out track.

The ADR field gives the type of information encoded in the Q sub-channel of the block where this TOC entry was
found. The possible ADR values are defined in "Table 103 - ADR Sub-channel Q Field" on page 140.

The Control field indicates the attributes of the track. The possible Control field values are defined in "Table 118 - Val-
ues for Control Field in Sub-channel Q" on page 150.

The Track Number field indicates the track number for which the data in the TOC track descriptor is valid. A track num-
ber of 0AAh indicates that the track descriptor is for the start of the lead-out area.

The Absolute CD-ROM Address contains the address of the first block with user information for that track number as
read from the table of contents. If the MSF bit in the READ TOC is zero, the absolute CD-ROM address field contains a
logical block address. If the MSF bit is one, the absolute CD-ROM address field contains an MSF address.

The Starting Logical Block Address Value recovered from the TOC has a tolerance of zero for data tracks and plus or mi-
nus 75 CD sectors for audio tracks. This tolerance is multiplied by a factor dependent on the logical block length.

Page 146 working draft ATAPI


ATAPI CD-ROM Specification
READ TOC Command

Table 113 - Read TOC Data Format (With Format Field = 01b)
Bit
7 6 5 4 3 2 1 0
Byte
0 TOC Data Length (0Ah)

nl t
1

O raf
2 First Session Number
3 Last Session Number
TOC Track Descriptors

w D
0 Reserved

y
1 ADR Control
2 First Track Number in Last Session

ie ry
3 Reserved
4 Absolute CD-ROM Address of First Track in Last Session
7
ev a n
For Format field 10b, the drive should return TOC data for Q-subcode mode (ADR field) 1 and 5 (Except mode 5, point 1
through 40) in the lead in area.
i
rR m

The First Session Number is equal to the Last Session Number for single session discs or if the drive does not support
multi-session discs.
fo eli

The returned TOC data of a multi-session disc is arranged in ascending order of the session number. The TOC data with-
in a session is arranged in the order of Q Subcode Point Field value of A0h, A1h, A2h; Track Numbers B0h, B1h, B2h,
B3h, B4h and C0h.
Pr

working draft ATAPI Page 147


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm READ TOC Command

Table 114 - Read TOC Data Format (With Format Field = 10b)
Bit
7 6 5 4 3 2 1 0
Byte
0 TOC Data Length
1

nl t
2 First Session Number

O raf
3 Last Session Number
TOC Track Descriptors
0 Session Number
1 ADR Control

w D
y
2 Byte 1 or TNO
3 Byte 2 or Point
4 Byte 3 or Min

ie ry
5 Byte 4 or Sec
6 Byte 5 or Frame
7 Byte 6 or Zero
ev a
8 Byte 7 or PMin
9 Byte 8 or PSec
n
10 Byte 9 or PFrame
i
rR m

See Table 116, “Lead in Area (TOC), Sub-channel Q formats,” on page 149 and section [Link] on page 151 for a de-
tailed description of bytes 2-10 above.
fo eli

Table 115 - Recommended Sense Key, ASC and ASCQ for Read TOC Command Errors
Sense Key ASC ASCQ Description of Error
Pr

05 20 INVALID COMMAND OPERATION CODE


05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
02 57 UNABLE TO RECOVER TABLE OF CONTENTS
05 00 11 AUDIO PLAY OPERATION IN PROGRESS

Page 148 working draft ATAPI


ATAPI CD-ROM Specification
READ TOC Command

[Link] Sub-channel Q TOC information

Table 116 - Lead in Area (TOC), Sub-channel Q formats

nl t
CRC
S0,S Control /
TNO Point Min Sec Frame Zero Pmin PSec PFrame x16+x12

O raf
1 ADR
+x5+1
4/6 1 00 01-99 ATIP (Absolute time in pre- 00 Start position of track
groove)
4/6 1 00 A0 ATIP (Absolute time in pre- 00 First Track Disc Type 00

w D
y
groove) num
4/6 1 00 A1 ATIP (Absolute time in pre- 00 Last Track 00 00
groove) num

ie ry
4/6 1 00 A2 ATIP (Absolute time in pre- 00 Start potition of the Lead-out area
groove)
4/6 5 00 B0 Start time of next possible pro- # of point- Maximum start time of the outermost
ev a
gram in the Recordable Area of ers in Mode Lead Out area in the Recordable Area
the Hybrid Disc 5 of the Hybrid Disc
n
4/6 5 00 B1 00 00 00 00 # of Skip # of Skip 00
Interval Track
Pointers Pointers
i
rR m

(N<=40) (N<=21)
4/6 5 00 B2-B4 Skip # Skip # Skip # Skip # Skip # Skip # Skip #
4/6 5 00 01-40 Ending time for the interval that Reserved Start time for interval that should be
fo eli

should be skipped skipped on playback


4/6 5 00 C0 Opti- Applica- Reserved Reserved Start time of the first Lead In Area of
mum tion Code the Hybrid Disc
record-
Pr

ing
power

Point The Point field defines various types of information:

01-99 Track number references


A0 First Track number in the program area
A1 Last Track number in the program area
A2 Start location of the Lead-out area
B0 Used to identify a Hybrid Disc (Photo CD)
Contains start time of next possible program area
B1 Number of Skip Interval Pointers & Skip Track assignments
01-40 Skip Interval Pointers
B2-B4 Skip Track Assignment Pointers
C0 Start time of first Lead In area of Hybrid Disc
This only exists in the first Lead In area

Disc Type Byte This byte contains a definition of the type of disc

00h CD-DA or CD-ROM with first track in Mode 1


10h CD-I disc
20h CD-ROM XA disc with first track in Mode 2

working draft ATAPI Page 149


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm READ TOC Command

Table 117 - Bit Definitions for the Control Field in Sub-channel Q


Control Field Definition
00x0 2 Audio without Pre-emphasis
00x1 2 Audio with Pre-emphasis

nl t
0x0x Copy Prohibited

O raf
0x1x Copy Permitted
01x0 Digital Data
1xxx Broadcast Data (TBD)

w D
y
Table 118 - Values for Control Field in Sub-channel Q

ie ry
Control Field value Description
00h Copy Prohibited, 2 Audio with out pre-emphasis
ev a
01h Copy Prohibited, 2 Audio with pre-emphasis
02h Copy Permitted, 2 Audio with out pre-emphasis
n
03h Copy Permitted, 2 Audio with pre-emphasis
i
04h Copy Prohibited, Digital Data
rR m

05h Copy Prohibited, RESERVED


06h Copy Permitted, Digital Data
07h Copy Permitted, RESERVED
fo eli

08h - 0Fh Broadcast use


Pr

Page 150 working draft ATAPI


ATAPI CD-ROM Specification
READ TOC Command

[Link] Example Read TOC Operations


The following example is based on a 4-session, 12-track PhotoCD disc. Data structure is shown as the data to Host.

Command Packet: 43h 00 00 00 00 00 00 10h 00 80h 00 00

nl t
Table 119 - Example Read TOC Operations

O raf
Ses A/C TNO Pnt Min Sec Frame Zero PMin PSec PFrame Comments
01 14 00 A0 00 00 00 00 01 20 00 First track is 1. XA disc
01 14 00 A1 00 00 00 00 03 00 00 Last track is 3

w D
01 14 00 A2 00 00 00 00 02 08 3F Lead Out Area on 1st session

y
01 14 00 01 00 00 00 00 00 02 00 Start address of track 1
01 14 00 02 00 00 00 00 00 08 02 Start address of track 2

ie ry
01 14 00 03 00 00 00 00 00 15 32 Start address of track 3
01 54 00 B0 04 26 3F 02 40 02 00 Next recordable area address
01 54 00 C0 C0 00 00 00 61 2C 00 Hybrid disc
ev a
02 14 00 A0 00 00 00 00 04 14 00 1st track on 2nd session is 4
02 14 00 A1 00 00 00 00 06 00 00 Last track on 2nd session is 6
n
02 14 00 A2 00 00 0 00 08 20 08 Lead Out Area on 2nd session
02 14 00 04 00 00 00 00 04 28 3F Start address of track 4
i
rR m

02 14 00 05 00 00 00 00 04 2E 41 Start address of track 5


02 14 00 06 00 00 00 00 06 27 36 Start address of track 6
02 54 00 B0 09 2C 08 01 40 02 00 Next recordable area address
fo eli

03 14 00 A0 00 00 00 00 07 14 00 1st track on 3rd session is 7


03 14 00 A1 00 00 00 00 09 00 00 Last track on 3rd session is 9
03 14 00 A2 00 00 00 00 0C 27 32 Lead Out Area on 3rd session
Pr

03 14 00 07 00 00 00 00 09 2E 08 Start address of track 7


03 14 00 08 00 00 00 00 09 34 10 Start address of track 8
03 14 00 09 00 00 00 00 0B 04 24 Start address of track 9
03 54 00 B0 20 09 32 01 40 02 00 Next recordable area address
04 14 00 A0 00 00 00 00 0A 14 00 1st track on 4th session is 10
04 14 00 A1 00 00 00 00 0C 00 00 Last track on 4th session is12
04 14 00 A2 00 00 00 00 12 1B 1A Lead Out Area on 4th session
04 14 00 10 00 00 00 00 0E 0B 32 Start address of track 10
04 14 00 11 00 00 0 00 0E 11 34 Start address of track 11
04 14 00 12 00 00 00 00 11 08 22 Start address of track 12
04 54 00 B0 13 39 1A 01 40 02 00 Next recordable area address

Ses: session number


A/C: ADR/Control
TNO: 00 for Lead In area
Pnt: POINT

If you use following command on this disc, Command Packet: 43h 00 00 00 00 00 01h 10h 00 40h 00 00
return data would be:

TOC Data Length: 0Ah


First Session Number: 01h
Last Session Number: 04h

working draft ATAPI Page 151


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm READ TOC Command

Reserved: 00h
ADR/Control: 14h
First Track Number in Last session: 0Ah (10d)
Reserved: 00h
Absolute CD-ROM address of
first track in last session: 00h,00h,F8h,EDh (In LBA format, 63725 )
-> 14M 9S 50F

nl t
-> add 2 sec: 14M 11S 50F

O raf
w D
y
ie ry
ev a i n
rR m
fo eli
Pr

Page 152 working draft ATAPI


ATAPI CD-ROM Specification
REQUEST SENSE Command

9.8.21 REQUEST SENSE Command


The REQUEST SENSE command requests that the ATAPI CD-ROM Drive transfer sense data to the Host Computer.

Table 120 - Request Sense Command

nl t
Bit
7 6 5 4 3 2 1 0
Byte

O raf
0 Operation code (03h)
1 Reserved
2 Reserved

w D
3 Reserved

y
4 Allocation Length
5 Reserved

ie ry
6 Reserved
7 Reserved
8 Reserved
ev a
9 Reserved
10 Reserved
n
11 Reserved
i
rR m

The sense data:


1. shall be available if an error condition (CHECK CONDITION) had previously been reported to the Host Com-
fo eli

puter;
2. shall be available if other information (e.g. medium position) is available in any field.
Pr

If the ATAPI CD-ROM Drive has no other sense data available to return, it shall return a sense key of NO SENSE and an
additional sense code of NO ADDITIONAL SENSE INFORMATION.

The sense data shall be preserved by the ATAPI CD-ROM Drive until retrieved by a REQUEST SENSE command or
until the receipt of any other I/O Command.

The ATAPI CD-ROM Drive shall return CHECK CONDITION status for a REQUEST SENSE command only to report
exception conditions specific to the command itself. For example:
1. A non-zero reserved bit is detected in the Command Packet;
2. An ATAPI CD-ROM Drive malfunction prevents return of the sense data.

If a recovered error occurs during the execution of the REQUEST SENSE command, the ATAPI CD-ROM Drive shall
return the sense data with GOOD status. If an ATAPI CD-ROM Drive returns CHECK CONDITION status for a RE-
QUEST SENSE command, the sense data may be invalid.

ATAPI CD-ROM Drives shall be capable of returning at least 18 bytes of data in response to a REQUEST SENSE com-
mand. If the allocation length is 18 or greater, and an ATAPI CD-ROM Drive returns less than 18 bytes of data, the Host
Computer should assume that the bytes not transferred would have been zeros had the ATAPI CD-ROM Drive returned
those bytes. Host Computers can determine how much sense data has been returned by examining the allocation length
parameter in the Command Packet and the additional sense length in the sense data. ATAPI CD-ROM Drives shall not
adjust the additional sense length to reflect truncation if the allocation length is less than the sense data available.

working draft ATAPI Page 153


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm REQUEST SENSE Command

The sense data format for error codes 70h (current errors) and 71h (deferred errors) are defined in "Table 121 - Request
Sense Standard Data" on page 154. Error code values of 72h to 7Eh are reserved. Error code 7Fh is for a vendor-specific
sense data format. ATAPI CD-ROM Drives shall implement error code 70h; implementation of error code 71h is option-
al. Error code values of 00h to 6Fh are not defined by this Specification and their use is not recommended.

Table 121 - Request Sense Standard Data

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Valid Error Code (70h or 71h)
1 Segment Number (Reserved)

w D
y
2 Reserved ILI Reserved Sense Key
3 Information
6

ie ry
7 Additional Sense Length (n - 7)
8 Command Specific Information
11
ev a
12 Additional Sense Code
13 Additional Sense Code Qualifier (Optional)
n
14 Field Replaceable Unit Code (Optional)
i
15 SKSV Sense Key Specific (Optional)
rR m

(Optional)
17
18 Additional Sense Bytes
fo eli

A Valid bit of zero indicates that the information field is not as defined in this Specification. A Valid bit of one indicates
Pr

the information field contains valid information as defined in this Specification. ATAPI CD-ROM Drives shall imple-
ment the Valid bit.

The Segment Number field is Reserved.

An Incorrect Length Indicator (ILI) bit of one indicates that the requested allocation length did not match the logical
block length of the data on the medium.

The Sense Key, Additional Sense Code and Additional Sense Code Qualifier provide a hierarchy of information. The in-
tention of the hierarchy is to provide a top-down approach for a Host Computer to determine information relating to the
error and exception conditions. The Sense Key provides generic categories in which error and exception conditions can
be reported. Host Computers would typically use sense keys for high-level error recovery procedures. Additional Sense
Codes provide further detail describing the sense key. Additional Sense Code Qualifiers add further detail to the addition-
al sense code. The Additional Sense Code and Additional Sense Code Qualifier can be used by Host Computers where
sophisticated error recovery procedures require detailed information describing the error and exception conditions.

The Sense Key field is mandatory and indicates generic information describing an error or exception condition. The
sense keys are defined in section Table 124 -, "Sense Key Descriptions", on page 157.

The contents of the Information field is command-specific and is defined within the appropriate section for the com-
mand of interest. ATAPI CD-ROM Drives shall implement the Information field. Unless specified otherwise, this field
contains the unsigned logical block address associated with the sense key.

The Additional Sense Length field indicates the number of additional sense bytes to follow. If the allocation length of the
Command Packet is too small to transfer all of the additional sense bytes, the Additional Sense Length is not adjusted to

Page 154 working draft ATAPI


ATAPI CD-ROM Specification
REQUEST SENSE Command

reflect the truncation.

The Command-specific Information field contains information that depends on the command that was executed. Further
meaning for this field is defined within the command description.

The Additional Sense Code (ASC) field indicates further information related to the error or exception condition reported
in the Sense Key field. ATAPI CD-ROM Drives shall support the Additional Sense Code field. Support of the additional

nl t
sense codes not explicitly required by this Specification is optional. A list of additional sense codes is in "Table 125 -

O raf
ASC and ASCQ Assignments" on page 158. If the ATAPI CD-ROM Drive does not have further information related to
the error or exception condition, the Additional Sense Code is set to NO ADDITIONAL SENSE INFORMATION.

The Additional Sense Code Qualifier (ASCQ) indicates detailed information related to the Additional Sense Code. The

w D
y
ASCQ is optional. If the error or exception condition is reportable by the device, the value returned shall be as specified
in "Table 125 - ASC and ASCQ Assignments" on page 158. If the ATAPI CD-ROM Drive does not have detailed informa-
tion related to the error or exception condition, the ASCQ is set to zero.

ie ry
Non-zero values in the Field Replaceable Unit Code field are used to define a device-specific mechanism or unit that has
failed. A value of zero in this field shall indicate that no specific mechanism or unit has been identified to have failed or
ev a
that the data is not available. The Field Replaceable Unit Code field is optional. The format of this information is not
specified by this Specification. Additional information about the field replaceable unit may be available in the ASCII in-
n
formation page, if supported by the ATAPI CD-ROM Drive.
i
The Additional Sense Bytes field may contain command specific data, peripheral device specific data, or vendor-specific
rR m

data that further defines the nature of the CHECK CONDITION status.
fo eli

[Link] Sense-key Specific


The Sense-key Specific field is defined by this Specification when the value of the Sense-key Specific Valid (SKSV) bit
is one. The Sense-key Specific Valid bit and Sense-key Specific field are optional. The definition of this field is deter-
Pr

mined by the value of the sense key field. This field is reserved for sense keys not described below. An SKSV value of
zero indicates that this field is not as defined by this Specification.

If the Sense Key field is set to ILLEGAL REQUEST and the SKSV bit is set to one, the Sense-key Specific field indi-
cates which illegal parameters in the Command Packet or the data parameters are in error.

Table 122 - Field Pointer Bytes


Bit
7 6 5 4 3 2 1 0
Byte
15 SKSV C/D Reserved Reserved BPV Bit Pointer
16 Field Pointer
17

A Command Data (C/D) bit of one indicates that the illegal parameter is in the Command Packet. A C/D bit of zero indi-
cates that the illegal parameter is in the data parameters sent by the Host Computer.

A Bit Pointer Valid (BPV) bit of zero indicates that the value in the Bit Pointer field is not valid. A BPV bit of one indi-
cates that the Bit Pointer field specifies which bit of the byte designated by the field pointer field is in error. When a mul-
tiple-bit field is in error, the Bit Pointer field shall point to the most-significant (left-most) bit of the field.

The Field Pointer field indicates which byte of the Command Packet or of the parameter data was in error. Bytes are

working draft ATAPI Page 155


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm REQUEST SENSE Command

numbered starting from zero, as shown in the tables describing the commands and parameters. When a multiple-byte
field is in error, the pointer shall point to the most significant (left-most) byte of the field.

If the sense key is RECOVERED ERROR, HARDWARE ERROR or MEDIUM ERROR and if the SKSV bit is one, the
sense-key specific field shall be as shown in "Table 123 - Field Pointer Bytes" on page 156.

nl t
Table 123 - Field Pointer Bytes

O raf
Bit
7 6 5 4 3 2 1 0
Byte
15 SKSV C/D Reserved Reserved BPV Bit Pointer

w D
y
16 Actual Retry Count
17

ie ry
The Actual Retry Count field returns implementation-specific information on the actual number of retries of the recov-
ery algorithm used in attempting to recover an error or exception condition. This field should relate to the retry count
fields within the Error Recovery Page of the MODE SELECT command.
ev a n
[Link] Deferred Errors
Error code 70h indicates that the CHECK CONDITION status returned is the result of an error or exception condition on
i
the I/O process that returned the CHECK CONDITION status. This includes errors generated during execution of the
rR m

command by the actual execution process. It also includes errors not related to any command that are first observed dur-
ing execution of a command. Examples of this latter type of error include disk servo-mechanism, off-track errors, and
power-up test errors.
fo eli

Error code 71h (deferred error) indicates that the CHECK CONDITION status returned is the result of an error or excep-
tion condition that occurred during execution of a previous command for which GOOD status has already been returned.
Pr

Such commands are associated with use of the immediate bit, with some forms of caching, and with multiple command
buffering. ATAPI CD-ROM Drives that implement these features are required to implement deferred error reporting.

The deferred error may be indicated by returning CHECK CONDITION status to the Host Computer as described be-
low. The subsequent execution of a REQUEST SENSE command shall return the deferred error sense information.

If an I/O Command terminates with CHECK CONDITION status and the subsequent sense data returns a deferred error,
that I/O command shall not have been executed. After the ATAPI CD-ROM Drive detects a deferred error condition on
a Device, it shall return a deferred error according to the rules described below:
1. If a deferred error can be recovered with no external system intervention, a deferred error indication shall not be
posted unless required by the error handling parameters of the MODE SELECT command. The occurrence of the
error may be logged if statistical or error logging is supported.
2. If a deferred error can be associated with a particular function or a particular subset of data, and the error is either
unrecovered or required to be reported by the mode parameters, a deferred error indication shall be returned to the
Host Computer.

Deferred errors may indicate that an operation was unsuccessful long after the command performing the data transfer re-
turned GOOD status. If data that cannot be replicated or recovered from other sources is being stored using buffered
write operations, synchronization commands should be performed before the critical data is destroyed in the host Host
Computer. This is necessary to be sure that recovery actions can be taken if deferred errors do occur in the storing of the
data.

Page 156 working draft ATAPI


ATAPI CD-ROM Specification
REQUEST SENSE Command

[Link] Sense-key and Sense Code Definitions

Table 124 - Sense Key Descriptions


Sense key Description

nl t
0h NO SENSE. Indicates that there is no specific sense key information to be reported. This would be the case for a

O raf
successful command.
1h RECOVERED ERROR. Indicates that the last command completed successfully with some recovery action per-
formed by the ATAPI CD-ROM Drive. Details may be determinable by examining the additional sense bytes and
the information field. When multiple recovered errors occur during one command, the choice of which error to

w D
report (first, last, most severe, etc.) is device specific.

y
2h NOT READY. Indicates that the Device cannot be accessed. Operator intervention may be required to correct this
condition.
3h MEDIUM ERROR. Indicates that the command terminated with a non-recovered error condition that was probably

ie ry
caused by a flaw in the medium or an error in the recorded data. This sense key may also be returned if the ATAPI
CD-ROM Drive is unable to distinguish between a flaw in the medium and a specific hardware failure (sense key
4h).
ev a
4h HARDWARE ERROR. Indicates that the ATAPI CD-ROM Drive detected a non-recoverable hardware failure (for
example, controller failure, device failure, parity error, etc.) while performing the command or during a self test.
n
5h ILLEGAL REQUEST. Indicates that there was an illegal parameter in the Command Packet or in the additional
parameters supplied as data for some commands. If the ATAPI CD-ROM Drive detects an invalid parameter in the
i
Command Packet, then it shall terminate the command without altering the medium. If the ATAPI CD-ROM
rR m

Drive detects an invalid parameter in the additional parameters supplied as data, then the ATAPI CD-ROM Drive
may have already altered the medium.
6h UNIT ATTENTION. Indicates that the removable medium may have been changed or the ATAPI CD-ROM Drive
fo eli

has been reset.


7h DATA PROTECT. Indicates that a command that reads the medium was attempted on a block that is protected from
this operation. The read operation is not performed.
Pr

8h Reserved
9h - Ah Reserved
Bh ABORTED COMMAND. Indicates that the device has aborted the command. The Host may be able to recover by
trying the command again. This error is reported for conditions such as an overrun etc.
Eh MISCOMPARE. Indicates that the source data did not match the data read from the medium.
Fh Reserved

[Link] Using the REQUEST SENSE Command


Whenever an Error is reported, the Host Computer should issue a REQUEST SENSE command to receive the sense data
describing what caused the Error condition. If the Host Computer issues some other command, the sense data is lost.

working draft ATAPI Page 157


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm REQUEST SENSE Command

D - DIRECT ACCESS DEVICE


R - READ ONLY (CD-ROM) DEVICE
O - OPTICAL MEMORY DEVICE
M - MEDIA CHANGER DEVICE

nl t
ASC ASCQ DROM DESCRIPTION

O raf
00 00 DROM NO ADDITIONAL SENSE INFORMATION
00 11 R AUDIO PLAY OPERATION IN PROGRESS
00 12 R AUDIO PLAY OPERATION PAUSED
00 13 R AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED

w D
y
00 14 R AUDIO PLAY OPERATION STOPPED DUE TO ERROR
00 15 R NO CURRENT AUDIO STATUS TO RETURN
02 00 DROM NO SEEK COMPLETE

ie ry
04 00 DROM LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
04 01 DROM LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
04 02 DROM LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
ev a
04 03 DROM LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
n
06 00 DROM NO REFERENCE POSITION FOUND
09 00 DRO TRACK FOLLOWING ERROR
i
09 01 RO TRACKING SERVO FAILURE
rR m

09 02 RO FOCUS SERVO FAILURE


09 03 RO SPINDLE SERVO FAILURE
11 00 DRO UNRECOVERED READ ERROR
fo eli

11 06 RO CIRC UNRECOVERED ERROR


15 00 DROM RANDOM POSITIONING ERROR
15 01 DROM MECHANICAL POSITIONING ERROR
Pr

15 02 DRO POSITIONING ERROR DETECTED BY READ OF MEDIUM


17 00 DRO RECOVERED DATA WITH NO ERROR CORRECTION APPLIED
17 01 DRO RECOVERED DATA WITH RETRIES
17 02 DRO RECOVERED DATA WITH POSITIVE HEAD OFFSET
17 03 DRO RECOVERED DATA WITH NEGATIVE HEAD OFFSET
17 04 RO RECOVERED DATA WITH RETRIES AND/OR CIRC APPLIED
17 05 DRO RECOVERED DATA USING PREVIOUS SECTOR ID
18 00 DRO RECOVERED DATA WITH ERROR CORRECTION APPLIED
18 01 DRO RECOVERED DATA WITH ERROR CORRECTION & RETRIES APPLIED
18 02 DRO RECOVERED DATA - THE DATA WAS AUTO-REALLOCATED
18 03 R RECOVERED DATA WITH CIRC
18 04 R RECOVERED DATA WITH L-EC
18 05 DRO RECOVERED DATA - RECOMMEND REASSIGNMENT
18 06 DRO RECOVERED DATA - RECOMMEND REWRITE
1A 00 DROM PARAMETER LIST LENGTH ERROR
20 00 DROM INVALID COMMAND OPERATION CODE
21 00 DROM LOGICAL BLOCK ADDRESS OUT OF RANGE
24 00 DROM INVALID FIELD IN COMMAND PACKET
26 00 DROM INVALID FIELD IN PARAMETER LIST
26 01 DROM PARAMETER NOT SUPPORTED
26 02 DROM PARAMETER VALUE INVALID

Table 125 - ASC and ASCQ Assignments

Page 158 working draft ATAPI


ATAPI CD-ROM Specification
REQUEST SENSE Command

ASC ASCQ DROM DESCRIPTION


26 03 DROM THRESHOLD PARAMETERS NOT SUPPORTED
28 00 DROM NOT READY TO READY TRANSITION, MEDIUM MAY HAVE CHANGED
29 00 DROM POWER ON, RESET OR BUS DEVICE RESET OCCURRED
2A 00 DROM PARAMETERS CHANGED
2A 01 DROM MODE PARAMETERS CHANGED

nl t
30 00 DROM INCOMPATIBLE MEDIUM INSTALLED

O raf
30 02 DRO CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
30 01 DRO CANNOT READ MEDIUM - UNKNOWN FORMAT
37 00 DROM ROUNDED PARAMETER

w D
39 00 DROM SAVING PARAMETERS NOT SUPPORTED

y
3A 00 DROM MEDIUM NOT PRESENT
3F 00 DROM ATAPI CD-ROM DRIVE OPERATING CONDITIONS HAVE CHANGED
3F 01 DROM MICROCODE HAS BEEN CHANGED

ie ry
3F 02 DROM CHANGED OPERATING DEFINITION
3F 03 DROM INQUIRY DATA HAS CHANGED
ev a
40 NN DROM DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH)
44 00 DROM INTERNAL ATAPI CD-ROM DRIVE FAILURE
n
4E 00 DROM OVERLAPPED COMMANDS ATTEMPTED
53 00 DROM MEDIA LOAD OR EJECT FAILED
i
53 02 DROM MEDIUM REMOVAL PREVENTED
rR m

57 00 R UNABLE TO RECOVER TABLE OF CONTENTS


5C 00 DO STATUS CHANGE
fo eli

5A 00 DROM OPERATOR REQUEST OR STATE CHANGE INPUT (UNSPECIFIED)


5A 01 DROM OPERATOR MEDIUM REMOVAL REQUEST
5B 01 DROM THRESHOLD CONDITION MET
63 00 R END OF USER AREA ENCOUNTERED ON THIS TRACK
Pr

64 00 R ILLEGAL MODE FOR THIS TRACK


BF 00 R LOSS OF STREAMING
80h XXh THROUGH FFh XX Vendor-specific.
XXh 80h THROUGH XXh DDh Vendor-specific QUALIFICATION OF STANDARD ASC.
ALL CODES NOT SHOWN ARE RESERVED.

Table 125 - ASC and ASCQ Assignments

Table 126 - Recommended Sense Key, ASC and ASCQ for Request Sense Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED

working draft ATAPI Page 159


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm REQUEST SENSE Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 160 working draft ATAPI


ATAPI CD-ROM Specification
REZERO UNIT Command

9.8.22 REZERO UNIT Command

The REZERO UNIT command requests that the ATAPI CD-ROM Drive set the Device to a specific state.

Table 127 - REZERO UNIT Command

nl t
O raf
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (01h)
1 Reserved

w D
2 Reserved

y
3 Reserved
4 Reserved

ie ry
5 Reserved
6 Reserved
7 Reserved
ev a
8 Reserved
9 Reserved
n
10 Reserved
11 Reserved
i
rR m
fo eli

Table 128 - Recommended Sense Key, ASC and ASCQ for SEEK Command Errors
Sense Key ASC ASCQ Description of Error
Pr

05 20 INVALID COMMAND OPERATION CODE


05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
03 02 NO SEEK COMPLETE

working draft ATAPI Page 161


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm REZERO UNIT Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 162 working draft ATAPI


ATAPI CD-ROM Specification
SEEK Command

9.8.23 SEEK Command

The SEEK command request that the Device seek to the specified logical block address. All Logical Block Addresses
are valid targets for a seek operation, including a CD-DA audio sector. The content of the Sector at the specified LBA
shall not affect the seek operation nor cause an error to be generated.

nl t
The SEEK Command will always be executed as an immediate command. The command will return completion stations

O raf
as soon as the seek operation has been started.

Table 129 - SEEK Command

w D
y
Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (2Bh)

ie ry
1 Reserved
2 Logical Block Address
3
ev a
4
n
5
6 Reserved
i
7 Reserved
rR m

8 Reserved
9 Reserved
10 Reserved
fo eli

11 Reserved
Pr

Table 130 - Recommended Sense Key, ASC and ASCQ for Seek Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
03 02 NO SEEK COMPLETE
05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE

working draft ATAPI Page 163


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm SEEK Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 164 working draft ATAPI


ATAPI CD-ROM Specification
SET CD-ROM SPEED Command

9.8.24 SET CD-ROM SPEED Command

The SET CD-ROM SPEED command provides a means for the Host to set the spindle speed to be used while reading
CD-ROM data. Note that the Play commands will not use the speed set by this command.

nl t
O raf
Table 131 - SET CD-ROM SPEED Command
Bit
7 6 5 4 3 2 1 0
Byte

w D
0 Operation code (BBh)

y
1 Reserved
2 (MSB) Drive Speed in Kbytes/Second
3 (LSB)

ie ry
4 Reserved
5 Reserved
ev a
6 Reserved
7 Reserved
n
8 Reserved
9 Reserved
i
10 Reserved
rR m

11 Reserved
fo eli

The Drive Speed parameter contains the requested Data Rate the drive should use. The drive may choose to select the
speed specified or any slower rate. A value of FFFFh will set the Drive Speed to the Maximum supported. Requesting a
speed faster than the drive supports will not generate an error. The actual maximum speed supported is returned in the
Pr

Capabilities Mode Sense page (See "[Link] CD-ROM Capabilities and Mechanical Status Page" on page 99.)

Table 132 - Recommended Sense Key, ASC and ASCQ for SET CD-ROM SPEED Command
Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT

working draft ATAPI Page 165


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm SET CD-ROM SPEED Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 166 working draft ATAPI


ATAPI CD-ROM Specification
STOP PLAY / SCAN CD-ROM Command

9.8.25 STOP PLAY / SCAN CD-ROM Command


The STOP PLAY/ SCAN CD-ROM Command stops playback of CD-ROM audio commands.

Table 133 - STOP PLAY / SCAN CD-ROM Command


Bit
7 6 5 4 3 2 1 0
Byte

nl t
O raf
0 Operation code (4Eh)
1 Reserved
2 Reserved
3 Reserved

w D
y
4 Reserved
5 Reserved
6 Reserved

ie ry
7 Reserved
8 Reserved
9 Reserved
ev a
10 Reserved
11 Reserved
i n
rR m

Table 134 - Recommended Sense Key, ASC and ASCQ for STOP PLAY CD-ROM Command
fo eli

Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE
Pr

05 24 INVALID FIELD IN COMMAND PACKET


06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
0B BA PLAY XA OPERATION ABORTED

Issuing a Stop Play / Scan command while the drive is scanning shall result in continuation of the play command. Issu-
ing a Stop Play / Scan command while the drive is paused shall stop the play command

working draft ATAPI Page 167


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm STOP PLAY / SCAN CD-ROM Command

IDLE

Scan Play

nl t
O raf
Stop Stop
Stop
or end or end of track
of track

Scan

w D
SCAN PLAY

y
Resume

ie ry
Pause Pause
ev a
Scan or Resume Play or Resume
n
PAUSED
i
rR m
fo eli
Pr

Figure 17 - Stop Play/Play Audio/Audio Scan/Pause/Resume Sequencing

Page 168 working draft ATAPI


ATAPI CD-ROM Specification
START/STOP UNIT Command

9.8.26 START/STOP UNIT Command


The START/STOP UNIT command requests that the ATAPI CD-ROM Drive enable or disable media access operations.

Table 135 - START/STOP UNIT Command

nl t
Bit
7 6 5 4 3 2 1 0
Byte

O raf
0 Operation code (1Bh)
1 Reserved Immed
2 Reserved

w D
3 Reserved

y
4 Reserved LoEj Start
5

ie ry
6 Reserved
7 Reserved
8 Reserved
ev a
9 Reserved
10 Reserved
n
11 Reserved
i
rR m

An immediate (Immed) bit of one indicates that status shall be returned as soon as the Command Packet has been vali-
dated. An Immed bit of zero indicates that status shall be returned after the operation is completed.
fo eli

A start bit of one requests the Device be made ready for use. A start bit of zero requests that the Device be stopped (me-
dia cannot be accessed by the Host Computer).
Pr

Table 136 - Start/Stop and Eject Operations


LoEj Start Operation to be Performed
0 0 Stop the Disc
0 1 Start the Disc and read the TOC
1 0 Eject the Disc if possible (See "Table 72 - Actions for Lock / Unlock / Eject" on page
116)
1 1 Load the Disc (Close Tray)

Any attempt to Eject or Load a Disc when the Drive does not support that capability shall result in an error condition be-
ing reported to the Host (Sense key 05 ILLEGAL REQUEST, Sense Code 24 INVALID FIELD IN COMMAND PACK-
ET.)

A load eject (LoEj) bit of zero requests that no action be taken regarding loading or ejecting the medium. A LoEj bit of
one requests that the medium be unloaded if the start bit is zero. A LoEj bit of one requests that the medium be loaded if
the start bit is one.

working draft ATAPI Page 169


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm START/STOP UNIT Command

Table 137 - Actions for Eject/Load Disc


Locked / If Drive Not Ready If Drive Ready
Operation
Unlocked (No Media) (Media Present)
Eject Unlocked No Error and Tray is opened No Error:

nl t
Media Ejects

O raf
Locked Error: Error:
02 Not ready, 53 Media Removal Prevented 02 Not ready, 53 Media Removal Prevented
Manual Eject Unlocked Tray opens (If tray exists) Media is Ejected
Locked No operation occurs No operation, Media stays locked in drive

w D
y
ie ry
Table 138 - Recommended Sense Key, ASC and ASCQ for SEEK Command Errors
Sense Key ASC ASCQ Description of Error
ev a
05 20 INVALID COMMAND OPERATION CODE
n
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
i
rR m

06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED


02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
fo eli

02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED


02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
Pr

02 30 00 INCOMPATIBLE MEDIUM INSTALLED


02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
02 3A MEDIUM NOT PRESENT
02 53 02 MEDIA REMOVAL PREVENTED
04 B6 MEDIA LOAD MECHNISM FAILED

Page 170 working draft ATAPI


ATAPI CD-ROM Specification
TEST UNIT READY Command

9.8.27 TEST UNIT READY Command


The TEST UNIT READY command provides a means to check if the Device is ready. This is not a request for a self-test.
If the Device would accept an appropriate medium-access command without returning CHECK CONDITION status,
this command shall return a GOOD status. If the Device cannot become operational or is in a state such that an Host
Computer action (e.g. START UNIT command) is required to make the unit ready, the ATAPI CD-ROM Drive shall re-
turn CHECK CONDITION status with a sense key of NOT READY.

nl t
O raf
Table 139 - Test Unit Ready Command
Bit
7 6 5 4 3 2 1 0
Byte

w D
y
0 Operation code (00h)
1 Reserved
2 Reserved

ie ry
3 Reserved
4 Reserved
ev a
5 Reserved
6 Reserved
n
7 Reserved
8 Reserved
i
9 Reserved
rR m

10 Reserved
11 Reserved
fo eli
Pr

[Link] Using the TEST UNIT READY Command


The TEST UNIT READY command is useful in that it allows a Host Computer to poll a Device until it is ready without
the need to allocate space for returned data. It is especially useful to check cartridge status. ATAPI CD-ROM Drives are
expected to respond promptly to indicate the current status of the device.

Table 140 - Recommended Sense Key, ASC and ASCQ for MODE SELECT Command Errors
Sense Key ASC ASCQ Description of Error
00 00 00 NO ADDITIONAL SENSE INFORMATION
05 20 INVALID COMMAND OPERATION CODE
05 24 INVALID FIELD IN COMMAND PACKET
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 3A MEDIUM NOT PRESENT

working draft ATAPI Page 171


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 23, 1994 2:42 pm TEST UNIT READY Command

nl t
O raf
w D
y
ie ry
ev a n
Intentionally Left Blank
i
rR m
fo eli
Pr

Page 172 working draft ATAPI


ATAPI CD-ROM Specification

10.0 Physical Interface

Digital Analog Host Interface Power


Audio Audio

nl t
C S M 39 1 4 3 2 1
2 1 4 3 2 1 S L A

O raf
40 2
GND

R GND L
DIG

Pin 20 keyed (removed) +5V GND +12V

w D
y
ie ry
Digital Analog
Audio Audio Host Interface Power
ev a
C S M
1 2 1 2 3 4 S L A 39 1 1 2 3 4
i n
GND

L GND R 40 2
DIG

rR m

+12V GND +5V


Pin 20 keyed (removed)
fo eli

Figure 18 - CD-ROM Connectors (Rear View)


Pr

10.1 CD-ROM Digital Audio Connector (Optional)


The CD-ROM Digital Audio Connector is an optional two-conductor shroud keyed header (Molex 70553 “G” or equiva-
lent) which can be used to send audio to the host in a digital serial format. The pin assignments are shown in "Figure 18
- CD-ROM Connectors (Rear View)". The logic levels on this connector are standard CMOS and shall not exceed +5%
of the 5v supply. Recommended part numbers for the mating connector to 18 AWG cable are shown, but equivalent parts
may be used.

Mating Connectors: Molex 70066 “C(No Latch)” or “G(Latch)”, 70400 “C” or “G” and 70430 “C” or “G” or equivalent.

The serial format of the audio data is defined in EIAJ (Electronic Industry Association of Japan) document IEC-958.
IEC-958 has two parts. One is for professional use that is similar to the AES/EBU(Audio Engineering Society / European
Broadcast Union). The other part is for consumer use and is the same as the Sony/Philips Digital Signal format. When re-
ferring to EIAJ, specify which part is supported.

10.2 CD-ROM Analog Audio Connector (Optional)


The CD-ROM Analog Audio Connector is an optional four-conductor shroud keyed header (Molex 70553 “G” or equiva-
lent) which can be used to send audio to the host in an analog format. The pin assignments are shown in "Figure 18 - CD-
ROM Connectors (Rear View)". The analog voltage levels on this connector shall not exceed 1.0V RMS. Recommended
part numbers for the mating connector to 18 AWG cable are shown, but equivalent parts may be used.

Mating Connectors: Molex 70066 “C(No Latch)” or “G(Latch)”, 70400 “C” or “G” and 70430 “C” or “G” or equivalent.

working draft ATAPI Page 173


Revision 1.2 ATAPI Packet Commands for CD-ROM devices
February 24, 1994 1:50 pm

10.3 Device Configuration Jumper (Optional)


The device configuration jumper is a 6-pin, unshrouded header (Molex 70203 or equivalent) as shown in "Figure 18 -
CD-ROM Connectors (Rear View)" with three marked positions (BY, SL, and MA). When a shorting jumper is placed in
the “BY” (Bypass CSEL) position the device shall use the “MA” (Master) or “SL” (Slave) jumper positions to configure
the device. When the “BY” jumper is removed and placed such that both “SL” and “MA” are jumpered, the device shall
use the host interface signal CSEL to configure the device. The device configuration jumpers shall be accessible from the

nl t
rear of the drive.

O raf
C S M C S M C S M C S M
S L A S L A S L A S L A

w D
Drive CSEL

y
Use CSEL Master Slave

ie ry
ev a Cable CSEL Gnd Vcc
n
Figure 19 - Device Configuration Jumper
i
rR m

10.4 Host IDE Interface Connector


fo eli

The I/O connector is a 40-pin connector as shown in Figure 4 (ATA specification), with pin assignments as shown in Ta-
ble 4 (ATA specification). The connector should be keyed to prevent the possibility of installing it upside down. A key is
provided by the removal of pin 20. The corresponding pin on the cable connector should be plugged.
Pr

The pin locations are governed by the cable plug, not the receptacle. The way in which the receptacle is mounted on the
printed circuit board affects the pin positions, and pin 1 should remain in the same relative position. This means the pin
numbers of the receptacle may not reflect the conductor number of the plug. The header receptacle is not polarized, and
all the signals are relative to pin 20, which is keyed.

By using the plug positions as primary, a straight cable can connect drives. As shown in Figure 4 (ATA specification,
conductor 1 on pin 1 of the plug has to be in the same relative position no matter what the receptacle numbering looks
like. If receptacle numbering was followed, the cable would have to twist 180 degrees between a drive with top-mounted
receptacles, and a drive with bottom-mounted receptacles.

10.5 Power Connector


The power connector is a four-conductor male plug. The pin assignments are shown in "Figure 18 - CD-ROM Connec-
tors (Rear View)". Recommended part numbers for the mating connector to 28 AWG cable are shown below, but equiva-
lent parts may be used.

Connector (4-pin): AMP 1-480424-0 or equivalent.


Contacts (loose piece): AMP 60619-4 or equivalent.
Contacts (strip): AMP 61117-4 or equivalent.

Page 174 working draft ATAPI


ATAPI CD-ROM Specification

Annex A Vendor Identification


This annex contains the list of vendor identifications as of the date of this document. The purpose of this list is to help
avoid redundant usage of vendor identifications. Task Group X3T9.2 of Accredited Standards Committee X3 maintains
an informal list of vendor identifications currently in use. Please contact the chairman of X3T9.2 prior to using a new
vendor identification to avoid conflicts.

Table 141 - Vendor Identification List


ID Organization
3M 3M Company
ADAPTEC Adaptec
ACL Automated Cartridge Librarys, Inc.
ADSI Adaptive Data Systems, Inc. (a Western Digital subsidiary)
AMCODYNE Amcodyne
ANAMATIC Anamartic Limited (England)
ANCOT ANCOT Corp.
ANRITSU Anritsu Corporation
APPLE Apple Computer, Inc.
ARCHIVE Archive
ASACA ASACA Corporation
ASPEN Aspen Peripherals
AST AST Research
ASTK Alcatel STK A/S
AT&T AT&T
ATARI Atari Corporation
ATTO ATTO Technology Inc.
ATX Alphatronix
AVR Advanced Vision Research
BALLARD Ballard Synergy Corp.
BERGSWD Berg Software Design
BEZIER Bezier Systems, Inc.
BULL Bull Peripherals Corp.
CalComp CalComp, A Lockheed Company
CALIPER Caliper (California Peripheral Corp.)
CAST Advanced Storage Tech
CDC Control Data or MPI
CDP Columbia Data Products
CHEROKEE Cherokee Data Systems
CIE&YED YE Data, [Link] Electric Corp.
CHINON Chinon
CIPHER Cipher Data Products
Ciprico Ciprico, Inc.
CMD CMD Technology
CNGR SFW Congruent Software, Inc.
COGITO Cogito
COMPORT Comport Corp.
COMPSIG Computer Signal Corporation
CONNER Conner Peripherals
CREO CREO Products Inc.

working draft ATAPI Page 175


Revision 1.2
February 24, 1994 2:16 pm

Table 141 - Vendor Identification List


ID Organization
CROSFLD Crosfield Electronics
CSM, INC Computer SM, Inc.
CYGNET Cygnet Systems, Inc.

nl t
DATABOOK Databook, Inc.

O raf
DATACOPY Datacopy Corp.
DATAPT Datapoint Corp.
DEC Digital Equipment
DELPHI Delphi Data Div. of Sparks Industries, Inc.

w D
y
DENON Denon/Nippon Columbia
DEST DEST Corp.
DGC Data General Corp.

ie ry
DIGIDATA Digi-Data Corporation
DILOG Distributed Logic Corp.
DISC Document Imaging Systems Corp.
ev a
DPT Distributed Processing Technology
DSM Deterner Steuerungs- und Maschinenbau GmbH & Co.
n
DTC QUME Data Technology Qume
DXIMAGIN DX Imaging
i
rR m

EMULEX Emulex
EPSON Epson
EXABYTE Exabyte Corp.
fo eli

FILENET FileNet Corp.


FUJI Fuji Electric Co., Ltd. (Japan)
FUJITSU Fujitsu
Pr

FUTURED Future Domain Corp.


GEN_DYN General Dynamics
GIGATAPE GIGATAPE GmbH
GIGATRND GigaTrend Incorporated
Goidelic Goidelic Precision, Inc.
GOULD Gould
HITACHI Hitachi America Ltd or Nissei Sangyo America Ltd
HONEYWEL Honeywell Inc.
HP Hewlett Packard
IBM International Business Machines
ICL ICL
IDE International Data Engineering, Inc.
IGR Intergraph Corp.
IMPLTD Integrated Micro Products Ltd.
IMPRIMIS Imprimis Technology Inc.
IOC I/O Concepts, Inc.
INSITE Insite Peripherals
IOMEGA Iomega
ISi Information Storage inc.
ITC International Tapetronics Corporation
JVC JVC Information Products Co.
KENNEDY Kennedy Company
KODAK Eastman Kodak

Page 176 working draft ATAPI


ATAPI CD-ROM Specification

Table 141 - Vendor Identification List


ID Organization
KONAN Konan
KONICA Konica Japan
LAPINE Lapine Technology
LASERDRV LaserDrive Limited
LASERGR Lasergraphics, Inc.
LMS Laser Magnetic Storage International Company
MATSHITA Matsushita
MAXTOR Maxtor Corp.
MaxOptix Maxoptix Corp.
MDI Micro Design International, Inc.
MELA Mitsubishi Electronics America
MELCO Mitsubishi Electric (Japan)
MEMREL Memrel Corporation
MEMTECH MemTech Technology
MICROBTX Microbotics Inc.
MICROP Micropolis
MICROTEK Microtek Storage Corp
MINSCRIB Miniscribe
MITSUMI MITSUMI Electric Co., Ltd.
MOTOROLA Motorola
MST Morning Star Technologies, Inc.
NAI North Atlantic Industries
NatInst National Instruments
NatSemi National Semiconductor Corp.
NCL NCL America
NCR NCR Corporation
NEC NEC
NISCA NISCA Inc.
OCE Oce Graphics
OMI Optical Media International
OMNIS OMNIS Company (FRANCE)
OPTIMEM Cipher/Optimem
OPTOTECH Optotech
ORCA Orca Technology
OSI Optical Storage International
OTL OTL Engineering
PERTEC Pertec Peripherals Corporation
PFTI Performance Technology Inc.
PIONEER Pioneer Electronic Corp.
PRAIRIE PrairieTek
PRESOFT PreSoft Architects
PRESTON Preston Scientific
PRIAM Priam
PRIMAGFX Primagraphics Ltd
PTI Peripheral Technology Inc.
QUALSTAR Qualstar
QUANTEL Quantel Ltd.

working draft ATAPI Page 177


Revision 1.2
February 24, 1994 2:16 pm

Table 141 - Vendor Identification List


ID Organization
QUANTUM Quantum Corp.
R-BYTE R-Byte Inc.
RADSTONE Radstone Technology

nl t
RGI Raster Graphics, Inc.

O raf
RICOH Ricoh
RODIME Rodime
RTI Reference Technology
SANKYO Sankyo Seiki

w D
y
SANYO SANYO Electric Co., Ltd.
SCREEN Dainippon Screen Mfg. Co., Ltd.
SEAGATE Seagate

ie ry
SEQUOIA Sequoia Advanced Technologies, Inc.
Shinko Shinko Electric Co., Ltd.
SIEMENS Siemens
ev a
SII Seiko Instruments Inc.
SMS Scientific Micro Systems/OMTI
n
SONIC Sonic Solutions
SONY Sony Corporation Japan
i
rR m

SPECTRA Spectra Logic, a Division of Western Automation Labs, Inc.


SPERRY Sperry (now Unisys Corp.)
STK Storage Technology Corporation
fo eli

SUMITOMO Sumitomo Electric Industries, Ltd.


SUN Sun Microsystems, Inc.
SNYSIDE Sunnyside Computing Inc.
Pr

SyQuest SyQuest Technology, Inc.


SYSGEN Sysgen
T-MITTON Transmitton England
TALLGRAS Tallgrass Technologies
TALARIS Talaris Systems, Inc.
TANDBERG Tandberg Data A/S
TANDON Tandon
TEAC TEAC Japan
TECOLOTE Techolote Designs
Tek Tektronix
TI-DSG Texas Instruments
TOSHIBA Toshiba Japan
ULTRA UltraStor Corporation
UNISYS Unisys
USDC US Design Corp.
VERBATIM Verbatim Corporation
VRC Vermont Research Corp.
WangDAT WangDAT
WANGTEK Wangtek
WEARNES Wearnes Technology Corporation
WDIGTL Western Digital
XEBEC Xebec Corporation

Page 178 working draft ATAPI


ATAPI CD-ROM Specification

Annex B CD-ROM XA

B.1 ATAPI XA Packet Commands for CD-ROM Devices

B.1.1 PLAY CD-ROM XA Command

Table 142 - PLAY CD-ROM XA (12) Command


Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (BDh)
1 Reserved
2 Starting Logical Block Address
3
4
5
6 Transfer Length
7
8
9
10 File Number
11 Reserved

Since Mode2 XA file system can retrieve data in real-time manner, it is called a “PLAY” when retrieving the real-time
file system. The real-time file has a real time bit in the subheader / submode field of each of the sectors. (See CD-ROM
XA Chap II, 4.3 System Description)

PLAY XA sends 2340 Bytes/Sector data (Header (4) + Subheader (9) + UserData (2324 or 2048) + Spare (4) or
EDC&ECC (280)) or 12 bytes of data (Header + Subheader (8)) in real-time manner to the system, in the following man-
ner:
1. If the sector has the specified file number, goto (2).
2. The sector has the specified channel number (by channel mask), goto (3).

3. If the sector has empty sector type (not Audio, not Video, not Data), goto (6), otherwise goto (4).

4. If the sector has a data type of Video or Data, goto (7), otherwise goto (5).

5. If the sector has Audio data type and it is linked to the appropriate ADPCM decoder, the sector will be decoded
automatically. Goto (6), otherwise goto (7).

6. Drive sends 12 bytes (header (4) + SubHeader (8)) to the system.

Drive sends 2340 bytes (Header (4) + SubHeader (8) + UserData (2324 or 2048) + Spare (4) or EDC&ECC (280))

working draft ATAPI Page 179


Revision 1.2
February 24, 1994 2:16 pm ATAPI XA Packet Commands for CD-ROM Devices

Table 143 - Recommended Sense Key, ASC and ASCQ for PLAY CD-ROM XA (12) Command
Errors
Sense
ASC ASCQ Description of Error
Key

nl t
05 20 INVALID COMMAND OPERATION CODE

O raf
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED

w D
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE

y
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED

ie ry
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED
02 06 00 NO REFERENCE POSITION FOUND (media may be upside down)
02 30 00 INCOMPATIBLE MEDIUM INSTALLED
ev a
02 30 01 CANNOT READ MEDIUM - UNKNOWN FORMAT
02 30 02 CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
n
02 3A MEDIUM NOT PRESENT
i
03 02 NO SEEK COMPLETE
rR m

05 21 LOGICAL BLOCK ADDRESS OUT OF RANGE


05 54 ILLEGAL MODE FOR THIS TRACK
03 11 05 L-EC UNCORRECTABLE ERROR
fo eli

03 11 06 CIRC UNRECOVERED ERROR


05 BF 00 BUFFER OVERFLOW a
Pr

a. If the PLAY CD-ROM XA Command fails to transfer a block of data to the Host in 13.3 Ms (1/75 s), the ATAPI
CD-ROM shall terminate the PLAY CD-ROM XA Command with CHECK CONDITION, the sense key shall
be set to ILLEGAL REQUEST, and the additional sense code set to BUFFER OVERFLOW.

Page 180 working draft ATAPI


ATAPI CD-ROM Specification

B.1.2 SEND CD-ROM XA DATA (12) Command


The SEND CD-ROM XA DATA Command sends XA data from the Host to the CD-ROM drive. This command is ini-
tially intended to provide the host with the ability to play audio through the CD-ROMs stereo ADPCM decoder thereby
eliminating the need for separate sound boards in CD-ROM based multi-medi systems. Future extensions may include
the ability for the Host to send video to ATAPI CDI-ROM drives in XA format.

Table 144 - SEND CD-ROM XA DATA (12) Command


Bit
7 6 5 4 3 2 1 0
Byte
0 Operation code (BCh)
1 Reserved
2 Reserved
3 Reserved
4 Reserved
5 Reserved
6 Reserved
7 Reserved
8 Reserved
9 Reserved
10 Reserved
11 Reserved

The user can play back ADPCM data from the Host to the ADPCM Decoder in the following manner:
1. Issue XA Control Mode Page Format, setting the Audio Channel Number to 0x80.
2. If ADPCM Decoder Status/ADPCM Buffer Status is one, issue the SEND ADPCM DATA Command.

3. When the interrupt requests “Data from Host to Drive,” send the data to the drive.

4. Goto (2).

File Number
Channel Number
Sub Mode
2328 Bytes
Coding Information
First Audio Byte
2324 Bytes

Last Audio Byte

File format for Send Audio is identical to XA data with the addition of a file and channel number to the header informa-
tion. EOF in the header is end of file for all channels in this file, I.E. the end of this command.

working draft ATAPI Page 181


Revision 1.2
February 24, 1994 2:16 pm ATAPI XA Packet Commands for CD-ROM Devices

Table 145 - Recommended Sense Key, ASC and ASCQ for SEND CD-ROM XA ADPCM DATA
Command Errors
Sense Key ASC ASCQ Description of Error
05 20 INVALID COMMAND OPERATION CODE

nl t
O raf
05 24 INVALID FIELD IN COMMAND PACKET
06 28 NOT READY TO READY TRANSITION
06 29 POWER ON, RESET OR BUS DEVICE RESET OCCURRED
02 04 00 LOGICAL UNIT NOT READY - CAUSE NOT REPORTABLE

w D
y
02 04 01 LOGICAL UNIT NOT READY - IN PROGRESS OF BECOMING READY
02 04 02 LOGICAL UNIT NOT READY - INITIALIZING COMMAND REQUIRED
02 04 03 LOGICAL UNIT NOT READY - MANUAL INTERVENTION REQUIRED

ie ry
02 BB ev a ADPCM DATA BUFFER NOT READY
i n
rR m
fo eli
Pr

Page 182 working draft ATAPI


ATAPI CD-ROM Specification

Annex C Connectors

C.1 Connectors / Jumpers

working draft ATAPI Page 183


Revision 1.2
February 24, 1994 2:16 pm Connectors / Jumpers

nl t
O raf
w D
y
ie ry
ev a i n
rR m
fo eli
Pr

Page 184 working draft ATAPI


ATAPI CD-ROM Specification

working draft ATAPI Page 185


Revision 1.2
February 24, 1994 2:16 pm Connectors / Jumpers

nl t
O raf
w D
y
ie ry
ev a i n
rR m
fo eli
Pr

Page 186 working draft ATAPI

You might also like