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:

  1. static char *whom = "world";
  2. ;
  3. module_param(howmany, int, S_IRUGO);
  4. 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:

  1. 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. Xamarin原生跨平台概述(精简概述,命中要害。PS:无图)

    Xamarin原生跨平台:原生界面.原生性能.原生API(与H5比较): 1.C#可以访问Andrid.IOS原生API,也可以调用C#系统类型,如Syetem,System.IO;2.原理:基于Mo ...

  2. 高可用的池化 Thrift Client 实现(源码分享)

    本文将分享一个高可用的池化 Thrift Client 及其源码实现,欢迎阅读源码(Github)并使用,同时欢迎提出宝贵的意见和建议,本人将持续完善. 本文的主要目标读者是对 Thrift 有一定了 ...

  3. ssi-uploader上传图片插件,点击选择文件按钮自动提交表单解决办法

    先介绍一下这款插件,然后再谈使用中可能遇到的问题 ssi-uploader是一个JQuery的图片上传插件,界面比较美观 github地址:https://github.com/ssbeefeater ...

  4. C#中yield关键字理解

    yield关键字之前用得较少,但是在做项目开发的过程中也遇到了,当时有点迷惑,就顺便研究学习了一下,以下是个人理解,不到之处欢迎拍砖!废话就到这,上代码: class Program { static ...

  5. BTE 增强

    BTE的设计思路还是比较简单,和BADI有点类似.在标准程序中留有OPEN_FI的出口(以函数OPEN_FI_PERFORM_event id_type的形式存在),然后提供一个可配置的TABLE,可 ...

  6. Access一些常用的SQL语句

    您可以将 Microsoft Office Access 2013 用作创建.修改数据库以及处理数据的工具,还可将 Office Access 2013 用作服务器数据库管理系统(如 Microsof ...

  7. Url Rewrite IIS 配置

    在configuration节点下 <system.webServer> <rewrite> <rules> <rule name="rD" ...

  8. Logstash利用GeoIP库显示地图以及通过useragent显示浏览器(四)

    我们通过Logstash收集的Nginx Access log中已经包含了客户端IP的数据(remote_addr),但是只有这个IP还不够,要在Kibana的显示请求来源的地理位置还需要借助GeoI ...

  9. python json数组对象排序

    arr = [{"name": "name_1", "level": 1}, {"name": "name_2 ...

  10. 原图旋转/缩放 然后画布画图 ImageProcessor

    //旋转 byte[] photoBytes = File.ReadAllBytes(HttpContext.Current.Server.MapPath(diyInfo.ImageUrl)); Im ...