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

Linux¶àÏ̱߳à³Ì

Ô­ÎĵØÖ· http://johnylai.blog.sohu.com/63406924.html
µäÐ͵ÄḬ̈߳üÀ¨Ò»¸öÔËÐÐʱ¼äϵͳ£¬Ëü¿ÉÒÔ°´Í¸Ã÷µÄ·½Ê½À´¹ÜÀíÏ̡߳£Í¨³£Ḭ̈߳ü°üÀ¨¶ÔÏ̵߳Ĵ´½¨ºÍɾ³ý£¬ÒÔ¼°¶Ô»¥³âºÍÌõ¼þ±äÁ¿µÄµ÷Óá£POSIX±ê×¼Ï߳̿â¾ßÓÐÕâЩµ÷Óá£ÕâЩ°ü»¹ÌṩÏ̵߳Ķ¯Ì¬´´½¨ºÍɾ³ý£¬Òò´Ë£¬Ö±µ½ÔËÐÐʱ¼ä֮ǰ£¬Ï̵߳ĸöÊý²»±ØÖªµÀ¡£
       Ï߳̾ßÓÐÒ»¸öID¡¢Ò»¸ö¶ÑÕ»¡¢Ò»¸öÖ´ÐÐÓÅÏÈȨ£¬ÒÔ¼°Ö´ÐеĿªÊ¼µØÖ·¡£POSIXÏß³Ìͨ¹ýpthread_tÀàÐ͵ÄIDÀ´ÒýÓá£pthread_tÆäʵ¾ÍÊÇÎÞ·ûºÅ³¤ÕûÐÍ£¬ÔÚÎļþ/usr/include/bits/pthreadtypes.hÓÐÈç϶¨Ò壺
       typedef unsigned long int pthread_t;
       Ï̵߳ÄÄÚ²¿Êý¾Ý½á¹¹Ò²°üº¬µ÷¶ÈºÍʹÓÃÐÅÏ¢¡£½ø³ÌµÄÏ̹߳²Ïí½ø³ÌµÄÍêÕûµØÖ·¿Õ¼ä£¬ËüÃÇÄܹ»ÐÞ¸ÄÈ«¾Ö±äÁ¿£¬·ÃÎÊ´ò¿ªµÄÎļþÃèÊö·û£¬»òÓñðµÄ·½Ê½Ï໥×÷Óá£
1¡¢  pthread_createº¯Êý
Èç¹ûÏ߳̿ÉÔÚ½ø³ÌµÄÖ´ÐÐÆÚ¼äµÄÈÎÒâʱ¿Ì±»´´½¨£¬²¢ÇÒÏ̵߳ÄÊýÁ¿ÊÂÏÈûÓбØÒªÖ¸¶¨£¬ÕâÑùµÄÏ̳߳ÆΪ¶¯Ì¬Ï̡߳£ÔÚPOSIXÖУ¬Ïß³ÌÊÇÓÃpthread_create¶¯Ì¬µÄ´´½¨µÄ¡£pthread_createÄÜ´´½¨Ị̈߳¬²¢½«Ëü·ÅÈë¾ÍÐ÷¶ÓÁС£´´½¨Ïß³ÌÐèÒªµ÷ÓÃpthread_create£¬¸Ãº¯ÊýµÄ¶¨ÒåÈçÏÂËùʾ£º
#include <pthread.h>
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void*(*start_routine)(void *),void *arg);
¸Ãº¯ÊýµÄµÚ1¸ö²ÎÊýthread½«Ö¸Ïò´´½¨Ï̵߳ÄID¡£Ï̵߳ÄÊôÐÔÊÇÓÉattrÖ¸ÏòµÄÊôÐÔ¶ÔÏóÀ´°üÈݵġ£Èç¹ûattrΪNULL£¬ÐÂÏ߳̾ßÓÐȱʡµÄÊôÐÔ¡£µÚ3¸ö²ÎÊýstart_routineÊÇÏ߳̿ªÊ¼Ö´ÐÐʱµ÷Óõĺ¯ÊýÃû×Ö¡£start_routineÕ¼ÓÃÒ»¸ö²ÎÊýarg£¬ËüÊÇÒ»¸öÖ¸ÏòviodµÄÖ¸Õë¡£start_routine·µ»ØÒ»¸öÖ¸ÏòviodµÄÖ¸Õ룬´ËÖ¸Õë±»¿Õ×÷ʱpthread_jionµÄÍ˳ö״̬¡£
º¯Êýpthread_createÔڳɹ¦µ÷ÓÃʱ·µ»Ø0£¬Ê§°Üʱ·µ»Ø-1¡£
2¡¢  pthread_selfº¯Êý
ÔÚ´´½¨Ïß³ÌÖ®ºó£¬¿ÉÒÔµ÷ÓÃpthread_selfµÃµ½Ï̵߳ÄID£¬¸Ãº¯ÊýµÄ¶¨ÒåÈçÏÂËùʾ£º
#include <pthread.h>
pthread_t pthread_self(void);
3¡¢  pthread_exitº¯Êý
Óë½ø³ÌÍ˳öʱµ÷ÓÃexitÀàËÆ£¬Ïß³ÌÍ˳öʱҲÐèÒªµ÷ÓÃpthread_exit£¬ËüµÄ¶¨ÒåÈçÏ£º
#include <pthread.h>
void pthread_exit(void* retval);
º¯Êýpthread_exitÖÕÖ¹µ÷ÓõÄÏ̡߳£²ÎÊýretvalµÄÖµ¶Ôpthread_joinº¯ÊýµÄ³É¹¦ÓÉʵ¼ÊÒâÒ塣Ȼ¶ø£¬pthread_exitµÄretval±ØÐëÖ¸¶¨£¬ÔÚÏß³ÌÍ˳öʱËü²


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

