
linux驱动编程
linuxchyu
这个作者很懒,什么都没留下…
展开
-
Linux字符驱动中动态分配设备号与动态生成设备节点
首先说明主设备号与次设备号 一个字符设备或者块设备都有一个主设备号和次设备号。主设备号和次设备号统称为设备号。主设备号用来表示一个特定的驱动程序。次设备号用来表示使用该驱动程序的各设备。例如一个嵌入式系统,有两个LED指示灯,LED灯需要独立的打开或者关闭。那么,可以写一个LED灯的字符设备驱动程序,可以将其主设备号注册成5号设备,次设备号分别为1和2。这里,次设备号就分别表示两个LED灯转载 2013-01-11 21:09:39 · 611 阅读 · 0 评论 -
linux内核模块学习hellomod
源代码:#include #include #include static int __init lkp_init(void){ printk("(1) Hello World ! from the kernel space\n"); return 0;}static void __exit lkp_cleanup(void){原创 2013-01-11 21:03:05 · 629 阅读 · 0 评论 -
error: void value not ignored as it ought to be
在编译字符设备驱动文件时出现了一个 error: void value not ignored as it ought to be 错误。 本人表示非常恼火。问题出在: int ret = unregister_chrdev(Major,DEVICE_NAME); 编译器检测到在文件中,unregister_chrdev函数没有返回值。 而我在搜了一下头文件。在http://stud转载 2013-01-11 21:46:40 · 1489 阅读 · 0 评论 -
warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和
今天在些key的driver的时候。。。写完了编译出现一个warmming如下:warning: passing argument 2 of 'request_irq' from incompatible pointer type我的request_irq函数调用如下:if(request_irq(key_info->irq_no, key_eint_handler, IRQF转载 2013-03-03 17:26:14 · 1785 阅读 · 0 评论