Merge branch 'vendor/LIBARCHIVE'
[dragonfly.git] / share / doc / smm / 02.config / 4.t
1 .\" Copyright (c) 1983, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)4.t 8.1 (Berkeley) 6/8/93
29 .\"
30 .\".ds RH "Configuration File Syntax
31 .ne 2i
32 .NH
33 CONFIGURATION FILE SYNTAX
34 .PP
35 In this section we consider the specific rules used in writing
36 a configuration file.  A complete grammar for the input language
37 can be found in Appendix A and may be of use if you should have
38 problems with syntax errors.
39 .PP
40 A configuration file is broken up into three logical pieces:
41 .IP \(bu 3
42 configuration parameters global to all system images
43 specified in the configuration file,
44 .IP \(bu 3
45 parameters specific to each
46 system image to be generated, and
47 .IP \(bu 3
48 device specifications.
49 .NH 2
50 Global configuration parameters
51 .PP
52 The global configuration parameters are the type of machine,
53 cpu types, options, timezone, system identifier, and maximum users.
54 Each is specified with a separate line in the configuration file.
55 .IP "\fBmachine\fP \fItype\fP"
56 .br
57 The system is to run on the machine type specified.  No more than
58 one machine type can appear in the configuration file.  Legal values
59 are
60 .B vax
61 and
62 \fBsun\fP.
63 .IP "\fBcpu\fP ``\fItype\fP''"
64 .br
65 This system is to run on the cpu type specified.
66 More than one cpu type specification
67 can appear in a configuration file.
68 Legal types for a
69 .B vax
70 machine are
71 \fBVAX8600\fP, \fBVAX780\fP, \fBVAX750\fP,
72 \fBVAX730\fP
73 and
74 \fBVAX630\fP (MicroVAX II).
75 The 8650 is listed as an 8600, the 785 as a 780, and a 725 as a 730.
76 .IP "\fBoptions\fP \fIoptionlist\fP"
77 .br
78 Compile the listed optional code into the system.
79 Options in this list are separated by commas.
80 Possible options are listed at the top of the generic makefile.
81 A line of the form ``options FUNNY,HAHA'' generates global ``#define''s
82 \-DFUNNY \-DHAHA in the resultant makefile.
83 An option may be given a value by following its name with ``\fB=\fP'',
84 then the value enclosed in (double) quotes.
85 The following are major options are currently in use:
86 COMPAT (include code for compatibility with 4.1BSD binaries),
87 INET (Internet communication protocols),
88 NS (Xerox NS communication protocols),
89 and
90 QUOTA (enable disk quotas).
91 Other kernel options controlling system sizes and limits
92 are listed in Appendix D;
93 options for the network are found in Appendix E.
94 There are additional options which are associated with certain
95 peripheral devices; those are listed in the Synopsis section
96 of the manual page for the device.
97 .IP "\fBmakeoptions\fP \fIoptionlist\fP"
98 .br
99 Options that are used within the system makefile
100 and evaluated by
101 .I make
102 are listed as
103 .IR makeoptions .
104 Options are listed with their values with the form
105 ``makeoptions name=value,name2=value2.''
106 The values must be enclosed in double quotes if they include numerals
107 or begin with a dash.
108 .IP "\fBtimezone\fP \fInumber\fP [ \fBdst\fP [ \fInumber\fP ] ]"
109 .br
110 Specifies the timezone used by the system.  This is measured in the
111 number of hours your timezone is west of GMT.
112 EST is 5 hours west of GMT, PST is 8.  Negative numbers
113 indicate hours east of GMT. If you specify
114 \fBdst\fP, the system will operate under daylight savings time.
115 An optional integer or floating point number may be included
116 to specify a particular daylight saving time correction algorithm;
117 the default value is 1, indicating the United States.
118 Other values are: 2 (Australian style), 3 (Western European),
119 4 (Middle European), and 5 (Eastern European).  See
120 \fIgettimeofday\fP\|(2) and \fIctime\fP\|(3) for more information.
121 .IP "\fBident\fP \fIname\fP"
122 .br
123 This system is to be known as
124 .IR name .
125 This is usually a cute name like ERNIE (short for Ernie Co-Vax) or
126 VAXWELL (for Vaxwell Smart).
127 This value is defined for use in conditional compilation,
128 and is also used to locate an optional list of source files specific
129 to this system.
130 .IP "\fBmaxusers\fP \fInumber\fP"
131 .br
132 The maximum expected number of simultaneously active user on this system is
133 .IR number .
134 This number is used to size several system data structures.
135 .NH 2
136 System image parameters
137 .PP
138 Multiple bootable images may be specified in a single configuration
139 file.  The systems will have the same global configuration parameters
140 and devices, but the location of the root file system and other
141 system specific devices may be different.  A system image is specified
142 with a ``config'' line:
143 .IP
144 \fBconfig\fP\ \fIsysname\fP\ \fIconfig-clauses\fP
145 .LP
146 The
147 .I sysname
148 field is the name given to the loaded system image; almost everyone
149 names their standard system image ``kernel''.  The configuration clauses
150 are one or more specifications indicating where the root file system
151 is located and the number and location of paging devices.
152 The device used by the system to process argument lists during
153 .IR execve (2)
154 calls may also be specified, though in practice this is almost
155 always selected by
156 .I config
157 using one of its rules for selecting default locations for
158 system devices.
159 .PP
160 A configuration clause is one of the following
161 .IP
162 .nf
163 \fBroot\fP [ \fBon\fP ] \fIroot-device\fP
164 \fBswap\fP [ \fBon\fP ] \fIswap-device\fP [ \fBand\fP \fIswap-device\fP ] ...
165 \fBdumps\fP [ \fBon\fP ] \fIdump-device\fP
166 \fBargs\fP [ \fBon\fP ] \fIarg-device\fP
167 .LP
168 (the ``on'' is optional.)  Multiple configuration clauses
169 are separated by white space;
170 .I config
171 allows specifications to be continued across multiple lines
172 by beginning the continuation line with a tab character.
173 The ``root'' clause specifies where the root file system
174 is located, the ``swap'' clause indicates swapping and paging
175 area(s), the ``dumps'' clause can be used to force system dumps
176 to be taken on a particular device, and the ``args'' clause
177 can be used to specify that argument list processing for
178 .I execve
179 should be done on a particular device.
180 .PP
181 The device names supplied in the clauses may be fully specified
182 as a device, unit, and file system partition; or underspecified
183 in which case
184 .I config
185 will use builtin rules to select default unit numbers and file
186 system partitions.  The defaulting rules are a bit complicated
187 as they are dependent on the overall system configuration.
188 For example, the swap area need not be specified at all if
189 the root device is specified; in this case the swap area is
190 placed in the ``b'' partition of the same disk where the root
191 file system is located.  Appendix B contains a complete list
192 of the defaulting rules used in selecting system configuration
193 devices.
194 .PP
195 The device names are translated to the
196 appropriate major and minor device
197 numbers on a per-machine basis.  A file,
198 ``/sys/conf/devices.machine'' (where ``machine''
199 is the machine type specified in the configuration file),
200 is used to map a device name to its major block device number.
201 The minor device number is calculated using the standard
202 disk partitioning rules: on unit 0, partition ``a'' is minor device
203 0, partition ``b'' is minor device 1, and so on; for units
204 other than 0, add 8 times the unit number to get the minor
205 device.
206 .PP
207 If the default mapping of device name to major/minor device
208 number is incorrect for your configuration, it can be replaced
209 by an explicit specification of the major/minor device.
210 This is done by substituting
211 .IP
212 \fBmajor\fP \fIx\fP \fBminor\fP \fIy\fP
213 .LP
214 where the device name would normally be found.  For example,
215 .IP
216 .nf
217 \fBconfig\fP kernel \fBroot\fP \fBon\fP \fBmajor\fP 99 \fBminor\fP 1
218 .fi
219 .PP
220 Normally, the areas configured for swap space are sized by the system
221 at boot time.  If a non-standard size is to be used for one
222 or more swap areas (less than the full partition),
223 this can also be specified.  To do this, the
224 device name specified for a swap area should have a ``size''
225 specification appended.  For example,
226 .IP
227 .nf
228 \fBconfig\fP kernel \fBroot\fP \fBon\fP hp0 \fBswap\fP \fBon\fP hp0b \fBsize\fP 1200
229 .fi
230 .LP
231 would force swapping to be done in partition ``b'' of ``hp0'' and
232 the swap partition size would be set to 1200 sectors.  A swap area
233 sized larger than the associated disk partition is trimmed to the
234 partition size.
235 .PP
236 To create a generic configuration, only the clause ``swap generic''
237 should be specified; any extra clauses will cause an error.
238 .NH 2
239 Device specifications
240 .PP
241 Each device attached to a machine must be specified
242 to
243 .I config
244 so that the system generated will know to probe for it during
245 the autoconfiguration process carried out at boot time.  Hardware
246 specified in the configuration need not actually be present on
247 the machine where the generated system is to be run.  Only the
248 hardware actually found at boot time will be used by the system.
249 .PP
250 The specification of hardware devices in the configuration file
251 parallels the interconnection hierarchy of the machine to be
252 configured.  On the VAX, this means that a configuration file must
253 indicate what MASSBUS and UNIBUS adapters are present, and to
254 which \fInexi\fP they might be connected.*
255 .FS
256 * While VAX-11/750's and VAX-11/730 do not actually have
257 nexi, the system treats them as having
258 .I "simulated nexi"
259 to simplify device configuration.
260 .FE
261 Similarly, devices
262 and controllers must be indicated as possibly being connected
263 to one or more adapters.  A device description may provide a
264 complete definition of the possible configuration parameters
265 or it may leave certain parameters undefined and make the system
266 probe for all the possible values.  The latter allows a single
267 device configuration list to match many possible physical
268 configurations.  For example, a disk may be indicated as present
269 at UNIBUS adapter 0, or at any UNIBUS adapter which the system
270 locates at boot time.  The latter scheme, termed
271 .IR wildcarding ,
272 allows more flexibility in the physical configuration of a system;
273 if a disk must be moved around for some reason, the system will
274 still locate it at the alternate location.
275 .PP
276 A device specification takes one of the following forms:
277 .IP
278 .nf
279 \fBmaster\fP \fIdevice-name\fP \fIdevice-info\fP
280 \fBcontroller\fP \fIdevice-name\fP \fIdevice-info\fP [ \fIinterrupt-spec\fP ]
281 \fBdevice\fP \fIdevice-name\fP \fIdevice-info\fP \fIinterrupt-spec\fP
282 \fBdisk\fP \fIdevice-name\fP \fIdevice-info\fP
283 \fBtape\fP \fIdevice-name\fP \fIdevice-info\fP
284 .fi
285 .LP
286 A ``master'' is a MASSBUS tape controller; a ``controller'' is a
287 disk controller, a UNIBUS tape controller, a MASSBUS adapter, or
288 a UNIBUS adapter.  A ``device'' is an autonomous device which
289 connects directly to a UNIBUS adapter (as opposed to something
290 like a disk which connects through a disk controller).  ``Disk''
291 and ``tape'' identify disk drives and tape drives connected to
292 a ``controller'' or ``master.''
293 .PP
294 The
295 .I device-name
296 is one of the standard device names, as
297 indicated in section 4 of the UNIX Programmers Manual,
298 concatenated with the
299 .I logical
300 unit number to be assigned the device (the
301 .I logical
302 unit number may be different than the
303 .I physical
304 unit number indicated on the front of something
305 like a disk; the
306 .I logical
307 unit number is used to refer to the UNIX device, not
308 the physical unit number).  For example, ``hp0'' is logical
309 unit 0 of a MASSBUS storage device, even though it might
310 be physical unit 3 on MASSBUS adapter 1.
311 .PP
312 The
313 .I device-info
314 clause specifies how the hardware is
315 connected in the interconnection hierarchy.  On the VAX,
316 UNIBUS and MASSBUS adapters are connected to the internal
317 system bus through
318 a \fInexus\fP.
319 Thus, one of the following
320 specifications would be used:
321 .IP
322 .ta 1.5i 2.5i 4.0i
323 .nf
324 \fBcontroller\fP        mba0    \fBat\fP \fBnexus\fP \fIx\fP
325 \fBcontroller\fP        uba0    \fBat\fP \fBnexus\fP \fIx\fP
326 .fi
327 .LP
328 To tie a controller to a specific nexus, ``x'' would be supplied
329 as the number of that nexus; otherwise ``x'' may be specified as
330 ``?'', in which
331 case the system will probe all nexi present looking
332 for the specified controller.
333 .PP
334 The remaining interconnections on the VAX are:
335 .IP \(bu 3
336 a controller
337 may be connected to another controller (e.g. a disk controller attached
338 to a UNIBUS adapter),
339 .IP \(bu 3
340 a master is always attached to a controller (a MASSBUS adapter),
341 .IP \(bu 3
342 a tape is always attached to a master (for MASSBUS
343 tape drives),
344 .IP \(bu 3
345 a disk is always attached to a controller, and
346 .IP \(bu 3
347 devices
348 are always attached to controllers (e.g. UNIBUS controllers attached
349 to UNIBUS adapters).
350 .LP
351 The following lines give an example of each of these interconnections:
352 .IP
353 .ta 1.5i 2.5i 4.0i
354 .nf
355 \fBcontroller\fP        hk0     \fBat\fP uba0 ...
356 \fBmaster\fP    ht0     \fBat\fP mba0 ...
357 \fBdisk\fP      hp0     \fBat\fP mba0 ...
358 \fBtape\fP      tu0     \fBat\fP ht0 ...
359 \fBdisk\fP      rk1     \fBat\fP hk0 ...
360 \fBdevice\fP    dz0     \fBat\fP uba0 ...
361 .fi
362 .LP
363 Any piece of hardware which may be connected to a specific
364 controller may also be wildcarded across multiple controllers.
365 .PP
366 The final piece of information needed by the system to configure
367 devices is some indication of where or how a device will interrupt.
368 For tapes and disks, simply specifying the \fIslave\fP or \fIdrive\fP
369 number is sufficient to locate the control status register for the
370 device.
371 \fIDrive\fP numbers may be wildcarded
372 on MASSBUS devices, but not on disks on a UNIBUS controller.
373 For controllers, the control status register must be
374 given explicitly, as well the number of interrupt vectors used and
375 the names of the routines to which they should be bound.
376 Thus the example lines given above might be completed as:
377 .IP
378 .ta 1.5i 2.5i 4.0i
379 .nf
380 \fBcontroller\fP        hk0     \fBat\fP uba0 \fBcsr\fP 0177440 \fBvector\fP rkintr
381 \fBmaster\fP    ht0     \fBat\fP mba0 \fBdrive\fP 0
382 \fBdisk\fP      hp0     \fBat\fP mba0 \fBdrive\fP ?
383 \fBtape\fP      tu0     \fBat\fP ht0 \fBslave\fP 0
384 \fBdisk\fP      rk1     \fBat\fP hk0 \fBdrive\fP 1
385 \fBdevice\fP    dz0     \fBat\fP uba0 \fBcsr\fP 0160100 \fBvector\fP dzrint dzxint
386 .fi
387 .PP
388 Certain device drivers require extra information passed to them
389 at boot time to tailor their operation to the actual hardware present.
390 The line printer driver, for example, needs to know how many columns
391 are present on each non-standard line printer (i.e. a line printer
392 with other than 80 columns).  The drivers for the terminal multiplexors
393 need to know which lines are attached to modem lines so that no one will
394 be allowed to use them unless a connection is present.  For this reason,
395 one last parameter may be specified to a
396 .IR device ,
397 a
398 .I flags
399 field.  It has the syntax
400 .IP
401 \fBflags\fP \fInumber\fP
402 .LP
403 and is usually placed after the
404 .I csr
405 specification.  The
406 .I number
407 is passed directly to the associated driver.  The manual pages
408 in section 4 should be consulted to determine how each driver
409 uses this value (if at all).
410 Communications interface drivers commonly use the flags
411 to indicate whether modem control signals are in use.
412 .PP
413 The exact syntax for each specific device is given in the Synopsis
414 section of its manual page in section 4 of the manual.
415 .NH 2
416 Pseudo-devices
417 .PP
418 A number of drivers and software subsystems
419 are treated like device drivers without any associated hardware.
420 To include any of these pieces, a ``pseudo-device'' specification
421 must be used.  A specification for a pseudo device takes the form
422 .IP
423 .DT
424 .nf
425 \fBpseudo-device\fP     \fIdevice-name\fP [ \fIhowmany\fP ]
426 .fi
427 .PP
428 Examples of pseudo devices are
429 \fBpty\fP, the pseudo terminal driver (where the optional
430 .I howmany
431 value indicates the number of pseudo terminals to configure, 32 default),
432 and \fBloop\fP, the software loopback network pseudo-interface.
433 Other pseudo devices for the network include
434 \fBimp\fP (required when a CSS or ACC imp is configured)
435 and \fBether\fP (used by the Address Resolution Protocol
436 on 10 Mb/sec Ethernets).
437 More information on configuring each of these can also be found
438 in section 4 of the manual.