Linux????????豸???
???????????? ???????[ 2014/1/27 11:08:50 ] ????????Linux ?豸 ???
????????????MISC???豸?????????????????
misc->this_device = device_create(misc_class?? misc->parent?? dev??
misc?? "%s"?? misc->name);
???????У?
struct miscdevice * misc??
struct device *this_device;
static struct class *misc_class;
struct device *parent;
dev = MKDEV(MISC_MAJOR?? misc->minor); //?豸??
misc->name //?豸????????
?????????????????????????????豸????????????????linux-3.0????μ??
??????linux???2.6????????????豸??????????????????????????????class_create????豸???????class?????????豸???? class_device_create??????????豸???????÷????£?
????struct class *myclass = class_create(THIS_MODULE?? “my_device_driver”);
????//????????????????????????????sysfs????
????class_device_create(myclass?? NULL?? MKDEV(major_num?? 0)?? NULL?? “my_device”);
????//??/dev???′?????????豸???
?????????????/include/linux/device.h??
????????????汾?????????????? device_create
??????????module?????????udev daemon ???????? device_create(…)???????/sysfs?????????????????????/dev?′???my_device?豸?????
???????????????device_create_file????????????
????err = device_create_file(dev?? attr);
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11