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

[ת]linuxÐźÅÁ¿µÄʵÏÖ

Ô­ÎĵØÖ·£ºhttp://blog.sina.com.cn/s/blog_460b9cbf0100gxtv.html
ҪʹÓÃÐźÅÁ¿£¬Äں˴úÂë±ØÐë°üÀ¨<asm/semaphore.h>¡£Ïà¹ØµÄÀàÐÍÊÇstruct semaphore£»Êµ¼ÊµÄÐźÅÁ¿¿Éͨ¹ý¼¸ÖÖ;¾¶À´ÉùÃ÷ºÍ³õʼ»¯¡£ÆäÖÐÖ®Ò»ÊÇÖ±½Ó´´½¨ÐźÅÁ¿£¬Õâͨ¹ýsema_initÍê³É£º
viod sema_init(struct semaphore *sem,int val);
ÆäÖÐvalÊǸ³ÓèÒ»¸öÐźÅÁ¿µÄ³õʼֵ¡£
²»¹ý£¬ÐźÅÁ¿Í¨³£ÓÃÓÚ»¥³âģʽ¡£ÎªÁËÈÃÕâÖÖÇé¿ö¸ü¼Ó¼òµ¥£¬ÄÚºËÌṩÁËÒ»×鸨Öúº¯ÊýºÍºê¡£Òò´Ë£¬ÎÒÃÇ¿ÉÒÔÓÃÏÂÃæµÄ·½·¨Ö®Ò»À´ÉùÃ÷ºÍ³õʼ»¯»¥³âÌ壺
DECLARE_MUTEX(name);
DECLARE_MUTEX_LOCKED(name);
ÉÏÃæÁ½¸öºêµÄ½á¹ûÊÇ£¬Ò»¸ö³ÆΪnameµÄÐźÅÁ¿±»³õʼ»¯Îª1(DECLARE_MUTEX)»òÕß0£¨Ê¹ÓÃDECLARE_MUTEX_LOCKED)¡£ÔÚºóÃæÒ»ÖÖÇé¿öÏ£¬»¥³âÌåµÄ³õʼ״̬ʱËø¶¨µÄ£¬Ò²¾ÍÊÇ˵£¬ÔÚÔÊÐíÈκÎÏ̷߳ÃÎÊ֮ǰ£¬±ØÐëÏÔʽµØ½âËø¸Ã»¥³âÌå¡£
   Èç¹û»¥³âÌå±ØÐëÔÚÔËÐÐʱ±»³õʼ»¯£¨ÀýÈçÔÚ¶¯Ì¬·ÖÅ以³âÌåµÄÇé¿öÏ£©£¬Ó¦Ê¹ÓÃÏÂÃæµÄº¯ÊýÖ®Ò»£º
