Normally, to load a driver kernel extension dynamically on Mac OS X, you need to
use the OS's kextload utility, as super user
(root), and point the utility to the location of the kernel extension folder.
The entire path to the kernel extension folder must be owned by root:wheel,
with permissions non-writable by group and other – rwxr-xr-x
(755).
One way to ensure the necessary permissions, is to copy the driver's kernel
extension folder, as super user, to the /tmp
folder.
To reload the driver automatically on each boot, the kernel extension folder
should be copied to the OS's kernel extensions folder: /System/Library/Extensions.
(Note: On some Mac OS X platforms, the act of copying the kernel extension
folder to the /System/Library/Extensions folder also loads the driver, in which case
running kextload will result in a message
indicating that the driver is already loaded.)
WinDriver's wdreg installation script simplifies
the dynamic driver loading procedure on Mac OS X.
wdreg receives a path to a kernel extension
folder; if it locates the extension folder in the specified search path, it
copies the extension to the OS's /tmp folder in order
to ensure the proper permissions, and then uses the OS's
kextload utility to load the driver; if the
extension folder is not found in the search path,
wdreg searches for the extension in the OS's
kernel extensions folder – /System/Library/Extensions – and if a matching
extension is found, it is installed from this location.
![]() | |
|
To dynamically load a driver using wdreg, run
the following command:
sudo
<path to wdreg> <path to the driver's kext folder>
As indicated above, if the kernel extension folder is found in the OS's
/System/Library/Extensions folder, you may omit the path to the extension folder. For
example, to dynamically load the WinDriver kernel extension, which has been copied
to the /System/Library/Extensions folder (as done automatically as part of the WinDriver
toolkit installation), run this command:
sudo
<path to wdreg> WinDriver
To unload a driver dynamically on Mac OS X, you need to run the OS's
kextunload utility, and provide it with the
path to the driver's kernel extension folder:
sudo kextunload
<path to the driver's kext folder>
![]() | |
|
For example, to unload the WinDriver kernel extension, which has been copied to
the /System/Library/Extensions folder, run the following command:
sudo kextunload
/System/Library/Extensions/WinDriver.kext