DDI: 8 sample driver

Node file

The Node(DSP/4dsp) file provides information used by the idmknodd utility to create the special device files for the devices supported by this driver. The samp driver's Node(DSP/4dsp) file is shown in sample Node file The $maxchan value specifies the maxiumum supported channel number for the driver. This value must match the value passed to the drv_attach(D3) function in the drv_maxchan member of the drvinfo(D4) structure. Drivers that support only a single channel set $maxchan 0. This example is for a driver that supports two channels.

$maxchan determines the number of device nodes needed per instance of a device. For example, an 8-port serial board usually requires at least 16 nodes, two for each port to indicate modem or non-modem control, so $maxchan would be set to 15.

Drivers that use open redirection (``cloning'') should create one channel for the initial open plus one for each clone channel. See open(D2) for more information about open redirection.

The remaining lines in the Node file control the actual files created in the /dev directory. The first field is the name of the driver, to match that field in the other DSP files. The second field specifies the name that will be given to the special device files. This sample uses %i to indicate that one node will be created for each instance of this driver's device, using the specified name as a root name. See ``Device instance''. This line will create special device files with names such as /dev/sample0 and /dev/sample1. This field could specify a subdirectory to be used. For example, a value of mdi/foo0 creates a special device file named /dev/mdi/foo0.

The c specifies the type; this will be a character special device file. The 0 in the first line and 1 in the second line are the channel numbers.

Additional fields are documented on the Node(DSP/4dsp) manual page. You can specify the user and group permissions and the security level. Note that the user and group must be specified as decimal integer values rather than using strings such as ``root'' and ``sys''.

© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005