Managing Systems and Workgroups: A Guide for HP-UX System Administrators

Configuring a System
Reconfiguring the Kernel (Prior to HP-UX 11i Version 2)
Chapter 3294
Auto loading occurs when the kernel detects a particular loadable
module is required to accomplish some task, but the module is not
currently loaded. The kernel automatically loads the module.
DLKM Driver Loading Concepts
When a module is dynamically loaded, its object file is read from disk
and loaded into newly allocated kernel memory. Once in memory, the
module's symbols are relocated and any external references are resolved.
Special code in the module is then executed to perform any required
module-specific setup. Then the code specific to the module's type, if any,
is executed, making the newly loaded module accessible to the rest of the
kernel.
A module can be loaded in the following ways:
Demand Load
A demand load is a user level request for a specific module to be
loaded. The load is accomplished through the kmadmin command.
Autoload Event
An autoload occurs when the kernel detects that a specific module is
required to provide the functionality necessary to perform a task.
The load is triggered by the initiation of the task. Once the required
module is loaded, the task continues.
A loadable module’s _load() function performs any initialization tasks
required by the module before the module is logically connected to the
kernel. Typical initialization tasks include acquiring private memory for
the module and initializing devices and data structures.
If the module is unable to initialize itself, the _load() function must
free any memory that it allocated and undo any other action that it
took prior to the failure including canceling all outstanding calls to
timeout.
DLKM Driver Unloading Concepts When the functionality provided
by a module is no longer needed the module can be unloaded, thus
freeing its resources for later use.
When a module is unloaded, the code specific to the module's type, if
any, is executed to disconnect the module from the kernel. Then,
special code in the module is executed to perform any module-specific
cleanup. Finally, the memory allocated to the module is freed.