Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / wormcontrol / wormcontrol.8
1 .\" 
2 .\" Copyright (C) 1996
3 .\"   interface business GmbH
4 .\"   Tolkewitzer Strasse 49
5 .\"   D-01277 Dresden
6 .\"   F.R. Germany
7 .\"
8 .\" All rights reserved.
9 .\"
10 .\" Written by Joerg Wunsch <joerg_wunsch@interface-business.de>
11 .\"
12 .\" 
13 .\" Redistribution and use in source and binary forms, with or without
14 .\" modification, are permitted provided that the following conditions
15 .\" are met:
16 .\" 1. Redistributions of source code must retain the above copyright
17 .\"    notice, this list of conditions and the following disclaimer.
18 .\" 2. Redistributions in binary form must reproduce the above copyright
19 .\"    notice, this list of conditions and the following disclaimer in the
20 .\"    documentation and/or other materials provided with the distribution.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY
23 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28 .\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
32 .\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
33 .\" DAMAGE.
34 .\"
35 .\" $FreeBSD: src/usr.sbin/wormcontrol/wormcontrol.8,v 1.14.2.1 2000/12/27 13:50:37 ru Exp $
36 .\"
37 .\" arrgh, hilit19 needs this" :-(
38 .Dd January 27, 1996
39 .Os
40 .Dt WORMCONTROL 8
41 .Sh NAME
42 .Nm wormcontrol
43 .Nd control the CD-R driver
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl f Ar device
47 .Ar command
48 .Op Ar params...
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility is used to control the behaviour of the
53 .Xr worm 4
54 driver in order to adjust various parameters of a recordable CD
55 .Pq CD-R .
56 .Pp
57 Unlike many other devices, CD-R's require a very strict handling order.
58 Prior to writing data, the speed of the drive must be selected, and
59 the drive can also be turned into a
60 .Ql dummy
61 mode, where every action is only performed with the laser turned off.
62 This way, it's possible to test whether the environment provides a
63 sufficiently high data flow rate in order to actually burn the CD-R,
64 without destroying the medium in case of a catastrophic failure.
65 .Pp
66 In order to write a new track, the drive must be told whether the new
67 track will become an audio or a data track.  Audio tracks are written
68 with a block size of 2352 bytes, while data tracks have 2048 bytes per
69 block.  For audio tracks, the driver does further need to know
70 whether the data are recorded with a preemphasis.
71 .Pp
72 Once all tracks of a session have been written, the disk must be
73 .Em fixated .
74 This writes the table of contents and leadout information to the disk.
75 The disk won't be usable without doing this.
76 .Pp
77 The following options are available:
78 .Bl -tag -width ident
79 .It Fl f Ar device
80 Use
81 .Ar device
82 instead of the default
83 .Pa /dev/rworm0 .
84 .It prepdisk Ar single \&| double Op Ar dummy
85 Prepare the disk for recording.  This must be done before any tracks
86 can be prepared, and remains in effect until the session has been
87 fixated.  Either single speed
88 .Pq for audio data
89 or double speed
90 .Pq for CD-ROM data
91 must be selected, and optionally, the argument
92 .Ar dummy
93 can be used to tell the drive to keep the laser turned off, for testing.
94 .It track Ar audio \&| data Op Ar preemp
95 Inform the driver about the format of the next track.  Either
96 .Ar audio
97 or
98 .Ar data
99 .Pq CD-ROM
100 must be selected, with an optional argument
101 .Ar preemp
102 that must be specified for an audio track where data records with
103 preemphasis are being used.  Once this command has been successfully
104 specified, the track is ready for being written.
105 .It fixate Ar toc-type Op Ar onp
106 Once all tracks have been written, this closes the current session.
107 The argument
108 .Ar toc-type
109 is a single digit between 0 and 4, with the following meaning:
110 .Bl -item
111 .It
112 0     CD audio
113 .It
114 1     CD-ROM
115 .It
116 2     CD-ROM with first track in mode 1
117 .It
118 3     CD-ROM with first track in mode 2
119 .It
120 4     CDI
121 .El
122 .Pp
123 The optional argument
124 .Ar onp
125 stands for
126 .Dq open next program area ,
127 which means that the next session on the CD-R will be opened and can
128 be recorded in the future.  Otherwise, the CD-R will be closed and
129 remains unchangeable.
130 .It blank 
131 Blank a CD-RW disk.
132 .It nextwriteable
133 Sets the next writeable location on the drive, used when writing 
134 more than one track ie CD-DA (audio) disks.
135 .El
136 .Sh DIAGNOSTICS
137 Error codes for the underlying
138 .Xr ioctl 2
139 commands are printed by the
140 .Xr err 3
141 facility.
142 .Sh EXAMPLES
143 The typical sequence of burning a data CD-R looks like:
144 .Bd -literal
145 # wormcontrol prepdisk double
146 # wormcontrol track data
147 # rtprio 5 team -v 1m 5 < cdrom.image | rtprio 5 dd of=/dev/rworm0 obs=20k
148 # wormcontrol fixate 1
149 .Ed
150 .Pp
151 Note that the
152 .Xr dd 1
153 command above is mainly used in order to
154 .Dq slice
155 the data stream.  It's particularly useful when recording audio data
156 with their rather unusual blocksize.  Since the underlying device is a
157 .Em raw
158 device, the blocksize used in that command must be an integral multiple
159 of the CD-R blocksize.
160 .Pp
161 The mentioned command
162 .Xr team 1
163 is not part of the base system, but comes extremely handy in order to
164 pipe a constant data stream into the CD recorder.
165 .Sh FILES
166 .Bl -tag -width /usr/share/examples/worm/* -compact
167 .It Pa /usr/share/examples/worm/*
168 .El
169 .Sh SEE ALSO
170 .Xr dd 1 ,
171 .Xr team 1 ,
172 .Xr ioctl 2 ,
173 .Xr err 3 ,
174 .Xr worm 4
175 .Sh HISTORY
176 .Nm Wormcontrol
177 is currently under development.
178 .Sh AUTHORS
179 The program has been contributed by
180 .An J\(:org Wunsch ,
181 Dresden.