红联Linux门户
Linux帮助

linux2.4与2.6下的开发字符驱动的差别

发布时间:2008-03-25 00:21:31来源:红联作者:Dnirta
struct file_operation的定义方式变了:

2.4中 一般为read:xxread

2.6改为.read=xxread

字符设备驱动的注册方法不同:

2.6内核的注册方法

(1)静态注册
int register_chrdev_region(dev_t from, unsigned count, char *name);

(2)动态注册
int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count, char *name);

2.4内核的注册方法
int register_chrdev(unsigned major, char * name, struct file_operation * fops);

2.4内核仅仅生成.o文件,2.6内核的模块扩展名是.ko
文章评论

共有 0 条评论