Linux????????????豸?????????????豸?????豸
???????????? ???????[ 2013/5/7 9:57:29 ] ????????
???????????
???????????linux??????????豸?????????????豸?????豸???????????????????????????????????????????????????????????豸???????
????????Linux????????豸??????
????Linux???豸?????????????????????????豸?????????????????/dev???£?????豸???????ó??????????????д??Щ?豸??????????豸?????????????????????????????????????Щ?豸??????豸??????????豸?????????豸?????豸??????豸??????????????????豸???????豸????????????????????豸??????????豸??Linux????????????????????豸?????豸????4??
?????豸?????????
??????????У?dev_t ????( ?? <linux/types.h>?????ж??? ) ????????豸??????????豸?????豸????????????? 2.6.x????dev_t???32λ???????и?12λ??????????豸?????20λ??????????豸???
?????? linux/types.h ??????????
????typedef __kernel_dev_t dev_t;
????typedef __u32 __kernel_dev_t;
???????豸?????豸?????
???????д??????????????????????????豸?????豸???λ?????????????У????豸?????豸???λ???????????????????MAJOR???????豸??????MINOR??????????豸??????????????????壺??linux/kdev_t.h??
????#define MINORBITS 20 /*???豸??*/
????#define MINORMASK ((1U << MINORBITS) - 1) /*???豸??????*/
????#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) /*dev????20λ??????豸??*/
????#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) /*????豸????????????豸??*/
????MAJOR??dev_t???????20λ????????豸???MINOR??dev_t???12λ??????????豸???????????????豸?????豸???????豸???????dev_t??????ú?MKDEV???????????????
????#define MKDEV(ma??mi) (((ma) << MINORBITS) | (mi))
????MKDEV?????豸???ma??????20λ?????????豸???mi?????????豸??
???????????豸?????????????豸?????豸????????
????Linux???????????????????????豸???????????豸????????????????????豸??????
????????????????????豸???key???????????????????????????????????豸???豸??????????????????????豸????????????????豸?????????????????????豸???????豸?????????????д??????????????????????????????????豸??????????????????豸?????????????????????豸????????????????????????????????????????豸????????顣??????????
?1????ó??????open?????????豸????????????
??????
???·???
??????????????????
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