CONFIG(8) — MAINTENANCE COMMANDS
NAME
config − build system configuration files
SYNOPSIS
/etc/config [ −p ] [ −n ] [ −f ] [ −o obj_dir ] 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. When you run config, it uses several input files located in the current directory (typically the conf subdirectory of the system source including your config_file). The format of this file is described below. The following options are understood by config.
−p Configures the system for profiling (see kgmon(8) and gprof(1)).
−n Do not do the "make depend". Normally config will do the "make depend" automatically. If this option is used config will print “Don’t forget to do a "make depend"” before completing as a reminder.
−f Set up the makefile for fast builds. This is done by building a " vmunix.o" file which includes all the .o files which there is no source. This reduces the number of files which have to be stat’ed during a system build. This is done by prelinking all the files for which no source exists into another file which is then linked in place of all these files when the kernel is made. This makefile is faster because it does not stat the object files during the build.
−o obj_dir
Use ../obj_dir instead of ../OBJ as the directory to find the object files when the corresponding source file is not present in order to generate the files necessary to compile and link your kernel.
If the directory named ../config_file does not exist, config will create one. One of config’s output files is a makefile which you use with make 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
Doing a "make depend"
tutorial# cd ../config_file
tutorial# make
...lots of output...
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 build a kernel. The output files placed in this directory include ioconf.c, which contains a description of I/O devices attached to the system; mbglue.s, which contains short assembly language routines used for vectored interrupts, a makefile, which is used by make to build the system; a set of header files (device_name.h) which contain the number of various devices that may be compiled into the system; and a set of swap configuration files which contain definitions for the disk areas to be used for the root file system, swapping, and system dumps. Now 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 numbers 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. You can use a floating-point number to specify half-hour time zones.
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 types for a Sun system are "sun2" and "sun3" (note that the double quotes are part of the designation).
cpu "type"
This system is to run on the cpu type specified. More than one cpu type can appear in the config file. Legal types for a "sun2" machine are "SUN2_120" (generic for any Multibus based Sun-2 machine), "SUN2_50" (generic for any VMEbus based Sun-2 machine), The legal types for a "sun3" machine are "SUN3_160", and "SUN3_50".
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. 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, config will set up the makefile as if you had.
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. 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.
In addition, options can be used to bring in additional files if the option is listed in the files files. All options should be listed in upper case. In this case, no corresponding option.h will be created as it would be using the corresponding pseudo-device method.
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 at address 0xee40 in the Multibus I/O space). These lines have the following format:
dev_type dev_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.
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. It is either nexus?, a bus type, or a controller. There are several bus types which are used by config and the kernel.
The different possible bus types are:
obmem
On board memory
obioOn board io
mbmem
Multibus memory (sun2 only)
mbioMultibus io (sun2 only)
vme16d16 (vme16)
16 bit VMEbus/ 16 bit data
vme24d16 (vme24)
24 bit VMEbus/ 16 bit data
vme32d16
32 bit VMEbus/ 16 bit data (sun3 only)
vme16d32
16 bit VMEbus/ 32 bit data (sun3 only)
vme24d32
24 bit VMEbus/ 32 bit data (sun3 only)
vme32d32 (vme32)
32 bit VMEbus/ 32 bit data (sun3 only)
All of these bus types are declared to be connected to nexus. The devices are hung off these buses. If the bus is wildcarded, then the autoconfiguation code will determine if it is appropriate to probe for the device on the machine that it is running on. If the bus is numbered, then the autoconfiguation code will only look for that device on machine type N. In general, the Multibus and VMEbus bus types are always wildcarded.
More_info is a sequence of the following:
csr addr
Specifies the address of the csr (command and status registers) for a device. The csr addresses specified for the device are the addresses within the bus type specified.
The csr address must be specified for all controllers, and for all devices connected to a main system bus.
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 (0x40-0xFF).
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 virtual ?), 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:
GENERIC These are generic configuration files for
either a Sun-2 or Sun-3 system.
They contain all possible device
descriptions lines for the particular
architecture.
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.sun[23] Generic prototype makefile for Sun−[23] systems
filesList of common files required to build a basic kernel
files.sun[23]List of files for a Sun−[23] specific kernel
devices.sun[23]Name to major device mapping file for Sun−[23] 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 Section 4 of the UNIX Interface Reference Manual.
Configuring the System Kernel, and Sample Configuration Files in Installing UNIX on the Sun Workstation.
Kernel Configuration under Periodic Maintenance in System Administration for the Sun Workstation
Sun Release 3.2 — Last change: 30 April 1986