module parameters
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的更多相关文章
- 关于sru源码class Model的parameters
class Model(nn.Module): def __init__(self, words, args): super(Model, self).__init__() self.args = a ...
- module加载过程初步分析[更新中]【转】
转自:http://blog.chinaunix.net/uid-1817735-id-2837068.html 分析这个过程可以有助于我们认识在加载模块时出现的问题大抵在哪里了. 直接从sys_in ...
- 《linux内核设计与实现》读书笔记第十七章
第17章 设备与模块 四种内核成分 设备类型:在所有 Unix 系统中为了统一普通设备的操作所采用的分类. 模块: Linux 内核中用于按需加载和卸载目标码的机制. 内核对象:内核数据结构中支持面向 ...
- 《Linux内核设计与实现》CHAPTER17阅读梳理
<Linux内核设计与实现>CHAPTER17阅读梳理 [学习时间:3.5hours] [学习内容:设备类型,模块,内核对象,sysfs] 个人思考部分见[]标出的部分 一.课堂讲解整理& ...
- RHEL 6.5 PXE 安装调试 VMWARE ESXi 5.1 安装
测试环境:win10/vmware workstation 12 pro 操作系统:RHEL 6.5(PXE服务器) [2016.11.30] [遗留问题] 1.ks.cfg通过本地文件方式加载不成功 ...
- Yii源码阅读笔记(二十二)
Module类,属性的注释和构造函数的注释: <?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) ...
- grub paramiter & menu.list
在Linux中,给kernel传递参数以控制其行为总共有三种方法: 1.build kernel之时的各个configuration选项. 2.当kernel启动之时,可以参数在kernel被GRUB ...
- linux dynamic debug 官方教程
下载内核后,文档在:Documentation/dynamic-debug-howto.txt 中文版本:http://www.oschina.net/translate/dynamic-debug- ...
- 《Linux内核设计与实现》读书笔记 第十七章 设备与模块
一.设备类型 1. Unix系统 - 块设备 - 字符设备 - 网络设备 2. 块设备 通常缩写为blkdev,它是可寻址的,寻址以块为单位,块大小随设备不同而不同:块设备通常支持重定位操作,也就是对 ...
随机推荐
- 一起来玩echarts系列(二)------echarts图表自适应问题
为了直观查看公司服务器各个进程占用的内存动态情况,我使用echarts进行数据可视化,具体的实现过程按下不表. 最后实现的效果如图: 然后问题就来了,因UI采用了Bootstrap响应式框架,所以除了 ...
- apns关于APP数字角标的理解
前两天群里有兄弟在吐槽,做远程推送的时候:老板要求APP桌面图标的右上角显示红色未读数字(数字角标)要精准,有多少未读通知就显示数字几:但是后台的弟兄在发送推送通知的时候,每次的角标是1,然后要移动端 ...
- Node.js学习笔记(二):模块
模块是 Node.js 应用程序的基本组成部分,文件和模块是一一对应的.一个 Node.js 文件就是一个模块,这个文件可能是 JavaScript 代码.JSON 或者编译过的 C/C++ 扩展. ...
- 【Java每日一题】20170111
20170110问题解析请点击今日问题下方的"[Java每日一题]20170111"查看(问题解析在公众号首发,公众号ID:weknow619) package Jan2017; ...
- 果园种植系统开发App,游戏+商业模式?
果园种植全返系统开发,英伦果园开发,微信果园种植系统开发,百果生态乐园开发,淘金农夫开发,农场果园种植游戏系统,果园种植APP系统开发,果园种植软件开发找陈牧150-1315-1740(微/电)开发者 ...
- JavaScript中String.prototype.replace() 方法的使用
摘抄于:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replace ...
- 关于AVL实现的代码记录
试题集合: https://www.patest.cn/contests/pat-a-practise/1064 https://www.patest.cn/contests/pat-a-practi ...
- CentOS7 离线安装gcc/pcre-devel/openssl-devel/zlib-devel
1. 解压CentOS7操作系统安装镜像,进入到CentOS-7.0-1406-x86_64-DVD\Packages目录,这下面存储了很多rpm包. 2. 找到下面列出的rpm包,上传到CentOS ...
- Ubuntu中Qt5.7.0的安装及opencv2.4.13配置
去官网下载qt-opensource-linux-x64-5.7.0.run,到"下载"目录 Ctrl+Alt+T打开终端 cd /home/jv/下载sudo mv qt-ope ...
- C语言调用lua
在lua API中,调用一个函数的步骤很简单: 1.压入你要调用的函数,使用lua_getglobal. 2.压入调用参数. 3.使用lua_pcall 4.从栈中弹出结果. 举例说明,假设你有这 ...