Access to a particular drive is accomplished using the sc01 device files located in /dev/[r]cdrom. Each device file identifies a particular drive based on the SCSI ID assigned to that drive. The binding between a device file and a CD-ROM drive is as follows:
Most CD-ROM drives can handle CD-ROM disks that contain two types of data: informational data and audio data. The sc01 driver allows access to both types of data.
A CD-ROM disk that contains informational data is treated as a random-access storage device, such as a hard disk. The information on the disk is divided into consecutively numbered, fixed-size (usually 2KB) sectors that can be accessed in any order. The standard tools for reading data from a random-access device, such as dd(ADM) or read(S), can be used to read informational data from a CD-ROM. However, all write operations are prohibited.
Audio commands control the operation of the drive's audio output hardware (usually a headphone jack located on the drive). For example, the C_PLAYAUDIO ioctl(S) causes the audio hardware to decode and convert the audio data to analog at a specific location on the disk, and play the audio on the drive's audio output hardware. Audio data is not returned to the host system.
All audio data commands are executed through the ioctl interface and often require a parameter structure that identifies the audio data to be acted upon. Unlike informational data, audio data is not referenced by a sector address. The methods used to identify a particular section of audio data should be described in the SCSI interface section of the reference manual supplied with your CD-ROM drive. Audio data cannot be read as if it were informational data, and informational data cannot be played using the drive's audio hardware.
Block Special File | Character Special File |
---|---|
| |
/dev/cdrom/cCbBtTlL | /dev/rcdrom/cCbBtTlL |
/dev/cdrom/cdromU | /dev/rcdrom/cdromU |
/dev/cdU | /dev/rcdU |