Managing and Developing Dynamically Loadable Kernel Modules

Managing and Developing Dynamically Loadable Kernel Modules
Developing Dynamically Loadable Kernel Modules
Chapter 12558
2. Execute the following kminstall command:
/usr/sbin/kminstall -u
module_name
kminstall copies the module’s component files to the appropriate
locations, thereby overwriting the same named files at those locations.
Removing the Module’s Components from the System
Use the -d option of the kminstall command to remove a DLKM
module’s components from the system. If the specified module is listed in
the /etc/loadmods file, kminstall prints a warning message and
removes the module entry from /etc/loadmods. If the specified module
is currently loaded, kminstall tries to unload the module. If the unload
fails, it prints a message and exits with an error; otherwise, kminstall
tries to unregister the module. If the unregistration fails, kminstall
prints a message and exits with an error.
To remove a DLKM module’s components, execute the following
kminstall command:
/usr/sbin/kminstall -d
module_name
kminstall deletes the module’s components from the /usr/conf and
/stand subdirectories.
NOTE kminstall does not delete the original component files for the module.
If the removed DLKM module is statically linked into the running
kernel, you will have to execute config -u to reconfigure the kernel once
the module has been removed. Then you will have to shutdown and
restart the system for the new configuration to take effect.
Sample DLKM WSIO Class Driver
This section presents a complete skeleton of a DLKM WSIO class driver
in HP-UX. The files shown are:
dlclass.c – the template character driver
master – the master file for the sample character driver
system – the system file for the sample character driver; $CONFIGURE
and $LOADABLE flags are both set to Y