Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linuxÉ豸Çý¶¯³ÌÐò——×Ö·ûÉ豸Çý¶¯³ÌÐò

ÔÚLinux²Ù×÷ϵͳÏÂÓÐ3ÀàÖ÷ÒªµÄÉ豸ÎļþÀàÐÍ£º¿éÉ豸¡¢×Ö·ûÉ豸ºÍÍøÂçÉ豸¡£ÕâÖÖ·ÖÀà·½·¨¿ÉÒÔ½«¿ØÖÆÊäÈë/Êä³öÉ豸µÄÇý¶¯³ÌÐòÓëÆäËû²Ù×÷ϵͳÈí¼þ·ÖÀ뿪À´¡£×Ö·ûÉ豸ÊÇÖ¸´æȡʱûÓлº´æµÄÉ豸¡£µäÐ͵Ä×Ö·ûÉ豸°üÀ¨Êó±ê¡¢¼üÅÌ¡¢´®Ðпڵȡ£
×Ö·ûÉ豸Óë¿éÉ豸µÄÖ÷ÒªÇø±ðÊÇ£ºÔÚ¶Ô×Ö·ûÉ豸·¢³ö¶Á/дÇëÇóʱ£¬Êµ¼ÊµÄÓ²¼þI/OÒ»°ã½ô½Ó×Å·¢Éú¡£¿éÉ豸Ôò²»È»£¬ËüÀûÓÃÒ»¿éϵͳÄÚ´æ×÷Ϊ»º³åÇø£¬ÈôÓû§½ø³Ì¶ÔÉ豸µÄÇëÇóÄÜÂú×ãÓû§µÄÒªÇ󣬾ͷµ»ØÇëÇóµÄÊý¾Ý£»·ñÔò£¬¾Íµ÷ÓÃÇëÇóº¯ÊýÀ´½øÐÐʵ¼ÊµÄI/O²Ù×÷¡£¿éÉ豸Ö÷ÒªÊÇÕë¶Ô´ÅÅ̵ÈÂýËÙÉ豸Éè¼ÆµÄ£¬ÒÔÃâºÄ·Ñ¹ý¶àµÄCPUʱ¼äÓÃÀ´µÈ´ý¡£ÍøÂçÉ豸¿ÉÒÔͨ¹ýBSDÌ×½Ó¿Ú·ÃÎÊÊý¾Ý¡£
Ò».Ö÷É豸ºÅºÍ´ÎÉ豸ºÅ
Ö÷É豸ºÅ±êʶÉ豸¶ÔÓ¦µÄÇý¶¯³ÌÐò£»´ÎÉ豸ºÅÓÉÄÚºËʹÓã¬ÓÃÓÚÕýÈ·È·¶¨É豸ÎļþËùÖ¸µÄÉ豸¡£ÎÒÃÇ¿ÉÒÔͨ¹ý´ÎÉ豸ºÅ»ñµÃÒ»¸öÖ¸ÏòÄÚºËÉ豸µÄÖ±½ÓÖ¸Õ룬Ҳ¿É½«´ÎÉ豸ºÅµ±×÷É豸±¾µØÊý×éµÄË÷Òý£¬²»¹ÜÓÃÄÄÖÖ·½Ê½£¬³ýÁËÖªµÀ´ÎÉ豸ºÅÓÃÀ´Ö¸ÏòÇý¶¯³ÌÐòËùʵÏÖµÄÉ豸֮Í⣬Äں˱¾Éí»ù±¾Éϲ»¹ØÐĹØÓÚ´ÎÉ豸ºÅµÄÈκÎÆäËûÏûÏ¢¡£
¡òÉ豸±àºÅµÄÄÚ²¿±í´ï
ÄÚºËÓÃdev_tÀàÐÍ£¨<linux/types.h>£©À´±£´æÉ豸±àºÅ£¬dev_tÊÇÒ»¸ö32λµÄÊý£¬12λ±íʾÖ÷É豸ºÅ£¬20λ±íʾ´ÎÉ豸ºÅ¡£
ÔÚʵ¼ÊʹÓÃÖУ¬ÊÇͨ¹ý<linux/kdev_t.h>Öж¨ÒåµÄºêÀ´×ª»»¸ñʽ¡£
 (dev_t)-->Ö÷É豸ºÅ¡¢´ÎÉ豸ºÅ       MAJOR(dev_t dev)     MINOR(dev_t dev)
 Ö÷É豸ºÅ¡¢´ÎÉ豸ºÅ-->(dev_t)       MKDEV(int major,int minor) 
