static int __init my_init(void)
{初始化硬件(yìnɡ jiàn),注册设备,创立设备节点… }
static void __exit my_exit(void) {删除设备(shèbèi)节点,注销设备(shèbèi)… }
static struct file_operations my_fops = { 对文件操作结构体成员定义初始值… }
unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
int (*mmap) (struct file *, struct vm_area_struct *);
1 root
root
4, 65 Jan 1 00:00 ttyS1
1 root
root
4, 66 Jan 1 00:00 ttyS2
1 root
root
4, 67 Jan 1 00:00 ttyS3
1 root
root
4, 68 Jan 1 00:00 ttyS4
1 root
root
0 Jan 1 00:00 misc
root
1, 8 Jan 1 00:00 random
1 root
root
1, 9 Jan 1 00:00 urandom
1 root
root
5, 0 Jan 1 00:00 tty
1 root
root
5, 1 Jan 1 00:00 console