Optional signal for Linux kernel modules

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.