ARMǶÈëʽLinuxϵͳ¿ª·¢Ïê½â——Ç°ÑÔ
Ç° ÑÔ
Ëæ×ų¬´ó¹æÄ£¼¯³Éµç·µÄ·¢Õ¹£¬¼ÆËã»ú´¦ÀíÆ÷¼¼Êõ²»¶ÏÌá¸ß£¬¼ÆËã»úоƬµÄ´¦ÀíÄÜÁ¦Ô½À´Ô½Ç¿£¬Ìå»ýÔ½À´Ô½Ð¡£¬¼ÆËã»ú¼¼ÊõÓ¦Óõ½Éú»îµÄ·½·½ÃæÃæ¡£ÓëÈËÃÇÈÕ³£Éú»î´ò½»µÀ×î¶àµÄ¾ÍÊÇǶÈëʽϵͳ£¬´ÓÄ¿Ç°¹ã·ºÊ¹ÓõÄÊÖ»ú¡¢MP3²¥·ÅÆ÷µ½¼ÒÓõçÆ÷£¬Ç¶ÈëʽϵͳµÄÓ¦ÓÃÎÞ´¦²»ÔÚ¡£Ç¶ÈëʽϵͳµÄ¿ª·¢Õ¼Õû¸ö¼ÆËã»úϵͳ¿ª·¢µÄ±ÈÖØÒ²Ô½À´Ô½¸ß¡£
ǶÈëʽϵͳ¿ª·¢Ó봫ͳµÄPC³ÌÐò¿ª·¢²»Í¬¡£Ç¶Èëʽϵͳ¿ª·¢Éæ¼°Èí¼þÓ²¼þµÄ¿ª·¢£¬ÊÇÒ»¸öÐͬ¹¤×÷µÄͳһÌ塣Ŀǰ£¬ÒѾÓÐÐí¶àµÄǶÈëʽϵͳӲ¼þºÍ²Ù×÷ϵͳÈí¼þ£¬ÆäÖÐÓ¦ÓÃ×î¹ã·ºµÄÊÇARMǶÈëʽ´¦ÀíÆ÷ºÍLinuxϵͳ£¬±¾ÊéÒ²½«ÒÔARM´¦ÀíÆ÷ºÍLinux×÷Ϊ½²½â¶ÔÏ󣬰ïÖú¶ÁÕß½øÈëǶÈëʽ¿ª·¢ÁìÓò¡£
ĿǰǶÈëʽ¿ª·¢µÄÊé¼®ÖÖÀà·±¶à£¬µ«ÊÇÄÚÈݶ¼±È½ÏÓÐÕë¶ÔÐÔ¡£Ö÷Òª¿ÉÒÔ·Ö³É3À࣬һÀàÊDzàÖØǶÈëʽӲ¼þ¿ª·¢£»Ò»Àà²àÖØǶÈëʽ²Ù×÷ϵͳÔÀíºÍÉ豸Çý¶¯¿ª·¢£»»¹ÓÐÒ»ÀàÊÇÕë¶ÔǶÈëʽϵͳӦÓóÌÐò¿ª·¢¡£ÓÉÓÚÒÔÉÏ3ÀàͼÊ鶼ÊÇÕë¶Ôij¸öÌض¨ÁìÓò±àдµÄ£¬ÄÚÈÝÕë¶ÔÐÔÇ¿£¬²»±ãÓÚ³õѧÕßѧϰ¡£
±¾Êé´ÓǶÈëʽ³õѧÕߵĽǶȳö·¢£¬Á¦ÇóÓÉdzÈëÉîµØ½éÉÜǶÈëʽϵͳ¿ª·¢µÄ¸÷²¿·Ö֪ʶ£¬°ïÖú³õѧÕß¿ìËÙ½øÈëǶÈëʽ¿ª·¢ÁìÓò£¬ÕÆÎÕǶÈëʽ¿ª·¢µÄ»ù±¾¼¼Êõ¡£
±¾ÊéÌØÉ«
1£®ÅäÊÓƵ½²½â¹âÅÌ
ΪÁËÈöÁÕ߸ü¼Ó¿ìËÙ¡¢Ö±¹ÛµØѧϰ±¾ÊéÄÚÈÝ£¬×÷ÕßרÃÅΪ±¾Êé¼ÖÆÁË´óÁ¿¶àýÌåÓïÒôÊÓƵ½øÐн²½â£¬¶ÁÕß¿ÉÒÔ½áºÏÊÓƵ½²½â¸ü¸ßЧµØѧϰ£¬Ñ§Ï°Ð§¹û¸üºÃ¡£
2£®ÑÐò½¥½ø£¬ÓÉdzÈëÉî
ΪÁËÈóõѧÕß¿ìËÙ½øÈëǶÈëʽϵͳ¿ª·¢ÁìÓò£¬±¾ÊéÒ»¿ªÊ¼¶ÔǶÈëʽϵͳµÄÈí¼þºÍÓ²¼þ×öÁËÈ«ÃæµÄ½éÉÜ£¬ÈöÁÕ߶ÔǶÈëʽϵͳÓÐÒ»¸ö»ù±¾µÄÈÏʶ¡£Í¬Ê±£¬ÔÚÊéÖн²½âµÄ֪ʶµã¶¼Å䱸ÁËÍêÕûµÄʵÀý£¬¶ÁÕß¿ÉÒÔͨ¹ýʵÀýѧϰǶÈëʽϵͳ¿ª·¢µÄÏà¹Ø֪ʶ¡£
3£®¼¼ÊõÈ«Ã棬ÄÚÈݳäʵ
×÷Õß±¾ÈË´ÓÊÂǶÈëʽϵͳ¿ª·¢¶àÄ꣬ÉîÈëÁ˽âǶÈëʽϵͳ¿ª·¢µÄ¸÷¸ö·½Ã棬ÔÚÊéÖн²½âÁËǶÈëʽLinux¿ª·¢µÄ¸÷¸öÒªµã£¬°üÀ¨LinuxÄں˵Ĺ¹³É¡¢¹¤×÷Á÷³Ì¡¢Çý¶¯³ÌÐò¿ª·¢¡¢Îļþϵͳ¡¢³ÌÐò¿âµÈ֪ʶ£¬Ê¹¶ÁÕßÈ«ÃæÁ˽âǶÈëʽLinux¿ª·¢µÄ¸÷¸ö֪ʶµã¡£
4£®ÊµÀý½²½â£¬Àí½âÉî¿Ì
ǶÈëʽLinux¿ª·¢Êé¼®Öڶ࣬ºÜ¶àÊ鼮ƫÖØÀíÂÛ¡£±¾ÊéËùÓеÄʵÀý¶¼¾¹ý×÷ÕßÑéÖ¤£¬²¢ÇÒÓÐÏêϸµÄ²Ù×÷¹ý³ÌºÍʵÑé½á¹û¡£Æä´Î£¬±¾ÊéµÄ²Ù×÷ʵÀýÓÐÍêÕûµÄʵÑé»·¾³ÃèÊö£¬¶ÁÕß¿ÉÒÔͨ¹ýʵÀý¼ÓÉî¶Ô֪ʶµãµÄÀí½â¡£
5£®»¯ÕûΪÁ㣬ÉîÈëÆÊÎö
ǶÈëʽϵͳ¿ª·¢É漰֪ʶÃæ¹ã£¬¼¼Êõ¸´ÔÓ¡£±¾Êé°þ¼ë³éË¿£¬Á¦ÇóÕÒ³ö¿ª·¢¹ý³ÌÖйؼüµÄ֪ʶµã¡£´Ó¹Ø¼üµãÈëÊÖ£¬Í¨¹ý¼òµ¥Ò׶®µÄÀý×ÓÆÊÎö¼¼ÊõÔÀí£¬°ïÖú¶ÁÕßÕÆÎÕ¸´Ôӵļ¼Êõ¡£
±
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
¹ØÓÚlinux»·¾³±äÁ¿Îļþ
µÚÒ»ÄÚÈÝ£º
etc/profile:´ËÎļþΪϵͳµÄÿ¸öÓû§ÉèÖû·¾³ÐÅÏ¢,µ±Óû§µÚÒ»´ÎµÇ¼ʱ,¸ÃÎļþ±»Ö´ÐÐ.
²¢´Ó/etc/profile.dĿ¼µÄÅäÖÃÎļþÖÐËѼ¯shellµÄÉèÖÃ.
/etc/bashrc:Ϊÿһ¸öÔËÐÐbash shellµÄÓû§Ö´ÐдËÎļþ.µ±bash shell±»´ò¿ªÊ±,¸ÃÎļþ±»¶ÁÈ¡.
µÚ¶þÄÚÈÝ£º
~/.bash_profile:ÿ¸öÓû§¶¼¿ÉʹÓà ......
±¾³ÌÐò¿ÉÒÔ¶ÁÈ¡.wavÎļþ£¬È»ºó½øÐв¥·Å¡£
È·ÈÏ·½·¨£ºcat /etc/sndstat£¬Èç¹ûÏÔʾÎÞ´ËÉ豸£¬ÔòûÓа²×°Çý¶¯¡£
#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/ioctl.h>#include <stdlib.h>#include <stdio.h>#include&nbs ......