Linux ÈëÃų£ÓÃÃüÁî

Linux ÈëÃų£ÓÃÃüÁî
ÎÄÕµ¼¶Á]
 
×ܵÄÀ´Ëµ£¬Linux»¹ÊÇÒ»¸öÓÃÃüÁîÀ´²Ù×÷µÄϵͳ¡£Ñ§Ï°linux£¬Ê×ÒªµÄÊÇÕÆÎÕËüµÄÃüÁî¡£
1.Linux½øÈëÓëÍ˳öϵͳ
½øÈëLinuxϵͳ£º
±ØÐëÒªÊäÈëÓû§µÄÕ˺ţ¬ÔÚϵͳ°²×°¹ý³ÌÖпÉÒÔ´´½¨ÒÔÏÂÁ½ÖÖÕʺţº
¡¡¡¡1£®root--³¬¼¶Óû§Õʺţ¨ÏµÍ³¹ÜÀíÔ±£©£¬Ê¹ÓÃÕâ¸öÕʺſÉÒÔÔÚϵͳÖÐ×öÈκÎÊÂÇé¡£ ......

linuxÄں˶¯Ì¬¼ÓÔØÄ£¿é

 Ò»¡¢°²×°ÄÚºËÄ£¿é:
Ò»°ã²½Ö裺
(1) ÔÚ/usr/src/linux/ÏÂÔËÐÐmake menuconfig°ÑÐèÒª±àÒë³ÉÄ£¿éµÄÏî´òÉÏ(M)£¬±£´æ²¢Í˳ö¡£
(2) ÔËÐÐmake modules£¬ÕâÒ»²½½«ÔÚ/usr/src/linux/ÏÂÉú³É*.o»ò*.koÎļþ¡£
(3) ÔËÐÐmake modeules_installÀ´°²×°,Õâ²½»á°ÑÉú³ÉµÄ.o»òkoÎļþ¿½±´µ½/lib/modules/`uname -r`/Ï¡£
Èç¹ûÄãÖ»Òª±à ......

LinuxÈçºÎÔÚϵͳÆô¶¯Ê±×Ô¶¯¼ÓÔØÄ£¿é£¨×ª£©

 
Ϊ
¸ãÇå³þÈçºÎÔÚϵͳÆô¶¯Ê±×Ô¶¯¼ÓÔØÄ£¿é£¬ËÑË÷Á˺þã¬ÍøÉÏÓкܶàÈËÌá³öÕâ¸öÎÊÌ⣬µ«¶¼Ã»ÓÐÕýÈ·µÄ´ð°¸£¬ÎÞÂÛÊÇÖÐÎÄÉçÇø»¹ÊÇÓ¢ÎÄÉçÇø£¬´ó¼ÒµÄ»Ø´ð¶¼Ã»Óн²µ½µã
×ÓÉÏ£¬ÎÞ·ÇÊÇΧÈÆ modprobe.conf¡¢modprobe½²À´½²È¥µÄ£¬Òª²»¾ÍÊÇÕë¶ÔÌض¨ÎÊÌâ³¢ÊÔ²»Í¬µÄ·½·¨¡£ÓеĻ¹½¨Òé°Ñmodprobe
modulenameдÈërc.local£¬È´²»ÔøÏë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