The Kernel Symbol Table
We’ve seen how insmod resolves undefined
symbols against the table of public kernel symbols. The table contains
the addresses of global kernel items—functions and
variables—that are needed to implement modularized drivers. The
public symbol table can be read in text form from the file
/proc/ksyms (assuming, of course, that your
kernel has support for the /proc
filesystem—which it really should).
When a module is loaded, any symbol exported by the module becomes
part of the kernel symbol table, and you can see it appear in
/proc/ksyms or in the output of the
ksyms command.
New modules can use symbols exported by your module, and you can stack new modules on top of other modules. Module stacking is implemented in the mainstream kernel sources as well: the msdos filesystem relies on symbols exported by the fat module, and each input USB device module stacks on the usbcore and input modules.
Module stacking is useful in complex projects. If a new abstraction is implemented in the form of a device driver, it might offer a plug for hardware-specific implementations. For example, the video-for-linux set of drivers is split into a generic module that exports symbols used by lower-level device drivers for specific hardware. According to your setup, you load the generic video module and the specific module for your installed hardware. Support for parallel ports and the wide variety of attachable devices is handled in the same way, as is the USB kernel ...