master(4) master(4)NAME master - master kernel configuration files DESCRIPTION Master files are used by autoconfig(1M) to obtain device in- formation that is necessary to configure new kernels. Mas- ter files are located in /etc/master.d. Master files can contain up to three order-dependent lines of information: a device identifier, a dependency state- ment, and a device specification. The device-identifier and dependency-statement lines are optional and precede the dev- ice specification, as shown below: device-identifier dependency-statement device-specification Device Identifier The device identifier provides optional information that is useful only for slot device drivers. Each slot card stores a board ID number and a version number in its ROM. The dev- ice identifier is used to specify a particular slot card and, optionally, a range of version numbers, as shown below: id board-id serial where board-id is an integer value that matches the board ID that is stored in a slot card's ROM. For example, board-id with a value of 8 indicates the EtherTalk card. The place- holder serial is an optional number or number range. If present, serial is compared with the slot card's version number. If the comparison fails, autoconfig terminates. The placeholder serial can be specified as: number The slot card's version number must match number. number- The slot card's version number must be less than or equal to number. -number The slot card's version number must be greater than or equal to number. number1-number2 The slot card's version number must be within the range specified by number1-number2. April, 1990 1
master(4) master(4)If serial is not specified, autoconfig does not check the slot card's version number. Dependency Statements Dependency statements can be used to specify modules that must be included or excluded in the resulting kernel for proper operation of the subject driver. Dependency state- ments can have several forms, from simple to complex: verb namelist if filename verb namelist if expression verb namelist The possible values for verb, namelist, filename, and ex- pression are described below: verb The keyword include or exclude. include tells autocon- fig to include the modules specified in namelist in the resulting kernel. exclude tells autoconfig to exclude the modules specified in namelist from the resulting kernel. namelist A comma-separated list of module names. filename The name of another master file in the current directo- ry or a period (.), which indicates the current master file. If filename exists, the modules specified in namelist are included in the resulting kernel. If filename does not exist, the modules specified in namelist are excluded. expression An expression constructed from filenames and operators. If the evaluation of the expression is TRUE, the modules specified in namelist are included in the resulting kernel. If the evaluation of the expression is FALSE, the modules specified in namelist are exclud- ed. The following operators, listed from highest to lowest priority, can be used to construct expression: ! NOT & AND | OR Parentheses can be used to override the default priori- ty. The following examples use parentheses to demon- strate the default priority of the operators: a | b & c is equivalent to a | (b & c) !a & b is equivalent to (!a) & b 2 April, 1990
master(4) master(4)Device Specification The device specification provides information that autocon- fig must know to produce a complete and working kernel. A device specification is comprised of the following six fields: flags vectors prefix major-number maximum-devices interrupt-level The fields must appear on a single line in the master file in the order shown above and must be separated by one or more blanks or tabs. Each field is described below: flags One or more of the following characters: aTell autoconfig to create prefixcnt and prefixaddr data structures for this module. The value of prefix is discussed below. bTell autoconfig to create a bdev switch entry for this module. cTell autoconfig to create a cdev switch entry for this module. lTell autoconfig to create a line discipline switch entry for this module. mTell autoconfig to create a Streams entry for this module. nTell autoconfig that this module uses a network in- terface (TCP/IP). popt Tell autoconfig that this module has an initializa- tion routine. autoconfig generates code that calls the initialization routine at the point in the during system boot specified by opt, which can be any of the following characters: f Call this module's initialization routine first, before any other initialization occurs. Interrupts are disabled. s April, 1990 3
master(4) master(4)Call this module's initialization routine after any pf modules. Interrupts are disabled. n Call this module's initialization routine after any pf and ps modules but prior to enabling in- terrupts. If popt is not specified, n is the default. 0 Call this module's initialization routine after enabling interrupts. 1 Call this module's initialization routine be- fore entering /etc/init. sTell autoconfig that this module is a software module that does not drive a hardware device. Of the other possible values for flags, only the p flag can be used with the s flag. tTell autoconfig that this module is a character dev- ice driver that requires a tty structure. The t flag must be used with the c flag. vopt Tell autoconfig to link this driver to the interrupt vector mechanism. Currently, the only valid value of opt is s, which tells the kernel to decode slot-based interrupts and call the interrupt routine of this driver when the card generates an interrupt. xTell autoconfig that this module is a Streams module. Only the p flag can be used with the x flag. Sopt Specify opt as one of the following characters: e Tell autoconfig that this module contains a special exit routine. f Tell autoconfig that this module contains a special fork routine. x Tell autoconfig that this module contains a special exec routine. vectors 4 April, 1990
master(4) master(4)The number of interrupt vectors that a particular con- troller can generate. For hardware device drivers, this value must be a nonzero integer. For drivers that receive slot interrupts, this number is 1 because each controller can generate only one interrupt. For software modules, that do not drive a hardware device this value should be a hyphen (-). prefix The prefix used in the driver's open, close, read, write, ioctl, print, select, and strategy routines. For example, if the driver's open routine is called bddopen, the prefix is bdd. The placeholder prefix must be between three and eight characters long. Valid characters are alphanumerics and the underline (_) character. To maintain consistency, prefix should also be the name of the master file. major-number The value that is assigned as the major number for the device driver. This value should always be a hyphen (-). When a hyphen is specified in this field, autoconfig as- signs the first available major number to the device. Letting autoconfig assign the major number guarantees a unique major number for each device driver and prevents conflict between two or more device drivers. maximum-devices Either a hyphen (-) for software modules or a nonzero in- teger for hardware device drivers. The integer value is the number of devices the controller supports. interrupt-level The highest-priority interrupt level used by the controll- er. For software modules, this value should be a hyphen (-). For slot-based devices, all of which interrupt at spl1, this value should be 1. EXAMPLES The following master file is for a block device driver: if . include SCSI bca - bdd - 2 1 The if . include SCSI statement forces the inclusion of another module, SCSI (the SCSI Manager), on which this dev- ice depends. The b and c flags indicate that the driver is used as both a block and a character device driver, so auto- config will create entries for this device in both the bdevsw and cdevsw tables. The a flag tells autoconfig to create the bddcnt and bddaddr data structures. April, 1990 5
master(4) master(4)Because this device receives interrupts via the SCSI Manager, the hyphen (-) in the second field is used to tell autoconfig that this device does not receive interrupts directly. The device's prefix is bdd, and, because the fourth field contains a hyphen, autoconfig assigns the dev- ice driver's major number. The 2 in the fifth field indicates that there are two dev- ices per controller, and the 1 in the sixth field indicates that the device's interrupt level is spl1. FILES /etc/master.d Default location of master filesSEE ALSOBuilding A/UX Device Drivers, which is available from APDA.6 April, 1990