April 2012
Intermediate to advanced
352 pages
8h
English
A device driver can be either statically compiled into the system or dynamically loaded using a loadable kernel module (KLD).
Most operating systems call a loadable kernel module an LKM—FreeBSD just had to be different.
A KLD is a kernel subsystem that can be loaded, unloaded, started, and stopped after bootup. In other words, a KLD can add functionality to the kernel and later remove said functionality while the system is running. Needless to say, our “functionality” will be device drivers.
In general, two components are common to all KLDs:
A module event handler
A DECLARE_MODULE macro call
A module event handler is the function that handles the initialization and shutdown of a KLD. This function is executed ...
Read now
Unlock full access