void init_MUTEX(struct semaphore * sem);
void init_MUTEX_LOCKED(struct semaphore *sem);
ÔÚlinuxÊÀ½çÖУ¬Pº¯Êý±»³ÆΪdown--»òÕßÕâ¸öÃû×ÖµÄÆäËü±äÖÖ¡£ÕâÀ"down"Ö¸µÄÊǸú¯Êý¼õСÁËÐźÅÁ¿µÄÖµ£¬ËüÒ²Ðí»á±»µ÷ÓÃÕßÖÃÓÚÐÝÃß״̬£¬È»ºóµÈ´ýÐźÅÁ¿±äµÃ¿ÉÓã¬Ö®ºóÊÚÓèµ÷ÓÃÕ߶Ա»±£»¤×ÊÔ´µÄ·ÃÎÊ¡£ÏÂÃæÊÇdownµÄÈý¸ö°æ±¾£º
void down(struct semaphore *sem);
int down_interruptible(struct semaphore *sem);
int down_trylock(struct semaphore *sem);
down¼õÉÙÐźÅÁ¿µÄÖµ£¬²¢ÔÚ±ØҪʱһֱµÈ´ý¡£down_interruptibleÍê³ÉÏàͬµÄ¹¤×÷£¬µ«²Ù×÷ÊÇ¿ÉÖжϵġ£¿ÉÖжϵİ汾¼¸ºõÊÇÎÒÃÇʼÖÕҪʹÓõİ汾£¬ËüÔÊÐíµÈ´ýÔÚij¸öÐźÅÁ¿ÉϵÄÓû§¿Õ¼äµÄ½ø³Ì¿É±»Óû§Öжϡ£Ê¹ÓÃdown_interruptibleÐèÒª¶îÍâСÐÄ£¬Èç¹û²Ù×÷±»Öжϣ¬¸Ãº¯Êý»á·µ»Ø·ÇÁãÖµ£¬¶øµ÷ÓÃÕß²»»áÓµÓиÃÐźÅÁ¿¡£¶Ôdown_interruptibleµÄÕýȷʹÓÃÐèҪʼÖÕ¼ì²é·µ»ØÖµ£¬²¢×÷³öÏàÓ¦µÄÏìÓ¦¡£
×îºóÒ»¸ö°æ±¾(down_trylock)ÓÀÔ¶²»»áÐÝÃߣ»Èç¹ûÐźÅÁ¿ÔÚµ÷ÓÃʱ²»¿É»ñµÃ£¬down_trylock»áÁ¢¼´·µ»ØÒ»¸ö·ÇÁãÖµ¡£
   µ±Ò»¸öÏ̳߳ɹ¦µ÷ÓÃÉÏÊödownµÄij¸ö°æ±¾Ö®ºó£¬¾Í³ÆΪ¸ÃÏ߳̔ӵÓГ(»ò”Äõ½“£¬”»ñÈ¡“£©Á˸ÄÐźÅÁ¿¡£ÕâÑù£¬¸ÃÏ߳̾ͱ»¸³Óè·ÃÎÊÓɸÃÐźÅÁ¿±£»¤µÄÁÙ½çÇøµÄȨÀû¡£µ±»¥³â²Ù×÷Íê³Éºó£¬±ØÐë·µ»Ø¸ÃÐźÅÁ¿¡£LinuxµÈ¼ÛÓÚVµÄº¯ÊýÊÇup:
void up(struct semaphore * sem);
µ÷ÓÃupÖ®ºó£¬µ


Ïà¹ØÎĵµ£º

[תÔØ]Java°²×°ÅäÖã¨linux£©


°²×°java£º
´ò¿ªÖնˣ¬Ö´ÐÐÒÔÏÂÃüÁ»òʹÓÃAdept/ÐÂÁ¢µÃÈí¼þ¹ÜÀíÆ÷£¬ÔÚÆäÖзֱðËÑË÷"sun-java6-jre"ºÍ"sun-java6-jdk"²¢±ê¼Ç°²×°¡£
sudo apt-get install sun-java6-jre
Èç¹û¿Õ¼ä¸»Ô££¬½¨Òé°²×°Ò»¸öJDK¡£
sudo apt-get install sun-java6-jdk
Ìáʾ£º°²×°¹ý³ÌÖÐÐèÒªÄã»Ø´ðÊÇ·ñͬÒâʹÓÃЭÒ飨ÖÕ¶ËÖкìÀ¶É«µÄÌáʾ½çÃæ£ ......

LinuxÉ豸Çý¶¯³ÌÐòѧϰ֮Êý¾ÝÀàÐÍÓëÄÚ´æ·ÖÅä


LinuxÉ豸Çý¶¯³ÌÐòѧϰ±Ê¼ÇϵÁÐÎÄÕÂÔ­×÷ÕßÊÇ£ºTekkaman Ninja£¬Ëû²©¿ÍµØÖ·£º
http://blog.chinaunix.net/u1/34474/showart_404278.html
ÔÚ´ËÏòTekkaman Ninja±íʾ¸Ðл£¬Ð´³öÕâôºÃµÄÎÄÕ£¬Ê¹ÎÒÉÙ×ßÁ˺ܶàÍä·¡£
ÓÉÓÚÇ°ÃæµÄѧϰÖÐÓÐÓõ½ µÚʮһÕ ÄÚºËÊý¾Ý½á¹¹ÀàÐÍ µÄ֪ʶ£¬ËùÒÔÎÒÏÈ¿´ÁË¡£ÒªµãÈçÏ£º
½«linux ÒÆÖ²µ½Ð ......

Writing Linux LCD drivers

Writing Linux LCD drivers
×÷ÕߣºJimSheng
Writing Linux LCD drivers
Abstract
1 LCD Module\Driver\Controller
2 Linux Frame Buffer Driver
2.1 Why Frame Buffer?
2.2 What is Frame Buffer Devices?
2.3 How to Write Frame Buffer Device Drivers?
3 Analysis of Linux Frame Buffer Driver Source ......

×öÒ»¸ö×îСµÄLinux KernelÄÚºË

×öÒ»¸ö×îСµÄLinux kernel
2004-04-23 15:18 pm
À´×Ô£ºLinuxÎĵµ
ÏÖÔØ£ºWww.8s8s.coM
µØÖ·£ºÎÞÃû
Linux ÄÜÓжàСÄØ ? ÿһ¸ö×ö embedded ϵͳµÄÈ˶¼°ÑС¿´³ÉµÚÒ»ÒªÎñ£¬ÆäʵÕâÊDz»¶ÔµÄ¡£Èç¹ûÎÒÃǶÔϵͳµÄºÃ»µºÍ´óС×÷ͼ£¬ËüÓ¦¸Ã³¤µÃÏñ
|
|----
|
| -----
|
| --------
| ---
|----------------------- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