mdevice(F)
mdevice --
device driver module description file
Format
xnamex funcs chars prefix bmajor cmajor minu maxu dma
Description
/etc/conf/cf.d/mdevice
is a one-line description of each device driver and configurable
software module in the system (except for file system types, see
mfsys(FP)).
Each line in mdevice represents the Master file component
from a Driver Software Package (DSP) which is either delivered with
the base system or installed later via
idinstall
or
configure.
See the section
``Specifying STREAMS modules and devices''
for details of how to specify STREAMS device drivers
and line discipline modules.
Each line of mdevice contains nine fields (xnamexdma).
Each field must contain an entry. The entry for fields funcs
and chars may be dash (-) if no value is being supplied.
Fields must be separated by spaces or tabs. The fields are described below:
xnamex-
Device name:
The internal name of the device or module; this may be up to 8 characters long.
The first character of the name must be an alphabetic character;
the others may be letters, digits, or underscores.
When created using
configure,
this field defaults to being the same as
the handler prefix (prefix)
unless overridden using the -h option.
funcs-
Function list:
A string of characters that identifies the
driver functions that are present.
Using one of the characters below requires the driver
to have an entry point (function) of the type indicated.
When the kernel is relinked an entry is made in the
kernel switch tables for each function in the list.
If no functions in the following list are supplied,
the field should contain a dash.
Most drivers use some or all of the following functions:
c-
close function. Called whenever the last open connection to a device
node associated with this driver is closed.
i-
ioctl function. I/O control function called to issue control
commands to the driver. Used by character devices only.
I-
init function. Called by the system during the system boot
sequence to initialize the driver or module for use. Interrupts
are not enabled when this function is called.
o-
open function. Called whenever a device node associated with
this driver is opened.
r-
read function. Called to read data from a device controlled
by this driver. Used by character devices only.
R-
probe function. Called by the system to determine the
devices present.
w-
write function. Called to write data to a device controlled
by this driver. Used by character devices only.
The remaining functions in this list are likely to be used only by drivers
with special requirements:
e-
exec function. Called when a process with an open (or
previously open) connection to this device,
using this driver, issues an
exec
system call. Provided
for devices which must perform specific actions when this situation
arises.
E-
kenter function. Called by the system whenever kernel mode is entered.
Provided for drivers which have specific actions to carry out whenever
this happens.
h-
halt function. Called during system shutdown. This might be provided
if, for instance, the driver needs to reset hardware in preparation
for a warm boot.
p-
poll function. Called once every system clock-tick. This might be
required (for instance) for a device which loses interrupts and needs to
be re-primed periodically.
P-
pminit function. Pre-main initialization function called by the
system very early in the system initialization process. Provided
for drivers which need to be initialized early. Normally this
function is used by a kernel debugger so that it is available to
the user as early as possible.
s-
start function. Secondary initialization function called by the
system late in the system boot sequence. Provided for drivers which
have initialization functions which must be deferred until after
system interrupts have been enabled.
S-
swtch
function. Called by the system whenever a process context
switch occurs. This is provided for drivers which have specific
actions to carry out whenever a context switch occurs.
x-
exit function. Called when a process with a previously
open connection to this device exits. Provided for devices
which must perform specific actions when this situation arises.
X-
kexit function. Called on exit from kernel mode to user mode. Provided
for drivers which have specific actions to carry out when this happens.
No characters are used to represent the
strategy and print routines of a ``block'' type
device driver (see field chars below). Such a driver must include
these routines in any case.
chars-
Characteristics of driver:
A set of characters
that indicates the characteristics of the driver.
If none of the characters below apply, the field should contain a dash.
The legal characters for this field are:
a-
The driver is installed automatically.
b-
The device is a ``block'' device.
B-
The driver should be present in a generic boot kernel that is
built using the command mkdev fd.
c-
The device is a ``character'' device.
C-
The device is a scatter/gather device which performs cluster I/O
requests. (Block devices only.)
d-
Indicates that a device can perform DMA transfers to any address in
physical memory, or does not require DMA at all. If this
characteristic is not set, the device needs cache buffers
below 16MB. Setting this for devices which do not use DMA
may prevent unnecessary use of low buffers.
D-
This option indicates that the device driver can share its DMA
channel.
G-
The interrupt handler specified in the
sdevice(F)
entry is not installed, but is checked for conflicts with other devices.
This is used when you wish to associate a device
with a specific device group.
h-
The device is a SCSI host adapter.
H-
This device driver controls hardware.
This option distinguishes drivers that support hardware
from those that are entirely software (pseudo-devices).
i-
The device driver is installable.
I-
Ignore pack.d directory. This option prevents the system
from looking for driver components when relinking the
kernel. This option is used when the functions associated with
this driver name are actually included in another driver.
k-
Instruct
idmknod
to leave device nodes (special files) of the same type (``character''
or ``block'') and with the same major number as this device
in the /dev directory, even if the device is configured
out of the kernel.
M-
This driver defines a range of extended minor device numbers
for a driver already defined in a preceding entry. This also
causes the Minimum and Maximum fields to be interpreted
differently. (See fields minu and maxu below.)
n-
The driver is not installable.
N-
No Driver.o or space.c file.
o-
This device may have only one
sdevice(F)
entry.
O-
This option indicates that the IOA range
(sdevice(F)
columns 7 and 8) of this device may overlap
that of another device, which must also have the 'O' characteristic.
p-
The device is a SCSI peripheral.
Q-
The device is a console driver.
r-
This device is required in all configurations of the kernel.
This option is intended for drivers delivered with the base system only.
Device nodes (special files in the /dev directory),
once made for this device, are never removed.
See
idmknod(ADM).
R-
This device has a device information file (device.dat).
s-
Suppress device count field.
S-
This device driver is a STREAMS module.
t-
The device is a ttym and has a _tty table.
v-
This device driver uses the Generic Platform Interface (GPI)
and is supported by an SMP vendor.
x-
The x setting no longer has any effect in the
``chars'' field. It is included for backward
compatability.
Z-
This driver may have multiple entries in the mdevice file, with
different major numbers.
prefix-
Handler prefix:
A character string used as a prefix for all
the externally-known handler routines associated with this driver.
The string may be up to 4 characters long.
bmajor-
Block major device number:
This is set to zero in a DSP Master file.
If the device is a ``block'' type device,
a value is assigned by idinstall during installation.
cmajor-
Character major device number:
This is set to zero in a DSP Master file.
If the device is a ``character'' type device (or STREAMS type),
a value is assigned by idinstall during installation.
minu-
Minimum units:
An integer specifying the minimum number
of devices that can be attached to the controller. The actual
number is specified in the
sdevice(F)
file.
If ``M'' appears in the characteristics field chars,
the value in this field is the base
major number of the driver to which the extended minor numbers apply
(BASE major).
maxu-
Maximum units:
An integer specifying the maximum number
of devices that can be attached to the controller. The actual
number is specified in the
sdevice
file.
If ``M'' appears in the characteristics field chars,
the value in this field is the offset
at which the range of the extended minor numbers begin (OFFSET)
and must be a multiple of 256.
dma-
DMA channel:
An integer that specifies
the DMA channel to be used by this device.
If the device does not use DMA, place a ``-1'' in this field.
Note that more than one device can share a DMA channel
provided that each sharing device sets the ``D'' characteristic
in field chars.
Specifying STREAMS modules and devices
STREAMS modules and devices are treated in a slightly different
way from other drivers in all UNIX systems, and their configuration
reflects this difference.
The mdevice entry for a STREAMS device driver
should contain both an ``S'' and a ``c'' in the
characteristics field chars.
``S'' indicates a STREAMS device;
``c'' that it needs an entry in the UNIX kernel's character
device switch table (cdevsw). This is where STREAMS
devices are normally configured into the system.
A STREAMS module that is not a device driver, such as a line discipline
module, requires an ``S'' in the characteristics field of
its mdevice file entry, but should not include a ``c''.
Files
/etc/conf/cf.d-
directory containing configuration files for linking the kernel
/etc/conf/cf.d/mdevice-
description for all device driver modules
/etc/conf/cf.d/sdevice-
specific characteristics for all devices
/etc/conf/sdevice.d/device-
specific characteristics for device
/etc/conf/pack.d/device/Driver.o-
device driver object module for device
/etc/conf/pack.d/device/device.dat-
device information file
See also
configure(ADM),
exec(S),
idbuild(ADM),
idinstall(ADM),
mkdev(ADM),
mfsys(FP),
sdevice(F)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003