13.3.1. Dynamically Loading/Unloading Your Kernel PlugIn Driver
If you used WinDriver to develop a Kernel PlugIn driver [11], you must load this driver only after loading
the generic WinDriver driver — windrvr6.o/.ko.
When unloading the drivers, unload your Kernel PlugIn driver before unloading
windrvr6.o/.ko.
Kernel PlugIn drivers are dynamically loadable — i.e., they can be
loaded and unloaded without reboot.
Use the following commands to dynamically
load or unload your Kernel PlugIn driver.
![[Note]](scripts/images/note.png) | |
|---|
|
The following commands must be executed with root privileges.
|
![[Note]](scripts/images/info.png) | |
|---|
| xxx in the commands signifies your selected
Kernel PlugIn driver project name.
|
-
To dynamically load your Kernel PlugIn driver, run this command:
# /sbin/insmod <path to kp_xxx_module.o/.ko>
![[Note]](scripts/images/note.png) | |
|---|
When building the Kernel PlugIn driver on the development machine, the
Kernel PlugIn driver module is created in your Kernel PlugIn
project's kermode/linux/LINUX.<kernel version>.<CPU> directory (see
Section 12.7.2, Step 4).
When building the driver on a target distribution machine, the driver
module is normally created in an
xxx_installation/redist/LINUX.<kernel version>.<CPU>.KP directory
(see Section 14.4.3, Step 2).
|
-
To dynamically unload your Kernel PlugIn, run this command:
# /sbin/rmmod kp_xxx_module
![[Tip]](scripts/images/tip.png) | |
|---|
To automatically load your Kernel PlugIn driver on each boot,
add the following line to the target's Linux boot file (for example,
/etc/rc.local), after the WinDriver driver module
(windrvr6) load command (replace
<path to kp_xxx_module.o/.ko>
with the path to your Kernel PlugIn driver module):
/sbin/insmod <path to kp_xxx_module.o/.ko> |