/* angus - Simple program to open,release,read,write */
#include<linux/fs.h>
#include<linux/uaccess.h>
#include<linux/slab.h>
#include<linux/gfp.h>
char *my_buff;
int major = -1;
int my_open(struct inode *inodes, struct file *files);
int my_release(struct inode *inodes, str
我正在使用内核3.13.0编写Linux设备驱动程序,我不明白为什么会收到这个警告。
warning: initialization from incompatible pointer type [enabled by default]
.read = read_proc,
^
warning: (near initialization for ‘proc_fops.read’) [enabled by default]
据我所知,proc函数的file_operations设置与设备函数相同。我可以读/写/dev/MyDevice,没有问题,也没有警告。proc writ
我成功地在/dev文件夹下创建了设备文件,但是写入该设备文件会使内核抛出以下错误消息。
Message from syslogd@beaglebone at Feb 26 15:40:10 ... kernel:[10090.943733] Internal error: : 1b [#3] PREEMPT SMP ARM
Message from syslogd@beaglebone at Feb 26 15:40:10 ... kernel:[10091.049020] Process echo (pid: 3728, stack limit = 0xdc40a218)
Message