LinuxÄÚºËͬ²½£¬½ø³Ì£¬Ïß³Ìͬ²½
°üÀ¨ÎÒ×Ô¼ºÔÚÄÚ£¬ºÜ¶àÈ˶ÔÄںˣ¬½ø³Ì£¬Ïß³Ìͬ²½¶¼²»ÊǺÜÇå³þ£¬ÏÂÃæÉÔ΢×ܽáһϣº
ÄÚºËͬ²½£º
Ö÷ÒªÊÇ·ÀÖ¹¶àºË´¦ÀíÆ÷ͬʱ·ÃÎÊÐÞ¸Äij¶Î´úÂ룬»òÕßÔÚ¶ÔÉ豸Çý¶¯³ÌÐò½øÐÐÁÙ½çÇø±£»¤¡£Ö÷ÒªÓÐһϼ¸ÖÖ·½Ê½£º
1. Mutex£¨»¥³â£©
Í·Îļþ£º
#include <linux/mutex.h>
³õʼ»¯·½·¨£º
DEFINE_MUTEX(name);»òÕß
void mutex_init(struct mutex *lock);
ʹÓ÷½·¨£º
void mutex_lock (struct mutex *lock);
Tries to lock the mutex, sleeps otherwise.
Caution: can't be interrupted, resulting in processes you cannot kill!
int mutex_lock_interruptible (struct mutex *lock);
Same, but can be interrupted. If interrupted, returns a non zero value and doesn't hold the lock. Test the return value!!!
int mutex_trylock (struct mutex *lock);
Never waits. Returns a non zero value if the mutex is not available.int mutex_is_locked(struct mutex *lock);Just tells whether the mutex is locked or not.
void mutex_unlock (struct mutex *lock);
Releases the lock. Make sure you do it as quickly as possible!
2. Reader/writer semphopres ¶ÁдÐźÅÁ¿
Allow shared access by unlimited readers, or by only 1 writer. Writers get priority.
ÔÊÐíÓÐÏÞÊýÁ¿µÄ¶Á·ÃÎÊ£¬µ«ÊÇÖ»ÄÜÓÐÒ»¸öд·ÃÎÊ¡£
void init_rwsem (struct rw_semaphore *sem);
void down_read (struct rw_semaphore *sem);
int down_read_trylock (struct rw_semaphore *sem);
int up_read (struct rw_semaphore *sem);
void down_write (struct rw_semaphore *sem);
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,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£¿Ëü±ÈWindows¸üºÃÂð£¿ÎÒÄÜÓÃËü´òħÊÞÂ𣿔
“¿È£¡±ðÌáÁË£¬Ëü²Ù×÷ÆðÀ´ÌرðÂé·³£¬ÄãµÃ²»Í£µØÇû÷¼üÅÌ¡£Ã»×¼Ëü»¹»á³ÃÄã²»×¢ÒâµÄʱºòÔÚÄãµÄÊÖָͷÉÏÒ§Ò»¿ÚÄØ£¡”
»òÐíÄãÒ²ÓÐÀàËƵÄÏë·¨¡£µ«ÎÞÂÛÈËÃǶÔLinuxÓÐÔõÑùµÄÎó½â£¬ÖÁÉÙÎÒ²»ÔÙÏñǰЩÄêÄÇÑùƵ·±µØ»Ø´ð“Linux ......
1.4 InternetÉϵÄLinux×ÊÔ´
InternetÉÏÓÀÔ¶¶¼²»È±ÉÙLinux×ÊÔ´£¬³ýÁË1.3.1½ÚÁгöµÄ¸÷·¢ÐаæµÄ¹Ù·½ÍøÕ¾Í⣬»¹Óкܶà×éÖ¯ºÍ¸öÈ˽¨Á¢Á˸÷ÖÖLinuxÍøÕ¾ºÍÂÛ̳£¬ÕâЩ×ÊԴΪLinuxÓû§ÌṩÁË´óÁ¿Ö§³Ö¡£¾³£¹â¹ËÕâЩµØ·½²¢¼°Ê±Êµ¼ùÊÇѧϰLinuxµÄ×îºÃ;¾¶¡£±í1.2ºÍ±í1.3·Ö±ðÁгöÁ˹úÍâºÍ¹úÄڵij£ÓÃLinuxÕ¾µã¡£
±í1.2 ³£Ó ......
ÔÚLinuxϲúÉú²¢µ÷ÊÔcoreÎļþ
ÏÈ¿´¿´ÎÒÓõÄÊǸöʲô»úÆ÷£º
$ uname -a
Linux dev 2.4.21-9.30AXsmp #1 SMP Wed May 26 23:37:09 EDT 2004 i686 i686 i386 GNU/Linux
ÔÙ¿´¿´Ä¬ÈϵÄһЩ²ÎÊý£¬×¢Òâcore file sizeÊǸö0£¬³ÌÐò³ö´íʱ²»»á²úÉúcoreÎļþÁË¡£
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbyt ......