One. Optional signal for kernel modules
1. Module declaration
(1). Module_license (Compliance Agreement)
Affirm the license agreement that the module complies with, such as: "GPL", "GPL V2"
(2). Module_author (author)
Author of the Application module
(3). module_description (function description of the module)
Function of the application module
(4). Module_version (v1.0)
Version of the application module
2. Module parameters
The variable that holds the module parameter is specified by the macro Module_param. Module parameters are used to pass parameters to the module when the module is loaded.
Module_param (Name,type,perm)
#name: The name of the variable
#type: Variable type, BOOL: Boolean int: Integral type charp: String type
#perm是访问权限. S_irugo: Read permission s_iwusr: Write permission
#例:
int a = 3;
Char *st;
Module_param (A,int, S_irugo);
Module_param (St,charp, S_irugo);
3. Symbol output (export the symbol inside the kernel module, the output value can be called by other kernel modules)
Export of kernel symbols using macros
Export_symbol (symbol name)
EXPORT_SYMBOL_GPL (symbol name)
Description: Where EXPORT_SYMBOL_GPL can only be used for modules that contain GPL licenses.
Optional signal for Linux kernel modules