Parameter values can be assigned at load time by insmod or modprobe(this can read parameter from configuration file /etc/modeprobe.conf).

  While you type the paras in command line, the paras should also be declared with the module_para marco in codes:

 static char *whom = "world";
 ;
 module_param(howmany, int, S_IRUGO);
 module_param(whom, charp, S_IRUGO);

The types of para are as following:

    bool/invbool(true->false, false->true)

    charp(a char pointer)

    integer(int, long, short, uint, ulong, ushort)

    array(values should be supplied as a comma-separated list)

The array parameter is declared in a different way:

 module_param_array(name,type,nump,perm);  

  Where name is the name of your array (and of the parameter), type is the type of thearray elements, nump is an integer variable, and perm is the usual permissions value. Ifthe array parameter is set at load time, nump is set to the number of values supplied.The module loader refuses to accept more values than will fit in the array.

  TO define a type of para not defined above, see modulepara.h.

  The final module_param fieldis a permission value, which is defiend in <linux/stat.h>. If perm is set to 0, there is no sysfs;otherwise, it appears under /sys/module with the givern set of permissions. Usually use S_IRUGO for those that only can be read. If you are read to detect the change of the paras and react, S_IRUGO| S_IWUSR would allow root to change the paras.

module parameters的更多相关文章

  1. 关于sru源码class Model的parameters

    class Model(nn.Module): def __init__(self, words, args): super(Model, self).__init__() self.args = a ...

  2. module加载过程初步分析[更新中]【转】

    转自:http://blog.chinaunix.net/uid-1817735-id-2837068.html 分析这个过程可以有助于我们认识在加载模块时出现的问题大抵在哪里了. 直接从sys_in ...

  3. 《linux内核设计与实现》读书笔记第十七章

    第17章 设备与模块 四种内核成分 设备类型:在所有 Unix 系统中为了统一普通设备的操作所采用的分类. 模块: Linux 内核中用于按需加载和卸载目标码的机制. 内核对象:内核数据结构中支持面向 ...

  4. 《Linux内核设计与实现》CHAPTER17阅读梳理

    <Linux内核设计与实现>CHAPTER17阅读梳理 [学习时间:3.5hours] [学习内容:设备类型,模块,内核对象,sysfs] 个人思考部分见[]标出的部分 一.课堂讲解整理& ...

  5. RHEL 6.5 PXE 安装调试 VMWARE ESXi 5.1 安装

    测试环境:win10/vmware workstation 12 pro 操作系统:RHEL 6.5(PXE服务器) [2016.11.30] [遗留问题] 1.ks.cfg通过本地文件方式加载不成功 ...

  6. Yii源码阅读笔记(二十二)

    Module类,属性的注释和构造函数的注释: <?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) ...

  7. grub paramiter & menu.list

    在Linux中,给kernel传递参数以控制其行为总共有三种方法: 1.build kernel之时的各个configuration选项. 2.当kernel启动之时,可以参数在kernel被GRUB ...

  8. linux dynamic debug 官方教程

    下载内核后,文档在:Documentation/dynamic-debug-howto.txt 中文版本:http://www.oschina.net/translate/dynamic-debug- ...

  9. 《Linux内核设计与实现》读书笔记 第十七章 设备与模块

    一.设备类型 1. Unix系统 - 块设备 - 字符设备 - 网络设备 2. 块设备 通常缩写为blkdev,它是可寻址的,寻址以块为单位,块大小随设备不同而不同:块设备通常支持重定位操作,也就是对 ...

随机推荐

  1. HDU--1006

    题目介绍 Problem Description The three hands of the clock are rotating every second and meeting each oth ...

  2. Python第一天——入门Python(1)数据定义

    数据类型: 什么是数据? 在计算机科学中,数据是指所有能输入到计算机并被计算机程序处理的符号的介质的总称,是用于输入电子计算机进行处理,具有一定意义的数字字母.符号和模拟量等的统称.现在计算机存储和处 ...

  3. SQL如何获取时间的方法?

    getdate():当前系统日期与时间 DATEADD(DAY,5,GETDATE()):当前日期的基础上加上x天 DATEDIFF(DAY,'2017-01-02','2017-01-13'):返回 ...

  4. oracle登录时shared memory realm does not exist的解决方法

    解决办法:1.用CMD进入命令行2.sqlplus /nolog 3.conn / as sysdba4.startup   然后用sqlplus进入命令  

  5. [MFC美化] SkinMagic使用详解1- SkinMagic使用流程

    [SkinMagic使用流程] 1.工程配置SkinMagic相关文件 2.初始化SkinMagic皮肤文件,窗体加载皮肤 3.释放皮肤资源 特别声明,SkinMagic要是破解版的,如果不是,可能需 ...

  6. RubyMine 2016.1 下载 附注册激活码 破解版方法

    注册破解方法: 在要求输入注册的界面选择激活码,然后粘贴以下注册码: 43B4A73YYJ-eyJsaWNlbnNlSWQiOiI0M0I0QTczWVlKIiwibGljZW5zZWVOYW1lIj ...

  7. Centos7下建立rubymine快捷方式到侧栏或桌面

    gnome桌面的所有菜单项都存储如下位置: /usr/share/applications/ 新建一个菜单项,直接在该目录下新建一个后缀名为.desktop的文件即可. $ vi /usr/share ...

  8. 自定义报表开发(HTML/XML)

    定义报表执行的包或存储过程: --创建包头 CREATE OR REPLACE PACKAGE XXPLM_AARONTEST001 IS PROCEDURE MAIN(errbuf OUT VARC ...

  9. POJ 2104:K-th Number(整体二分)

    http://poj.org/problem?id=2104 题意:给出n个数和m个询问求区间第K小. 思路:以前用主席树做过,这次学整体二分来做.整体二分在yr大佬的指点下,终于大概懂了点了.对于二 ...

  10. CentOS 7中将Tomcat设置为系统服务

    tomcat 需要增加一个pid文件,在tomca/bin 目录下面,增加 setenv.sh 配置,catalina.sh启动的时候会调用,在该文件中添加如下内容 CATALINA_PID=&quo ...