Node(4dsp)
Node --
device node definitions for a device driver
Description
One of the Installable driver/Tunable Parameters kernel configuration files,
a Node file, contains definitions
used by the
idmknodd(1M)
command
to create the device nodes (block and character special files)
associated with a device driver module.
When the Node component
of a module's Driver Software Package (DSP) is installed,
idinstall(1M)
stores the driver's Node file information
in /etc/conf/node.d/module-name,
where module-name is the name of the driver being installed.
Package scripts should never access
/etc/conf/node.d files directly;
the idinstall command should be used instead.
Each device node for the driver
is specified on a separate line of the form:
module-name node-name type minor user group permissions level
All fields are positional and must be separated by white space.
The first four fields are required;
the last
four fields are optional.
Blank lines and lines beginning
with ````#'''' or ````*'''' are considered
comments and are ignored.
The node file fields are:
- module-name
-
Identifies the device to which this node applies.
The name must match the name specified for the device
in the module-name field of the
Master(4dsp)
file.
The device must be defined as a block and/or character device
(Master file characteristics flag
set to b or c).
When the device node is created,
the Master file bmaj or cmaj field values
will be used as the major number for the created node.
- node-name
-
Specifies the name of the node file to be created,
relative to /dev.
If this field specifies a pathname containing subdirectories,
idmknod will automatically create these subdirectories.
If the name contains %i,
one such node file will be created
for each instance of this driver's device,
with a unique instance number
(in variable-width decimal)
substituted for the %i.
- type
-
Identifies the type of node to be created.
The character b indicates that the node is a block device;
the character c indicates character device.
The value for this field must match
one of the flags specified for the device
in the mdevice file characteristics field.
In cases where an entry-type 0 device
using a DDI version prior to version 8)
has multiple major numbers,
the Node file type field
must provide additional information
used to identify which device nodes belong to which major.
To do this, you specify a value of the form:
type:offset
where type is the type of node (b or c)
and offset gives the offset to this particular device
within the range of major numbers
specified for this device type in the Master file.
For example, the value ``c:2'' refers to
a character major offset 2,
which, given a major
device type specification of ``15-18'',
would translate to a character major number of 17.
- channel
-
Specifies the channel number
(for DDI 8 or newer drivers)
or the minor device number
(for older drivers).
For entry-type 0 drivers,
this field can be coded in one of three ways:
-
If this field specifies a (decimal) numeric value,
the value is used as the minor device number for the created node.
-
If this field specifies a non-numeric value,
the value is assumed to be a request for a clone node,
and the minor number will be set to the major number of the device
whose module-name is the value of the field.
-
If this field specifies a non-numeric value
and the Node file type field
specifies an offset value,
the offset will be applied to the minor number
instead of the major number when the node is created.
- user
-
This field is optional.
If used, it specifies the
user ID of the user that will own the node to be created.
The user ID must be specified as decimal integer value.
If user is specified,
group and permissions
must be specified.
- group
-
This field is optional.
If used, it specifies the
group ID of the group that will own the node to be created.
The group ID must be specified as decimal integer value.
If group is specified,
user and permissions
must be specified.
- permissions
-
This field is optional.
If used, it specifies, in octal form,
the permissions for the node to be created,
as given to the
chmod(1)
command
(for example, 0777).
If permissions is specified,
user and group
must be specified.
- level
-
This field is optional.
If used, it specifies
the level of security to be assigned to the node to be created.
The security level must be specified as a decimal integer value.
If the Enhanced Security Utilities are not installed,
or if the file system containing /dev is a non-MAC file system,
this field is ignored.
References
idinstall(1M)
Examples
The following sample Node file entries are
provided as coding examples.
Make character device files
/dev/tty0s, /dev/tty0h,
/dev/tty1s, /dev/tty1h,
and so forth for a DDI 8 driver, foo:
foo tty%is c 0
foo tty%ih c 1
Make pre-DDI 8 character device
iasy using minor device 0:
iasy tty00 c 0
Make /dev/net/nau/clone for character device clone.
The minor device number is set to the major device number
of device nau:
clone net/nau/clone c nau
Make /dev/imx586_1 for character device clone.
The minor device number is set to the major device number
of device imx586 plus 1:
clone imx586_1 c:1 imx586
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.