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,它是可寻址的,寻址以块为单位,块大小随设备不同而不同:块设备通常支持重定位操作,也就是对 ...
随机推荐
- 一张图让你快速学会UML(聚合、组合、依赖、继承、接口、类)
有朋友反映,一上来直接讲设计模式就算理解了,也不知道如何画出类图,那么我们就通过一张图,来图解如何应用UML正确表示类与类之间的关系. 这张图完整讲述了鸟类的生存. 首先是类:在UML中,我们用分成三 ...
- Python自学笔记——Matplotlib风羽自定义
[前言]对于气象专业的小学生来说,风场是预报重要的参考数据,我们所知的风羽有四种:短线代表风速2m/s,长线代表风速4m/s,空心三角代表风速20m/s,实心三角代表风速50m/s.而matplotl ...
- C++ 处理 utf-8
类似"abc汉字"这样的字符串是以utf-8编码; C++ 的 cout执行的操作是把参数发送给stdout,因此如果终端支持utf-8, 汉字可以使用cout打印: 比较好的办法 ...
- dev gridcontrol把event事件转换成命令
可以通过继承gridcontrol的形式来实现 定义DataGridDoubleClickCommand依赖属性 class MyGridControl : GridControl { ...
- Linode VPS上架日本东京2号机房,性能速度评测报告(推荐)
我非常喜欢的海外免备案vps品牌linode日本机房长期缺货,中国用户想买都买不到.不过近日,陆续有国内朋友收到了Linode邀请,Tokyo 2日本东京机房开启内测,很快正式上架销售. 苦等太久的站 ...
- webservices(一)
---完全摘自网络 什么是webService WebService,顾名思义就是基于Web的服务.它使用Web(HTTP)方式,接收和响应外部系统的某种请求.从而实现远程调用. 1:从WebSer ...
- 面试题-Java基础-Applet部分
java applet是能够被包含在HTML页面中并且能被启用了java的客户端浏览器执行的程序.Applet主要用来创建动态交互的web应用程序.
- angular-ui-bootstrap插件API - Pagination
Pagination: 案例 <!DOCTYPE html> <html lang="en" ng-app="myApp"> <h ...
- swift3.0 原生GET请求 POST同理
swift3.0 原生GET请求 POST同理 func getrequest(){ let url = URL(string: "http://117.135.196.139:" ...
- OpenGL杂七杂八
Projection Matrix 投影矩阵 3D -> 2D PFD_DOUBLEBUFFER 双缓冲 在图形图象处理编程过程中,双缓冲是一种基本的技术.我们知道,如果窗体在响应WM_PAIN ...