linux驱动--带传参数的helloworld驱动
来源:互联网 发布:淘宝卖家工具源码 编辑:程序博客网 时间:2024/06/06 03:06
驱动文件hellop.c
-----------------------------------------------------------
#include <linux/init.h>
#include <linux/module.h>
#include<linux/moduleparam>
static char *who="world";
static int howmany=1;
module_param(who,charp,S_IRUGO);
module_param(howmany,int,S_IRUGO);
static int _init hello_init(void)
{
int i;
for(i=0;i<howmany;i++)
{
prink(KERN_WARNING "%d"helllo,%s\n",i,who);
}
return 0;
}
static void _exit hello_exit(void)
{
prink(KERN_WARNING "goodbye world\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
--------------------------------------------------------------
可以用下面命令装载模块
insmod hellop howmany=10 who=“lwj”
阅读全文
0 0
- linux驱动--带传参数的helloworld驱动
- linux设备驱动--HelloWorld
- linux设备驱动--HelloWorld
- linux设备驱动--HelloWorld
- helloworld - linux驱动
- linux设备驱动--HelloWorld
- Linux驱动-HelloWorld
- Linux驱动开发HelloWorld
- linux驱动之helloworld
- linux驱动 -helloworld
- 简单Linux驱动Helloworld的实现
- Linux驱动最简单驱动-------helloworld
- linux内核驱动01-helloworld
- Linux驱动第一课--helloworld
- 驱动学习(2)WDK的HELLOWORLD驱动
- HelloWorld驱动
- Linux 设备驱动helloworld.ko的制作过程
- 15 linux驱动模块的参数
- Pat 1004. 成绩排名
- three.js 02-01 之场景基本功能
- 网站常用灰色,画线必备
- 解决ConstraintLayout两个组件挤压问题
- Java8 FunctionInterface
- linux驱动--带传参数的helloworld驱动
- Spring自定义属性转换器
- zoj-3826(字符串模拟)
- 原生JDBC连接总结
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
- abap中,ftp上传文件demo
- 深入理解Linux内核3
- 改变this指向的三种常用方法
- 算法练习专题——LeetCode系列之 ThreeSum