内核版本 Linux version 5.8.0-44-generic mydev.c #include <linux/module.h>#include <linux/moduleparam.h>#include <linux/init.h>#include <linux/kernel.h> #include <linux/proc_fs.h>#include <asm/uaccess.h> #define BUFSIZE 100 static int irq = 20; static int mode = 1; static struct proc_dir_entry *ent; static ssize_t mywrite(struct file *file, const char __user *ubuf, size_t count, loff_t *ppos) { int num, c, i, m; char buf[BUFSIZE] = {0}; if (*ppos > 0 || count > BUFSIZE) return -EFAULT; if (copy_from_user(buf, ubuf, count))……
阅读全文