字符驱动框架hellop
来源:互联网 发布:非农数据大于预期 编辑:程序博客网 时间:2024/05/16 04:45
文件放在/linux-3.0/drivers/char/hellop
***********************************************************
hellop.c
#include<linux/init.h>
#include<linux/module.h>
#include<linux/moduleparam.h>
static char *whom = "world";
static int howmany = 1;
module_param(howmany,int,0);
module_param(whom,charp,0);
static int hellop_init(void)
{
int i;
for(i=0;i<howmany;i++){
printk("++++++++my_hello,%s\n",whom);
}
return 0;
}
static void hellop_exit(void)
{
printk("Goodbye ,this is cruel world!\n");
}
module_init(hellop_init);
module_exit(hellop_exit);
MODULE_LICENSE("GPL");
~
*********************************************************
本层Makefile:
obj-$(CONFIG_HELLOP) += hellop.o
*********************************************************
本层Kconfig
config HELLOP
tristate "This is my_hellop module"
*******************************************************
上层Makefile
obj-$(CONFIG_HELLOP) += hellop.o
*******************************************************
上层Kconfig
source "drivers/char/hellop/Kconfig"
*******************************************************
/linux-3.0目录下.config
CONFIG_HELLOP=y
***************************************************
效果:make menuconfig
字符设备驱动中可以看到”This is my_hellop module“选相
- 字符驱动框架hellop
- 字符设备驱动框架
- 一步一步走进字符驱动--字符驱动框架
- Linux字符设备驱动框架
- linux 字符设备驱动框架
- Linux字符设备驱动框架
- linux ------ 字符设备驱动框架
- 内核字符设备驱动框架
- linux 字符设备驱动框架
- 字符设备驱动基本框架
- 【嵌入式】字符驱动开发框架
- 字符驱动之:基本框架
- 字符设备驱动框架分析
- Linux字符设备驱动框架
- SylixOS字符设备驱动框架
- 字符设备驱动框架1
- Linux字符设备驱动框架
- linux驱动字符设备框架
- 黑马程序员--高新技术--ClassLoader
- 字符编码基础
- Android vst全聚合桌面源码 电视机顶盒桌面
- framework层服务分析
- Maximal Rectangle
- 字符驱动框架hellop
- 学习笔记之OpenCV(1):Mat图像扫描
- C++中的typedef
- java中枚举
- C++中的typeid
- C++中的typename
- 【安卓笔记】notification使用
- C++中的using
- ZOJ-1088