STREAMS/UX for the HP 9000 Reference Manual

107
How to Compile and Link STREAMS/UX Drivers, Modules, and Applications
Linking STREAMS/UX Drivers and Modules into the Kernel
Linking STREAMS/UX Drivers and Modules into
the Kernel
Linking STREAMS/UX drivers and modules into the kernel is a multi-step
process. A summary of the steps is:
1 Create or modify your master file to reflect changes.
2 Add a driver header with the information previously located in the /etc/master file
into the etc/master.d directory.
3 Add a driver install routine for both STREAMS drivers and STREAMS modules
(“driver” in the case of the STREAMS subsystem refers to both STREAMS
drivers and STREAMS modules).
4 Adjust any STREAMS/UX tunables if necessary.
5 Create your library and copy it to /usr/conf/lib.
6 Re-generate your kernel using mk_kernel(1).
7 Once the system is re-booted, use lsdev(1M) to determine the value of any
dynamically-assigned major numbers, if applicable.
8 Create device files with mknod(1M).
Details about the Driver Header, Driver Install Routine, and lsdev(1) follow.
Adding Driver Header and Driver Install Routine
The STREAMS driver writer must add a driver header and a driver install
routine for their STREAMS drivers and modules. The driver header consists
of three data structure declarations (for a STREAMS driver and actually
only one for a STREAMS module). The driver install function will get
called by the I/O system to “install” your pseudo driver into the I/O
subsystem tables. The driver header essentially contains the information
previously contained in the master file.
The main job of your driver install routine is to call one or both of the
functions, install_driver (CDIO3) and/or str_install().