First page Back Continue Last page Overview Graphics
Hello module explanations
Headers specific to the Linux kernel: <linux/xxx.h>
- No access to the usual C library, we're doing kernel programming
An initialization function
- Called when the module is loaded, returns an error code (0 on success, negative value on failure)
- Declared by the module_init() macro: the name of the function doesn't matter, even though modulename_init() is a convention.
A cleanup function
- Called when the module is unloaded
- Declared by the module_exit() macro.
Metadata informations declared using MODULE_LICENSE(), MODULE_DESCRIPTION() and MODULE_AUTHOR()