¡ò·ÖÅäºÍÊÍ·ÅÉ豸±àºÅ
½¨Á¢Ò»¸ö×Ö·ûÉ豸֮ǰ£¬Çý¶¯³ÌÐòÊ×ÏÈÒª×öµÄÊÂÇé¾ÍÊÇ»ñµÃÉ豸±àºÅ¡£ÆäÕâÖ÷Òªº¯ÊýÔÚ<linux/fs.h>ÖÐÉùÃ÷£º
int register_chrdev_region(dev_t first, unsigned int count,char *name);   //Ö¸¶¨É豸±àºÅ
int alloc_chrdev_region(dev_t *dev, unsigned int firstminor,unsigned int count, char *name);   //¶¯Ì¬Éú³ÉÉ豸±àºÅ
void unregister_chrdev_region(dev_t first, unsigned int count);      //ÊÍ·ÅÉ豸±àºÅ 
·ÖÅäÖ®É豸ºÅµÄ×î¼Ñ·½Ê½ÊÇ£ºÄ¬ÈϲÉÓö¯Ì¬·ÖÅ䣬ͬʱ±£ÁôÔÚ¼ÓÔØÉõÖÁÊDZàÒëʱָ¶¨Ö÷É豸ºÅµÄÓàµØ¡£
¡ò¶¯Ì¬·ÖÅäÖ÷É豸ºÅ
    Ä³Ð©Ö÷É豸ºÅÒѾ­¾²Ì¬µØ·ÖÅä¸øÁ˴󲿷ֹ«ÓÃÉ豸¡£ÔÚÄÚºËÔ´ÂëÊ÷µÄDocumentation/device.txt


Ïà¹ØÎĵµ£º

£¨×ª£©¾­µä£ºLinux²ËÄñÈëÃż¶ÃüÁî´óÈ«

1. man ¶ÔÄãÊìϤ»ò²»ÊìϤµÄÃüÁîÌṩ°ïÖú½âÊÍ
eg:man ls ¾Í¿ÉÒԲ鿴lsÏà¹ØµÄÓ÷¨
×¢£º°´q¼ü»òÕßctrl+cÍ˳ö£¬ÔÚlinuxÏ¿ÉÒÔʹÓÃctrl+cÖÕÖ¹µ±Ç°³ÌÐòÔËÐС£
2. ls ²é¿´Ä¿Â¼»òÕßÎļþµÄÊô*£¬ÁоٳöÈÎһĿ¼ÏÂÃæµÄÎļþ
eg: ls /usr/man
ls -l
a.d±íʾĿ¼(directory)£¬Èç¹ûÊÇÒ»¸ö"-"±íʾÊÇÎļþ£¬Èç¹ûÊÇlÔò±íʾÊÇÒ»¸öÁ¬½ÓÎļþ ......

ʵսLinux Bluetooth±à³Ì£¨¶þ£© BlueZ¼ò½é

LinuxÏÂBluetoothЭÒéÕ»µÄʵÏÖ. LinuxÏ¿ª·ÅµÄÀ¶ÑÀЭÒéÕ»Ö÷Òª°üÀ¨IBM¹«Ë¾µÄBlueDrekar£¬Nokia¹«Ë¾µÄAffix, Axis¹«Ë¾µÄOpenBTºÍ¹Ù·½Ð­ÒéÕ»BlueZ¡£ÎÒÃÇÖ÷ÒªÃæ¶ÔBluezÀ´Ì½ÌÖ¡£
BlueZ»ù´¡´úÂë¾ùÊÇÓÉMaxim KrasnyanskyÍê³ÉµÄ¡£°üÀ¨£ºHCI£¬L2CAP£¬RFCOMMºÍ»ù±¾socketµÄʵÏÖ¡£Ëû¾ÍÖ°ÓÚQualcomm(¸ßͨ)¡£Marcel Holtmann¿ª·¢²ãµÄÐ­Ò ......

LinuxÏÂc¿ª·¢ Ö® Ïß³ÌͨÐÅ

1.Linux“Ï߳̔
     ½ø³ÌÓëÏß³ÌÖ®¼äÊÇÓÐÇø±ðµÄ£¬²»¹ýLinuxÄÚºËÖ»ÌṩÁËÇáÁ¿½ø³ÌµÄÖ§³Ö£¬Î´ÊµÏÖÏß³ÌÄ£ÐÍ¡£LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£Linux±¾ÉíÖ»Óнø³ÌµÄ¸ÅÄ¶øÆäËùνµÄ“Ï߳̔±¾ÖÊÉÏÔÚÄÚºËÀïÈÔÈ»Êǽø³Ì¡£
     ´ó¼Ò ......

LinuxϹ²ÏíÎļþϵͳÎļþ´«ÊäµÄ¼òµ¥Éè¼Æ£¨×ªÔØ£©

¹²ÏíÎļþϵͳÎļþ´«Ê䣬ÊÇÍøÂçÕì¿ØÏîÄ¿ÖеÄÒ»¸öʵ¼Ê²Ù×÷¡£ËüÊÇΪÁ˵ÖÖÆÈëÇÖÕß½øÈëÄÚÍø¶øÌá³öµÄÒ»ÖÖ°²È«½â¾ö·½°¸¡£ÔÚʵ¼Ê´«Êä¹ý³ÌÖУ¬ÍØÆËͼÈçÏ£º
ʵ¼Ê»·¾³¾ùÔÚLinuxÖ÷»úϽøÐС£²ÉÓÃOCFS2Îļþ¼¯ÈºµÄ·½Ê½¡£ÍⲿÖ÷»úAºÍÄÚ²¿Ö÷»úBÖ®¼äµÄͨѶ£¬¾ùͨ¹ý¹²Ïí´æ´¢¿Õ¼äC½øÐнÓÊܺͷ¢ËÍ¡£ÕâÑù¼´Ê¹ÈëÇÖÕßÄÃÏÂÍⲿÖ÷»úA£¬Ò²ÎÞ·¨Éø͸ÄÚ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