Linux STREAMS (LiS) |
||
|
Installing Pre-Compiled Drivers |
|||||||||||||||
LiS makes provision for you to add your own STREAMS drivers to the build of LiS. You drivers are built outside the LiS source code tree. The object code and configuration information pertaining to your driver must be copied into the LiS source code tree in order to be incorporated into LiS. The LiS pkg DirectoryThe directory /usr/src/LiS/pkg is the directory where pre-compiled drivers are to be copied. This directory contains subdirectories, one for each driver to be linked in with LiS when LiS is built. If you have a driver named foo then you need to do a mkdir /usr/src/LiS/pkg/foo to create the directory that will contain the components of your driver. Driver ComponentsYou need to copy the following files into your package directory (/usr/src/LiS/pkg/foo).
Dynamically Loadable STREAMS DriversYou can also compile your STREAMS driver as a loadable module and load it dynamically either on demand or using the insmod command. In order to do this you need to inform the Linux kernel that your driver depends upon the LiS STREAMS driver. You do this by placing an entry into the file /etc/conf.modules (on newer distributions of Linux this file has been renamed to /etc/modules.conf) . In order to code this entry correctly, you need to know the major device number that is to be assigned to your driver. One way to find this out is to make a directory for your driver in the LiS pkg directory and include a Config file but no object code. You can then use the resulting config.h file (located in the directory /usr/src/LiS/include/sys/LiS and left behind by the LiS build process) to determine your driver's major device number. When your driver loads and you register it, you need to ask for this major device number. The entry in the /etc/conf.modules file looks like the following:
This entry tells the kernel that a driver with major device number maj is dependent upon the module named "streams," the module name for LiS. The LiS strconf utility program contains constructs which support this process. See the Configuration section for more information. Tip: Be sure not to include your driver's ".o" file in the LiS pkg directory. Instead you will need to copy it to the appropriate subdirectory of /lib/modules.
|