CONFIG(8) — MAINTENANCE COMMANDS
NAME
config − build system configuration files
SYNOPSIS
/etc/config [ −p ] config_file
DESCRIPTION
Config does the preparation necessary for building a new system kernel with make(1). The config_file named on the command line describes the kernel to be made in terms of options you want in your system, size of tables, and device drivers to be included. The format of this file is described below. Using the −p option on the command line configures a system for profiling (see kgmon(8) and gprof(1)).
When you run config, it uses several input files located in the conf subdirectory of the system source (including your config_file) to generate the files necessary to compile and link your kernel. Since config places these output files in the directory named ../config_file — which it assumes exists — you must create this directory before running config. One of config’s output files is a makefile which you use with make(1) to build your system. For a description of other input and output files, see the FILES section below.
You use config as follows. Run config from the conf subdirectory of the system source (in a typical Sun environment, from /sys/conf):
tutorial# /etc/config config_file
Don’t forget to run make depend
tutorial#
While config is running watch for any errors. Never use a kernel which config has complained about; the results are unpredictable. If config completes successfully, you can change directory to the ../config_file directory, where it has placed the new makefile, and use make to create the dependency graph for the new system:
Don’t forget to run make depend
tutorial# cd ../config_file
tutorial# make depend
...lots of output...
tutorial# make
...lots more output...
Then you can install your new kernel and try it out.
CONFIG FILE FORMAT
In the following descriptions, a number can be a decimal integer, a whole octal number or a whole hexadecimal number. Hex and octal are specified to config in the same way they are specified to the C compiler, a number starting with "0x" is a hex number and a number starting with just a "0" is an octal number. When specifying the timezone, you may also use floating point numbers.
Comments are specified in a config file with the character "#". All characters from a "#" to the end of a line are ignored.
Lines beginning with tabs are considered continuations of the previous line.
Lines of the configuration file can be one of two basic types. First, there are lines which describe general things about your system:
machine type
This is system is to run on the machine type specified. Only one machine type can appear in the config file. The legal type for a Sun system is sun.
cpu "type"
This system is to run on the cpu type specified. For a Sun system, "type" is "SUN2" (note that the double quotes are part of the designation).
ident name
Gives the system identifier — a name for the machine or machines that run this kernel. name must be enclosed in double quotes if it contains both letters and numbers (for example, "SDST120"), or you will get a syntax error when you run /etc/config. Also, note that if name is GENERIC, you can specify the unique config_clause swap generic in the config line described below (see the next section, Specific System Description Lines). If you use any other string for name, and you also include an options GENERIC line, you can still use the swap generic line. However, if you use any other string for name and omit the options GENERIC line, you may NOT use the line config vmunix swap generic to specify your kernel image.
timezone number [ dst ]
Specifies the timezone you are in, measured in the number of hours west of GMT. 5 is EST, 8 is PST. Negative numbers indicate hours east of GMT. If you specify dst, the system will convert to and from daylight savings time when appropriate.
maxusers number
The maximum expected number of simultaneously active user on this system is number. This number is used to size several system data structures.
options optlist
Compile the listed options into the system. Options in this list are separated by commas. There is a list of options that you may specify in the generic makefile. A line of the form "options FUNNY,HAHA" yields −DFUNNY −DHAHA to the C compiler. An option may be given a value, by following its name with "=" then the value enclosed in (double) quotes. None of the standard options use such a value.
config sysname config_clauses...
Generate a system with name sysname and configuration as specified in config-clauses. The sysname is used to name the resultant binary image and per-system swap configuration files. The config_clauses indicate the location for the root file system, one or more disk partitions for swapping and paging, and a disk partition to which system dumps should be made. All but the root device specification may be omitted; config will assign default values as described below.
root A root device specification is of the form root on xy0d. If a specific partition is omitted — for example, if only root on xy0 is specified — the “a” partition is assumed. When a generic system is being built, no root specification should be given; the root device will be defined at boot time by prompting the console.
swap Swap device specifications have two possible forms. If a generic swap configuration is required, the clause swap generic should be specifed. Otherwise, if a single partition is to be used for swapping, one may specify swap on xy0b. If multiple partitions are to be interleaved one should specify something of the form swap on xy0 and xy1 and xy1g. If no swap specification is given, config assumes swapping should be done on the “b” partition of the root device. Swapping areas may be almost any size and multiple swap partitions of varying size may be interleaved. Partitions used for swapping are sized at boot time by the system; to override dynamic sizing of a swap area the number of sectors in the swap area can be specified in the config file. For example, swap on xy0b size 99999 would configure a swap partition with 99999 sectors.
dumps The location to which system dumps are sent may be specified with a clause of the form dumps on xy1. If no dump device is specified, the first swap partition specified is used. If a device is specified without a particular partition, the “b” partition is assumed. If a generic configuration is to be built, no dump device should be specified; the dump device will be assigned to the swap device dynamically configured at boot time.
Dumps are placed at the end of the partition specified. Their size and location is recorded in global kernel variables dumpsize and dumplo, respectively, for use by savecore(8).
Device names specified in configuration clauses are mapped to block device major numbers with the file devices.machine, where machine is the machine type previously specified in the configuration file. If a device name to block device major number mapping must be overridden, a device specification may be given in the form major x minor y.
The second group of lines in the configuration file describe which devices your system has and what they are connected to (for example, I have a Xylogics 450 Disk Controller on the main bus). These lines have the following format:
dev_typedev_name at con_dev more_info
Dev_type is either tape, disk, controller, device, or pseudo-device. These types have the following meanings:
controller
is a disk or tape controller.
disk or tape
are devices connected to a controller.
device
is something ‘attached’ to the main system bus, like a cartridge tape interface.
pseudo-device
A software subsystem or driver treated like a device driver, but without any associated hardware. Current examples are the pseudo-tty driver and various network subsystems. (For pseudo-devices, more_info may be specified as an integer, that gives the value of the symbol defined in the header file created for that device, and is generally used to indicate the number of instances of the pseudo-device to create. If you load a subsystem you will probably find it convenient to enable conditional code using an options specification.
Dev_name is the standard UNIX device name and unit number (if the device is not a psuedo-device) of the device you are specifying. For example, xyc0 is the dev_name for the first Xylogics controller in a system; ar0 names the first quarter-inch tape controller.
Con_dev is what the device you are specifying is connected to. For example, disk xy1 is connected to controller xyc0.
More_info is a sequence of the following:
csr [ bus_spec space_spec ] addr
Specifies the address of the csr (command and status registers) for a device. The optional bus specification (bus_spec) and space specification (space_spec) pair may be included in the address; otherwise, config will use a heuristic using addr to determine the bus and space. Typically, addr is given as a hexidecimal value.
bus_spec may be:
allThe device is on any main system bus.
mbThe device is on the Multibus.
vmeThe device is on the VMEbus.
space_spec may be:
virtVirtual address (preset by monitor) follows.
obmemThe following address is in on-board memory.
obioThe following address is in on-board I/O.
busmemThe following address is in main bus memory.
busioThe following address is in main bus I/O.
The csr address must be specified for all controllers, and for all devices connected to the main system bus (whether it is a Multibus or a VMEbus).
drive number
For a disk or tape, specifies which drive this is.
flags number
These flags are made available to the device driver, and are usually read at system initialization time.
priority level
For devices which interrupt, specifies the interrupt level at which the device operates.
vector intr number [ intr number . . . ]
For devices which use vectored interrupts on VMEbus systems, intr specifies the vectored interrupt routine and number the corresponding vector to be used (64-255).
A ? may be substituted for a number in two places and the system will figure out what to fill in for the ? when it boots. You can put question marks on a con_dev (for example, at xyc?), or on a drive number (for example, drive ?). This allows redundancy, as a single system can be built which will boot on different hardware configurations.
The easiest way to understand config files it to look at a working one and modify it to suit your system. Good examples are provided in the Configuring the System Kernel chapter and second appendix of the Installing UNIX on the Sun Workstation manual.
FILES
Files in /sys/conf which may be useful for developing the config_file used by config are:
GENERICGeneric configuration file for Sun systems, containing all
possible device description lines
READMEFile describing how to make a new kernel
As shipped from Sun, the files used by /etc/config as input are in the /sys/conf directory:
config_fileSystem-specific configuration file
makefile.sunGeneric prototype makefile for Sun systems
filesList of common files required to build a basic kernel
files.sunList of files for a Sun-specific kernel
devices.sunName to major device mapping file for Sun systems
/etc/config places its output files in the ../config_file directory:
mbglue.sShort assembly language routines used for vectored interrupts
ioconf.cDescribes I/O devices attached to the system
makefileUsed with make(1) to build the system
device_name.h A set of header files
(various device_name’s) containing devices
which can be compiled into the system.
SEE ALSO
The SYNOPSIS portion of each device entry in the Section 4 pages of the System Interface Manual. In the Installing UNIX on the Sun Workstation Manual, see the Configuring the System Kernel chapter, and the Sample Configuration Files appendix.
BUGS
The line numbers reported in error messages are usually off by one.
Sun Release 2.0 — Last change: 1 February 1985