Specifications

D
evice Driver Programming
13-12
The global auto-unload delay values are defined as:
DEF_UNLOAD_DELAY 60 0 3600
This says that, by default, any loadable module becomes a candidate for auto unloading
when the module has not been accessed for 60 seconds. If your driver wants to override
the kernel's default auto-unload delay value, you can specify a
PREFIX_
UNLOAD_DELAY
value in your driver's Mtune component.
The symbolic name of the driver's unload delay tunable must begin with the driver's
PREFIX
in full caps, as
PREFIX
_UNLOAD_DELAY.
Installing and Configuring a Loadable Module 13
Loadable modules are installed and tuned in much the same way as other modules. Refer
to Chapter 14 (“Driver Installation and Tuning”) for more information.
Once your loadable driver is installed, the next step is to configure it into the system using
the idbuild(1M) command.
There are two ways you can configure your loadable driver using idbuild: a deferred
build and an immediate build. If you don't want to configure your driver into the system
that is currently running, you can invoke idbuild with no options, and your driver is
configured on the next reboot. If you do want to configure your loadable driver into the
running system, you invoke idbuild with the -M option. This option configures your
loadable driver into the system immediately, without a reboot.
When no options are given, the idbuild command does not rebuild the kernel. It simply
sets a rebuild flag and exits. The next time the system is rebooted, the reboot process
rebuilds the kernel and reconfigures all modules flagged as loadable.
With the -M option, idbuild configures your loadable driver into the running system
immediately, so you don't have to wait for a reboot to be able to load it. Some of the tasks
the -M option performs to configure your loadable driver include placing the driver's load-
able image in the /etc/conf/mod.d directory, and creating the necessary nodes in the
/dev directory. If your DSP contains an Init component, idbuild adds and activates
your driver's inittab entries. idbuild also registers your driver with the kernel to
make it available to the rest of the system.
For more information, see the idbuild(1M) manual page.
Managing Loadable Modules 13
Loading the Module 13
Once your loadable driver is configured into the kernel, you are ready to load it using the
modadmin(1M) command.