字符设备驱动程序
时间:2009-05-31 来源:jj807
int register_chrdev_region(dev_t first,unsigned int count,char *name); //获得设备编号 |
分配主设备号的最佳方式是:默认采用动态分配,同时保留在加载甚至编译时指定主设备号的余地。
下面是scull.c中用来获取主设备号的代码:
if(scull_major){ |
时间:2009-05-31 来源:jj807
int register_chrdev_region(dev_t first,unsigned int count,char *name); //获得设备编号 |
分配主设备号的最佳方式是:默认采用动态分配,同时保留在加载甚至编译时指定主设备号的余地。
下面是scull.c中用来获取主设备号的代码:
if(scull_major){ |