Manual pages › File formats and configuration files (4)
master(4)
master configuration database
From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.
NAME · DESCRIPTION · EXAMPLE · FILES · SEE ALSO
NAME
master - master configuration database
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 maintained in a directory called /etc/master.d. Each file has an identical format. For convenience, this collection of files will be referred to as the master file, as though it were a single file. Treating the master file as a single file allows a reference to the master file to be understood to mean the individual file in the master.d directory that corresponds to the name of a device or module. The file is used by the mkboot(1M) program to obtain device information to generate the device driver and configurable module files. It is also used by the sysdef(1M) program to obtain the names of supported devices. master 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
Hardware devices, software drivers 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
b block device
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 first interrupt vector for an
integral device
none no flags for this driver or
module
Field 2: number of interrupt vectors required by a
hardware device: "-" if none.
Field 3: handler prefix (4 characters maximum)
Field 4: software driver external major number; "-" if
not a software driver, or to be assigned dur-
ing execution of drvinstall(1M)
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
For each module, two classes of information are required by mkboot: external routine references and variable definitions. 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 con-
figured, 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. The
format of a routine reference is as follows:
routine_name()action
The valid actions and their meanings are:
{} routine_name(){}
{nosys} {return nosys();
{nodev} {return nodev();}
{false} {return 0;}
{true} {return 1;}
{nopkg} {return nopkg();}
{noreach} panic the system
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 fol-
lowing:
%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 charac-
ter string 8-bytes long, a long integer, a 0x58 byte struc-
ture 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 infixed 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 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, or by the number provided in the system file for non-hardware drivers or modules
#C(name) number of controllers present for the module name; this number is determined by the EDT for hardware devices, or by the number provided in the system file for non-hardware drivers or modules
#D number of devices per controller taken directly from the current master file entry
#D(name) 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) 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
proceeds element by element. Note that %number specifica-
tion cannot be initialized-they are set to zero. Only the
first element of an array can be initialized; the other ele-
ments are set to zero. If there are more initializers than
size specifications, it is an error and execution of the
mkboot program is aborted. If there are fewer initializa-
tions than size specifications, zeros will be used to pad
the variable. For example:
={ "V2.L1", #C*#D, max(10,#D), #C(OTHER), #M(OTHER) }
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 symbol-
ically. Values can be associated with identifiers and these
identifiers may be used in the variable definition lines.
Parameters are defined as follows:
identifier = value
The identifier may have a maximum of 8 characters. The
value may be a number (decimal, octal, or hex) or a string.
EXAMPLE
A sample master file for a tty device driver would be named
atty if the device appeared in the EDT as ATTY. The driver
is a character device, the driver prefix is at, two inter-
rupt vectors are used, and the interrupt priority is 6. In
addition, another driver named ATLOG is necessary for the
correct operation of the software associated with this dev-
ice.
*FLAG #VEC PREFIX SOFT #DEV IPL DEPENDENCIES/VARIABLES
tca 2 at - 2 6 ATLOG
atpoint(){false}
at_tty[#C*#D] (%0x58)
at_cnt(%i) ={ #C*#D }
at_logmaj(%i) ={ #M(ATLOG) }
at_id(%8c) ={ ATID }
at_table(%i%l%31%s)
={ max(#C,ATMAX),
&at_tty,
#C }
$
ATID = "fred"
ATMAX = 6
This master file causes a routine named atpoint to be gen-
erated by the boot program if the ATTY driver is not loaded,
and there is a reference to this routine from any other
module loaded. When the driver is loaded, the variables
at_tty, at_cnt, at_logmaj, at_id, and at_table are allocated
and initialized as specified. Because of the t flag, the
d_ttys field in the character device switch table is ini-
tialized to point to at_tty (the first variable definition
line contains the variable whose address will be stored in
d_ttys). The ATTY driver would reference these variables by
coding:
extern struct tty at_tty[];
extern int at_cnt;
extern int at_logmaj;
extern char at_id[8];
extern struct {
int member1;
struct tty *member2;
char junk[31];
short member3;
} at_table;
FILES
/etc/master.d/*
SEE ALSO
drvinstall(1M), mkboot(1M), sysdef(1M), system(4)