#include
#include
#include
#include
MODULE_LICENSE("GPL");
MODULE_AUTHOR("LZ");
#define DEV_NAME "lzz"
static void read_hello();
static void write_hello();
truct file_operation lz_fops=
{
.read=read_hello,
.write=write_hello,
};
static int _init lz_init(void)
{
int ret;
ret=register_chrdev(0,DEV_NAME,&lz_fops)
printk("OK INTI\n")i;
return ret;
}
static int _exit lz_exit(void)
{
unregister_chrdev(0,DEV_NAME);
printk("KO EXIT\n");
return ;
}
static void read_hello()
{
printk("open_hello\n");
}
static void write_hello()
{
printk(KERN_ALERT"write_hello");
}
module_init(lz_init);
module_exit(lz_exit);
我insmod之后在proc/devices中找不到对应的主设备号和设备名是怎么回事?但我lsmod找的到设备名
阅读(1252) | 评论(0) | 转发(0) |