MASTER(4) SysV MASTER(4)
NAME
master - master configuration database for STREAMS modules and drivers
DESCRIPTION
The master configuration database is a collection of files. Each file
contains configuration information for a device or module that may be
included in the system. A file is named with the module name to which it
applies. This collection of files is typically maintained in a single
directory called master.d, often in the /etc directory.
Each individual file has an identical format. A reference to a master
file means one of the individual files, corresponding to a particular
module or driver, and bearing the name of that module or driver. These
files are used by the mksinit(1) program to create STREAMS initialization
code for a module or driver.
A master file consists of two parts; they are separated by a line with a
dollar sign ($) in column 1. Part 1 contains device information for both
hardware and software devices, and loadable modules. Part 2 contains
parameter declarations used in part 1. Any line with an asterisk (*) in
column 1 is treated as a comment.
Part 1, Description
Drivers, multiplexors, and loadable modules are defined with a line
containing the following information. Field 1 must begin in the left
most position on the line. Fields are separated by white space (tab or
blank).
Field 1: Element characteristics:
o Specify only once.
r Required device (ignored).
b Block device (ignored).
c Character device.
a Generate segment descriptor array.
t Initialize cdevsw[].d_ttys.
s Software driver.
f STREAMS driver.
m STREAMS module.
x Not a driver; a loadable module.
number The first interrupt vector for an integral
device.
i Call private initialization routine
prefixinit at initialization time (Apollo
specific flag).
n Declare the socket trait for a module or
driver (Apollo specific flag). The type
name of the socket trait manager must be
declared in the parameters section below.
Field 2: Number of interrupt vectors required by a hardware device:
"-" if none.
Field 3: Handler prefix (4 chars. maximum).
Field 4: Software driver external major number; "-" if not a
software driver.
Field 5: Number of sub-devices per device; "-" if none.
Field 6: Interrupt priority level of the device; "-" if none.
Field 7: Dependency list (optional); this is a comma separated list
of other drivers or modules that must be present in the
configuration if this module is to be included.
Following the initial module specification line are external routine
references and variable definitions. (Routine references are ignored on
Apollo systems.) Routine and variable definition lines begin with white
space and immediately follow the initial module specification line.
These lines are free form, thus they may be continued arbitrarily between
non-blank tokens as long as the first character of a line is white space.
Part 1, Routine Reference Lines
If the UNIX system kernel or other dependent module contains external
references to a module, but the module is not configured, then these
external references would be undefined. Therefore, the routine reference
lines are used to provide the information necessary to generate
appropriate dummy functions at boot time when the driver is not loaded.
On Apollo systems, routine definitions are ignored.
Routine references are defined as follows:
Field 1: routine name ()
Field 2: the routine type: one of
{} routine_name(){}
{nosys} routine_name(){return nosys();}
{nodev} routine_name(){return nodev();}
{false} routine_name(){return 0;}
{true} routine_name(){return 1;}
Part 1, Variable Definition Lines
Variable definition lines are used to generate all variables required by
the module. The variable generated may be of arbitrary size, be
initialized or not, or be arrays containing an arbitrary number of
elements.
Variable references are defined as follows:
Field 1: variable_name
Field 2: [ expr ] - optional field used to indicate array size
Field 3: (length) - required field indicating the size of the
variable
Field 4: ={ expr,... } - optional field used to initialize
individual elements of a variable
The length field is mandatory. It is an arbitrary sequence of length
specifiers, each of which may be one of the following:
%i an integer
%l a long integer
%s a short integer
%c a single character
%number a field which is number bytes long
%number c a character string which is number bytes long
For example, the length field
( %8c %l %0x58 %l %c %c )
could be used to identify a variable consisting of a character string 8-
bytes long, a long integer, a 0x58 byte structure of any type, another
long integer, and two characters. Appropriate alignment of each %
specification is performed (%number is word aligned) and the variable
length is rounded up to the next word boundary during processing.
The expressions for the optional array size and initialization are infix
expressions consisting of the usual operators for addition, subtraction,
multiplication, and division: +, -, *, and /. Multiplication and
division have the higher precedence, but parentheses may be used to
override the default order. The builtin functions min and max accept a
pair of expressions, and return the appropriate value. The operands of
the expression may be any mixture of the following:
&name address of name where name is any symbol defined by the
kernel, any module loaded or any variable definition line
of any module loaded
#name (not supported) sizeof name where name is any variable
name defined by a variable definition for any module
loaded; the size is that of the individual variable--not
the size of an entire array
#C number of controllers present; this number is determined
by the EDT for hardware devices (not supported), or by the
number provided on the mksinit(1) command line.
#C(name) (not supported) number of controllers present for the
module name; this number is determined by the EDT for
hardware devices, or by the number provided on the
mksinit(1) command line.
#D number of devices per controller taken directly from the
current master file entry
#D(name) (not supported) number of devices per controller taken
directly from the master file entry for the module name
#M the internal major number assigned to the current module
if it is a device driver; zero of this module is not a
device driver
#M(name) (not supported) the internal major number assigned to the
module name if it is a device driver: zero if that module
is not a device driver
name value of a parameter as defined in the second part of
master
number arbitrary number (octal, decimal, or hex allowed)
string a character string enclosed within double quotes (all of
the character string conventions supported by the C
language are allowed); this operand has a value which is
the address of a character array containing the specified
string
When initializing a variable, one initialization expression should be
provided for each %i, %l, %s, or %c of the length field. The only
initializers allowed for a `%number c' are either a character string (the
string may not be longer than number), or an explicit zero.
Initialization expressions must be separated by commas, and variable
initialization will proceed element by element. Note that %number
specification cannot be initialized--they are set to zero. Only the
first element of an array can be initialized, the other elements are set
to zero. If there are more initializers than size specifications, it is
an error and execution of the mksinit(1) program will be aborted. If
there are fewer initializations than size specifications, zeros will be
used to pad the variable. For example:
={ "V2.L1", #C*#D, max(10,#D), #C, #M }
would be a possible initialization of the variable whose length field was
given in the preceding example.
Part 2, Description
Parameter declarations may be used to define a value symbolically.
Values can be associated with identifiers and these identifiers may be
used in the variable definition lines.
Parameters are defined as follows:
Field 1: identifier (8 characters maximum)
Field 2: =
Field 3: value, the value may be a number (decimal, octal, or hex
allowed), or a string
Additionally, the socket trait manager type name for modules which
support the n flag in Part 1, Field 1 can be declared as follows (Apollo
specific):
Field 1: SOCKET
Field 2: =
Field 3: type-name, where type-name is an identifier.
EXAMPLES
The following is a master file for a STREAMS multiplexor:
*FLAG #VEC PREFIX SOFT #DEV IPL DEPEND/VARS
ofs - tmx - -
tmx_tmx[NTMX] (%i%l)
tmxcnt (%i) ={NTMX}
tmx_low[NTMXL] (%i%l%l)
tmxlcnt (%i) ={NTMXL}
$$$
* count of upper streams - same of number of minor devices
NTMX = 4
* count of lower streams
NTMXL = 3
The following master file defines a STREAMS driver:
*FLAG #VEC PREFIX SOFT #DEV IPL DEPEND/VARS
nfs - tiv - - -
ti_tivc[#C] (%0x3c)
tivc_cnt (%i) = { #C }
$$
SOCKET = sock2tli
The following is a master file for a STREAMS module:
*FLAG #VEC PREFIX SOFT #DEV IPL DEPEND/VARS
m - tim
tim_tim[#C] (%0xc)
tim_cnt (%i) = { #C }
$$
SEE ALSO
mksinit(1)