Managing and Developing Dynamically Loadable Kernel Modules

Managing and Developing Dynamically Loadable Kernel Modules
Managing Dynamically Loadable Kernel Modules
Chapter 12516
functions accessed through the module’s wrapper code
To load a dynamically configured loadable module into the running
kernel, execute the following kmadmin command:
/usr/sbin/kmadmin -L
module_name
When the loading completes, an identifier (ID) number prints on the
standard output to identify the module that was loaded.
Changing the Configured Loading Phase of a Currently Registered
Module
Once a module has been registered with the currently running kernel,
the configured loading phase can be changed using the following
command syntax:
/usr/sbin/kmadmin -b
value module_name
For example, the following command schedules a registered module
named hello to be loaded at every system reboot, at the end of the boot
sequence (at init time);
/usr/sbin/kmadmim -b i hello
For more information, see “Preparing a Loadable Module for Dynamic
Loading Into the HP-UX Kernel” on page 511.
Unloading a Dynamically Configured Loadable Module
The unloading operation logically disconnects the module from the
running kernel and calls the module’s _unload() entry point to perform
any module-specific cleanup including:
1. Canceling all outstanding calls to timeout()
2. Disabling device interrupts
3. Freeing all active memory allocated by the specified loadable module
Use the -U or -u option of the kmadmin command to unload a DLKM
module configured as dynamically loadable. You have the choice of
unloading the module by its name or by its ID number.
Step 1. To unload a dynamically configured loadable module by name, execute
this kmadmin command:
/usr/sbin/kmadmin -U
module_name