xref: /freebsd/share/man/man4/cd.4 (revision 2460bdf04b0eb93f70841c7063e443fdf5f31adb)
1db35f309SDavid Greenman.Dd August 27, 1993
2db35f309SDavid Greenman.Dt CD 4
3db35f309SDavid Greenman.Os FreeBSD
4db35f309SDavid Greenman.Sh NAME
5db35f309SDavid Greenman.Nm cd
6db35f309SDavid Greenman.Nd scsi cdrom driver
7db35f309SDavid Greenman.Sh SYNOPSIS
82460bdf0SPeter Dufault.Nm device cd
92460bdf0SPeter Dufault.Nm device cd1 target 4 lun 0
10db35f309SDavid Greenman.Sh DESCRIPTION
11db35f309SDavid GreenmanThe
12db35f309SDavid Greenman.Xr cd
13db35f309SDavid Greenmandriver provides support for a
14db35f309SDavid Greenman.Em scsi
15db35f309SDavid Greenmancdrom. It allows the cdrom
16db35f309SDavid Greenmanto be divided up into a set of pseudo devices called
17db35f309SDavid Greenman.Em partitions.
18db35f309SDavid GreenmanIn an attempt to look like regular disks the
19db35f309SDavid Greenman.Nm
20db35f309SDavid Greenmandriver synthesises a partition table, with one partition covering the entire
21db35f309SDavid Greenmancdrom. A user might (for some amazing reason) add another partition to the
22db35f309SDavid Greenmancdrom by using disklabel, but it will last only until the cdrom is unmounted.
23db35f309SDavid GreenmanA Partition can have both a
24db35f309SDavid Greenman.Em raw
25db35f309SDavid Greenmaninterface
26db35f309SDavid Greenmanand a
27db35f309SDavid Greenman.Em Block mode
28db35f309SDavid Greenmaninterface.
29db35f309SDavid GreenmanIn general the interfaces are similar to those described by
30db35f309SDavid Greenman.Xr wd 4
31db35f309SDavid Greenmanor
32db35f309SDavid Greenman.Xr sd 4 .
33db35f309SDavid Greenman
34db35f309SDavid Greenman.Pp
35db35f309SDavid GreenmanWhere the
36db35f309SDavid Greenman.Xr wd 4
37db35f309SDavid Greenmandevice has a fairly low level interface to the system,
38db35f309SDavid Greenman.Em SCSI
39db35f309SDavid Greenmandevices have a much higher level interface and talk to the system via
40db35f309SDavid Greenmana
41db35f309SDavid Greenman.Em SCSI Adapter
42db35f309SDavid Greenmanand a
43db35f309SDavid Greenman.Em Scsi Adapter driver
44db35f309SDavid Greenmane.g.
45db35f309SDavid Greenman.Xr AHA1542 .
46db35f309SDavid GreenmanA scsi adapter must also be separatly configured into the system
47db35f309SDavid Greenmanbefore a scsi cdrom can be configured.
48db35f309SDavid Greenman.Pp
49db35f309SDavid GreenmanAs the scsi adapter is probed during boot, the
50db35f309SDavid Greenman.Em SCSI
51db35f309SDavid Greenmanbus is scanned for devices. Any devices found which answer as 'Readonly'
52db35f309SDavid Greenmantype devices will be 'attached' to the
53db35f309SDavid Greenman.Nm
542460bdf0SPeter Dufaultdriver.
552460bdf0SPeter DufaultIn FreeBSD releases prior to 2.1, the first found will be attached as
56db35f309SDavid Greenman.Em cd0
57db35f309SDavid Greenmanand the next,
58db35f309SDavid Greenman.Em cd1
59db35f309SDavid Greenmanetc.
602460bdf0SPeter DufaultBeginning in 2.1 it is possible to specify what cd unit a device should
612460bdf0SPeter Dufaultcome on line as; refer to
622460bdf0SPeter Dufault.Xr scsi 4
632460bdf0SPeter Dufaultfor details on kernel configuration.
64db35f309SDavid Greenman.Pp
65db35f309SDavid GreenmanThe system utility
66db35f309SDavid Greenman.Xr disklabel 1
67db35f309SDavid Greenmanmay be used to read the synthesized
68db35f309SDavid Greenman.Xr disklabel 5
69db35f309SDavid Greenmanstructure, which will contain correct figures for the size of the cdrom
70db35f309SDavid Greenmanshould that information be required.
71db35f309SDavid Greenman.Pp
72db35f309SDavid Greenman.Sh KERNEL CONFIGURATION
73db35f309SDavid GreenmanAny number of cdroms may be attached to the system regardless of system
74db35f309SDavid Greenmanconfiguration as all resources are dynamically allocated.
75db35f309SDavid Greenman
76db35f309SDavid Greenman.Pp
77db35f309SDavid Greenman.Sh IOCTLS
78db35f309SDavid GreenmanThe following
79db35f309SDavid Greenman.Xr ioctl 2
80db35f309SDavid Greenmancalls apply to scsi cdroms
81db35f309SDavid Greenmanin the header files
82db35f309SDavid Greenman.Em sys/cdio.h.
83db35f309SDavid Greenmanand
84db35f309SDavid Greenman.Em sys/disklabel.h
85db35f309SDavid Greenman
86db35f309SDavid Greenman.Bl -tag -width CDIOCPLAYAUDIO____
87db35f309SDavid Greenman
88db35f309SDavid Greenman.It Dv DIOCGDINFO
89db35f309SDavid GreenmanRead, from the kernel, the in-core copy of the disklabel for the
90db35f309SDavid Greenmandrive. This will be a ficticious disklabel it will contain information
91db35f309SDavid Greenmanread from the scsi inquiry commands, and should be the same as
92db35f309SDavid Greenmanthe information printed at boot.
93db35f309SDavid Greenman.It Dv DIOCSDINFO
94db35f309SDavid GreenmanGive the driver a new disklabel to use. The driver will NOT try write the new
95db35f309SDavid Greenmandisklabel to the disk. (ok?)
96db35f309SDavid Greenman.It CDIOCPLAYTRACKS
97db35f309SDavid GreenmanStart Audio playback given a track address and length.
98db35f309SDavid Greenman.It CDIOCPLAYBLOCKS
99db35f309SDavid GreenmanStart Audio playback given a block address and length.
100db35f309SDavid Greenman.It CDIOCPLAYMSF
101db35f309SDavid GreenmanStart Audio playback given a 'Minutes/ seconds/ frames' address and length.
102db35f309SDavid Greenman.It CDIOCREADSUBCHANNEL
103db35f309SDavid GreenmanRead information from the subchannel at the location specified.
104db35f309SDavid Greenman.It CDIOREADTOCHEADER
105db35f309SDavid GreenmanReturn summary information about the table of contents for the mounted cdrom.
106db35f309SDavid Greenman.It CDIOREADTOCENTRYS
107db35f309SDavid GreenmanReturn information from the table of contents entries mentionned.
108db35f309SDavid Greenman.It CDIOCSETPATCH
109db35f309SDavid GreenmanAttach various audio channels to various output channels.
110db35f309SDavid Greenman.It CDIOCGETVOL
111db35f309SDavid GreenmanGet information about the volume settings of the output channels.
112db35f309SDavid Greenman.It CDIOCSETVOL
113db35f309SDavid GreenmanChange the volume settings of the output channels.
114db35f309SDavid Greenman.It CDIOCSETMONO
115db35f309SDavid GreenmanPatch all out[put channels to all source channels.
116db35f309SDavid Greenman.It CDIOCSETSTERIO
117db35f309SDavid GreenmanPatch left source channel to the left output channel and the right
118db35f309SDavid Greenmansource channel to the right output channel.
119db35f309SDavid Greenman.It CDIOCSETMUTE
120db35f309SDavid GreenmanMute output without changing the volume settings.
121db35f309SDavid Greenman.It CDIOCSETLEFT
122db35f309SDavid GreenmanAttach both output channels to the left source channel.
123db35f309SDavid Greenman.It CDIOCSETRIGHT
124db35f309SDavid GreenmanAttach both output channels to the right source channel.
125db35f309SDavid Greenman.It CDIOCSETDEBUG
126db35f309SDavid GreenmanTurn on debugging for the appropriate device.
127db35f309SDavid Greenman.It CDIOCCLRDEBUG
128db35f309SDavid GreenmanTurn off debugging for the appropriate device.
129db35f309SDavid Greenman.It CDIOCPAUSE
130db35f309SDavid GreenmanPause audio play, do not reset the location of the read-head.
131db35f309SDavid Greenman.It CDIOCRESUME
132db35f309SDavid GreenmanResume audio play, Start at the location of the pause.
133db35f309SDavid Greenman.It CDIOCRESET
134db35f309SDavid GreenmanReset the drive.
135db35f309SDavid Greenman.It CDIOCSTART
136db35f309SDavid GreenmanTell the drive to spin-up the cdrom.
137db35f309SDavid Greenman.It CDIOCSTOP
138db35f309SDavid GreenmanTell the drive to spin-down the cdrom.
139db35f309SDavid Greenman.It CDIOCEJECT
140db35f309SDavid GreenmanEject the cdrom.
141db35f309SDavid Greenman.El
142db35f309SDavid Greenman.Pp
143db35f309SDavid GreenmanIn addition the general
144db35f309SDavid Greenman.Xr scsi 4
145db35f309SDavid Greenmanioctls may be used with the
146db35f309SDavid Greenman.Nm
147db35f309SDavid Greenmandriver, if used against the fourth (raw/whole disk) partiton. (e.g. rcd0d)
148db35f309SDavid Greenman.Sh NOTES
149db35f309SDavid GreenmanWhen a cdrom is changed in a drive controlled by the
150db35f309SDavid Greenman.Nm
151db35f309SDavid Greenmandriver, then the act of changing the media will invalidate the
152db35f309SDavid Greenmandisklabel and information held within the kernel. To stop corruption,
153db35f309SDavid GreenmanAll accesses to the device will be discarded until there are no more
154db35f309SDavid Greenmanopen file descriptors referencing the device. During this period, all
155db35f309SDavid Greenmannew open attempts will be rejected. When No more open file descriptors
156db35f309SDavid Greenmanreference the device, the first next open will load a new set of
157db35f309SDavid Greenmanfigures (including disklabel) for the drive.
158db35f309SDavid Greenman
159db35f309SDavid GreenmanThe Audio code in the
160db35f309SDavid Greenman.Nm
161db35f309SDavid Greenmandriver only support SCSI2 standard audio commands. As there are many cdrom
162db35f309SDavid Greenmanmanufacturers who have not followed the standard well, there are many
163db35f309SDavid Greenmancdroms for which audio will not work. Some work is planned to support
164db35f309SDavid Greenmansome of the more common 'broken' cdrom drives however this is not yet
165db35f309SDavid Greenmanunder way.
166db35f309SDavid Greenman
167db35f309SDavid Greenman.Sh FILES
168db35f309SDavid Greenman.Bl -tag -width /dev/rcd[0-9][a-h] -compact
169db35f309SDavid Greenman.It Pa /dev/cd[0-9][a-h]
170db35f309SDavid Greenmanblock mode scsi disks
171db35f309SDavid Greenman.It Pa /dev/rcd[0-9][a-h]
172db35f309SDavid Greenmanraw scsi disks
173db35f309SDavid Greenman.El
174db35f309SDavid Greenman.Sh DIAGNOSTICS
175db35f309SDavid GreenmanNone.
176db35f309SDavid Greenman.Sh SEE ALSO
177db35f309SDavid Greenman.Xr disklabel 1
178db35f309SDavid Greenman.Xr disklabel 5
179db35f309SDavid Greenman.Xr wd 4
180db35f309SDavid Greenman.Xr sd 4
181db35f309SDavid Greenman.Sh HISTORY
182db35f309SDavid GreenmanThis
183db35f309SDavid Greenman.Nm
184db35f309SDavid Greenmandriver appeared in 386BSD 0.1.
185