linux 2.6Ô´´úÂëÇé¾°·ÖÎö±Ê¼ÇÖ®½ø³Ì5
µÈ´ý¶ÓÁÐÔÚÄÚºËÖкܶàÓÃ;£¬ÓÈÆäÓÃÔÚÖжϴ¦Àí¡¢½ø³Ìͬ²½¼°¶¨Ê±¡£µÈ´ý¶ÓÁÐʵÏÖÁËÔÚʼþÉϵÄÌõ¼þµÈ´ý£ºÏ£ÍûµÈ´ýÌض¨Ê¼þµÄ½ø³Ì°Ñ×Ô¼º·Å½øºÏÊʵĵȴý¶ÓÁУ¬²¢·ÅÆú¿ØÖÆȨ¡£Òò´Ë£¬µÈ´ý¶ÓÁбíʾһ×é˯ÃߵĽø³Ì£¬µ±Ä³Ò»Ìõ¼þ±äΪÕæʱ£¬ÓÉÄں˻½ÐÑËüÃÇ¡£
µÈ´ý¶ÓÁÐÓÉË«ÏòÁ´±íʵÏÖ£¬ÆäÔªËØ°üÀ¨Ö¸Ïò½ø³ÌÃèÊö·ûµÄÖ¸Õ롣ÿ¸ö¶ÓÁж¼ÓÐÒ»¸öµÈ´ý¶ÓÁÐÍ·£¬µÈ´ý¶ÓÁÐÍ·ÊÇÒ»¸öÀàÐÍΪwait_queue_head_tµÄÊý¾Ý½á¹¹¡£
struct __wait_queue_head {
spinlock_t lock;
struct list_head task_list;
};
typedef struct __wait_queue_head wait_queue_head_t;
µÈ´ý¶ÓÁÐÓÉÖжϴ¦Àí³ÌÐòºÍÖ÷ÒªÄں˺¯ÊýÐ޸ġ£Í¬²½ÊÇͨ¹ýµÈ´ý¶ÓÁÐÍ·ÖеÄlock×ÔÐýËø´ïµ½µÄ£¬task_list×Ö¶ÎÊǵȴý½ø³ÌÁ´±íµÄÍ·¡£
µÈ´ý¶ÓÁÐÁ´±íÖеÄÔªËØÀàÐÍΪwait_queue_t:
struct __wait_queue {
unsigned int flags;
#define WQ_FLAG_EXCLUSIVE 0x01
struct task_struct * task;
wait_queue_func_t func;
struct list_head task_list;
};
ÿ¸öÔªËØ´ú±íÒ»¸ö˯Ãß½ø³Ì£¬¸Ã½ø³ÌµÈ´ýijһʼþµÄ·¢Éú£¬ËüµÄÃèÊö·ûµØÖ··ÅÔÚtask×Ö¶ÎÖС£task_list×Ö¶ÎÖаüº¬µÄÊÇÖ¸Õ룬ÓÉÕâ¸öÖ¸Õë°ÑÒ»¸öÔªËØÁ¬½Óµ½µÈ´ýÏàͬʱ¼äµÄ½ø³ÌÁ´±íÖС£
ÓÐÁ½ÖÖ˯Ãߣº»¥³â½ø³Ì£¨µÈ´ý¶ÓÁÐÔªËصÄflags×Ö¶ÎΪ1£©ÓÉÄÚºËÓÐÑ¡ÔñµØ»½ÐÑ£¬¶ø·Ç»¥³â½ø³Ì£¨flagsÊýֵΪ1£©×ÜÊÇÓÉÄÚºËÔÚʼþ·¢Éúʱ»½ÐÑ¡£
#define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \
.lock = SPIN_LOCK_UNLOCKED, \
.task_list = { &(name)
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
I/O ¶Ë¿ÚºÍ I/O ÄÚ´æ
ÿÖÖÍâÉ趼ÊÇͨ¹ý¶Áд¼Ä´æÆ÷À´½øÐпØÖÆ¡£
ÔÚÓ²¼þ²ã£¬ÄÚ´æÇøºÍ I/O ÇøÓòûÓиÅÄîÉϵÄÇø±ð: ËüÃǶ¼ÊÇͨ¹ýÏòÔÚµØÖ·×ÜÏߺͿØÖÆ×ÜÏß·¢³öµçƽÐźÅÀ´½øÐзÃÎÊ£¬ÔÙͨ¹ýÊý¾Ý×ÜÏ߶ÁдÊý¾Ý¡£
ÒòΪÍâÉèÒªÓëI\O×ÜÏßÆ¥Å䣬¶ø´ó²¿·ÖÁ÷ÐÐµÄ I/O ×ÜÏßÊÇ»ùÓÚ¸öÈ˼ÆËã»úÄ£ÐÍ£¨Ö÷ÒªÊÇ x86 ¼Ò×壺ËüΪ¶ÁºÍд I/O ¶Ë¿ÚÌá¹ ......
Some humorous things to do to a UNIX system:
from the csh (c shell):
% make love
Make: Don't know how to make love. Stop.
% got a light?
No match.
% sleep with me
bad character
% man: Why did you get a divorce?
man:: Too many arguments.
% rm God
rm: ......