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

LinuxÉ豸Çý¶¯¿ª·¢Ïê½â ±Ê¼Ç7 ²¢·¢¿ØÖÆ


ÖжÏÆÁ±ÎµÄʹÓ÷½·¨£º
local_irq_disable() //¹ØÖжÏ
local_irq_enable() //¿ªÖжÏ
ÕâÁ½¸öº¯Êý¶¼Ö»ÄܽûÖ¹ºÍʹÄܱ¾cpuÄÚµÄÖжϣ¬Òò´Ë£¬²¢²»Äܽâ¾öSMP¶àcpuÒý·¢µÄ¾ºÌ¬¡£Òò´Ë£¬µ¥¶ÀʹÓÃÖжÏÆÁ±Îͨ³£²»ÊÇÒ»ÖÖÖµµÃÍƼöµÄ±ÜÃ⾺̬µÄ·½·¨£¬ËüÊÊÒËÓë×ÔÐýËøÁªºÏʹÓÃ
ÁíÍ⣬local_irq_save(flags)³ýÁ˽øÐнûÖ¹ÖжϲÙ×÷ÒÔÍ⣬»¹±£´æÄ¿Ç°cpuµÄÖжÏλÐÅÏ¢£¬local_irq_restore(flags)Ïà·´
Èç¹ûÖ»Ïë½ûÖ¹Öжϵĵװ벿£¬Ó¦¸ÃʹÓÃlocal_bh_disable()£¬Ïà·´local_bh_enable()
ÕûÐÍÔ­×Ó²Ù×÷
1¡¢ÉèÖÃÔ­×Ó±äÁ¿µÄÖµ
void atomic_set(atomic_t *v, int i); //ÉèÖÃÔ­×Ó±äÁ¿µÄֵΪi
atomic_t v = ATOMIC_INIT(0); //¶¨ÒåÔ­×Ó±äÁ¿v²¢³õʼ»¯Îª0
……
×ÔÐýËø£ºÎªÁË»ñµÃÒ»¸ö×ÔÐýËø£¬ÔÚijcpuÉÏÔËÐеĴúÂëÊ×ÏÈÐèÒªÖ´ÐÐÒ»¸öÔ­×Ó²Ù×÷£¬¸Ã²Ù×÷²âÊÔ²¢ÉèÖã¨test-and-set£©Ä³¸öÄÚ´æ±äÁ¿£¬ÓÉÓÚËüÊÇÔ­×Ó²Ù×÷£¬ËùÒÔÔڸòÙ×÷Íê³É֮ǰÆäËûÖ´Ðе¥Ôª²»¿ÉÄÜ·ÃÎÊÕâ¸öÄÚ´æ±äÁ¿¡£Èç¹û²âÊÔ½á¹û±íÃ÷ÒѾ­¿ÕÏУ¬Ôò³ÌÐò»ñµÃÕâ¸ö×ÔÐýËø²¢¼ÌÐøÖ´ÐУ»Èç¹û±»Õ¼Ó㬳ÌÐò½«ÔÚÒ»¸öСµÄÑ­»·ÄÚÖظ´Õâ¸ö“test-and-set”²Ù×÷£¬¼´½øÐÐËùνµÄ“×ÔÐý”¡£Ò»°ãÕâÑùʹÓÃ×ÔÐýËø£º
spinlock_t lock; //¶¨Òå×ÔÐýËø
spin_lock_init(&lock); //³õʼ»¯×ÔÐýËø
spin_lock(&lock); //»ñµÃ×ÔÐýËø£¬±£»¤ÁÙ½çÇø
spin_unlock(&lock); //½âËø
×ÔÐýËøÑÜÉúÌåÖÆ£º
 
×¢Ò⣺
1¡¢Ö»ÓÐÔÚÕ¼ÓÃËøµÄʱ¼ä¼«¶ÌµÄÇé¿öÏ£¬Ê¹ÓÃ×ÔÐýËø²ÅÊǺÏÀíµÄ
2¡¢×ÔÐýËø¿ÉÄܵ¼ÖÂϵͳËÀËø£¬ÈçµÝ¹éʹÓÃ×ÔÐýËø£¬¼´ÒѾ­ÓµÓÐcpuµÄ½ø³ÌÏëµÚ¶þ´Î»ñµÃ¡£copy_from_userºÍcopy_to_user()ºÍkmalloc()µÈº¯Êý¶¼¿ÉÄÜÒýÆð×èÈû£¬Òò´ËÔÚ×ÔÐýËøµÄÕ¼ÓÃÆڼ䲻Äܵ÷ÓÃÕâЩº¯Êý
¶Áд×ÔÐýËø£¨rwlock£©£ºÊÇÒ»ÖÖ±È×ÔÐýËøÁ£¶È¸üСµÄËø»úÖÆ£¬±£ÁôÁË“×ÔÐý”µÄ¸ÅÄͬʱֻÄÜÒ»¸öд½ø³Ì£¬Í¬Ê±¿ÉÒÔÓжà¸ö¶ÁÖ´Ðе¥Ôª£¬µ±È»£¬¶Áд²»ÄÜͬʱ½øÐÐ
˳ÐòËø£¨seqlock£©£º¶ÈÖ´Ðе¥Ôª¿ÉÒÔÔÙдִÐе¥Ôª¶Ô±»Ë³ÐòËø±£»¤µÄ¹²Ïí×ÊÔ´½øÐÐд²Ù×÷ʱÈÔÈ»¿ÉÒÔ¼ÌÐø¶Á£¬¶ø²»±ØµÈ´ýдִÐе¥ÔªÍê³Éд²Ù×÷£¬Ð´Ö´Ðе¥ÔªÒ²²»ÐèÒªµÈ´ýËùÓжÁÖ´Ðе¥ÔªÍê³É¶Á²Ù×÷²ÅÈ¥½øÐÐд²Ù×÷¡£µ«ÊÇдÓëд֮¼ä»¹ÊÇ»¥³âµÄ
ÏÞÖÆ£ºÒªÇó±»±£»¤µÄ¹²Ïí×ÊÔ´²»º¬ÓÐÖ¸Õ룬ÒòΪдִÐе¥Ôª¿ÉÄÜʹµÃÖ¸ÕëʧЧ£¬µ«¶ÁÖ´Ðе¥ÔªÈç¹ûÕýÒª·ÃÎʸÃÖ¸Õ룬½«µ¼ÖÂOops
RCU£¨Read-Copy Update£¬¶Á-¿½±´-¸üУ©£º¶ÔÓÚ±»RCU±£»¤µÄ¹²ÏíÊý¾Ý½á¹¹£¬¶ÁÖ´Ðе¥Ôª²»ÐèÒª»ñµÃÈκÎËø¾Í¿ÉÒÔ·ÃÎÊËü£


Ïà¹ØÎĵµ£º

windowsÏ´ linux ϶àÐéÄâ²âÊÔ»ú°²×°¼°ÉÏÍøÅäÖÃ

Ò»¡¢ÏÂÔØVMwareÈí¼þ²¢°²×°
¶þ¡¢¹âÅÌ.iso·½Ê½°²×°linux
Èý¡¢¹²ÏílinuxºÍwindowsĿ¼
ËÄ¡¢½«"±¾µØÁ¬½Ó"ÉèΪ¹²Ïí·½Ê½£¬½ûÖ¹ÆäËûÐéÄâ»úÁ¬½Ó
      ´ò¿ªÐéÄâ»úÔÚÐéÄâ»ú±à¼­ÖÐÉèÖÃΪ'ÇŽÓ"·½Ê½;
²¢Ñ¡ÖÐDevice statusϵÄÁ½ÏֻËùÒÔÓÃÇŽӷ½Ê½²»ÓÃhost-only·½Ê½ÉÏÍøÊÇÒòΪ
ÔÚÓ÷ÓÉÆ÷ʱhost-onl ......

linux ½ø³ÌÉÏÏÂÎĺÍÖжÏÉÏÏÂÎÄ


¶ÔLinuxÄÚºËÖнø³ÌÉÏÏÂÎĺÍÖжÏÉÏÏÂÎĵÄÀí½â
 
 
 
 
 
 
2010Äê3ÔÂ3ÈÕ 10:51  Î¬¿â¿ª·¢Íø  ×÷ ÕߣºÑî˶,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦
Äں˿ռäºÍÓû§¿Õ¼äÊDzÙ×÷ϵͳÀíÂ۵Ļù´¡Ö®Ò»£¬¼´Äں˹¦ÄÜÄ£¿éÔËÐÐÔÚÄں˿ռ䣬¶øÓ¦ÓóÌÐòÔËÐÐÔÚÓû§¿Õ¼ä¡£ÏÖ´úµÄCPU¶¼¾ßÓв»Í¬ ......

LinuxÉ豸Çý¶¯¿ª·¢Ïê½â ±Ê¼Ç1 LinuxÉ豸Çý¶¯ÈëÃÅ


ʲôÊÇÇý¶¯£¿
×îͨË׵ĽâÊ;ÍÊÇ“ÇýʹӲ¼þÉ豸Ðж¯”
×÷Óã¿
É豸Çý¶¯Óëµ×²ãÓ²¼þÖ±½Ó´ò½»µÀ£¬°´ÕÕÓ²¼þÉ豸µÄ¾ßÌ幤×÷·½Ê½¶ÁдÉ豸¼Ä´æÆ÷£¬Íê³ÉÉ豸µÄÂÖѯ¡¢Öжϴ¦Àí¡¢DMAͨÐÅ£¬½øÐÐÎïÀíÄÚ´æÏòÐéÄâÄÚ´æµÄÓ³É䣬×îÖÕʹͨÐÅÉ豸Äܹ»ÊÕ·¢Êý¾Ý£¬Ê¹ÏÔʾÉ豸Äܹ»ÏÔʾÎÄ×ֺͻ­Ã棬ʹ´æ´¢É豸Äܹ»¼Ç¼ÎļþºÅÊý¾Ý
¼ÆË ......

ÈÃǶÈëʽLinuxÖ§³ÖÆÕͨUSBÉãÏñÍ·

ÎÒÓõÄÊÇ×îÆÕͨµÄusbÉãÏñÍ·£¬Ö÷оƬΪÖÐÐÇ΢ZC0301P£¨¾Ý˵Êг¡Õ¼ÓÐÂÊ70£¥ÒÔÉÏ£©£¬COMS´«¸ÐÆ÷ΪhynixµÄhv7131e1,ÊÐÃæÉÏÄÜÂòµ½µÄ»ù±¾ÉÏÊÇÕâÖÖÅäÖá£
    linuxÏÂÇý¶¯£¬ÎÒÖ±½ÓÒÆÖ²spca5xx£¬ÏÖÔÚ³öÁËspc5xx-le£¨Light-Edition for Linux Embedded£©¸ü·½±ã£¬Ö±½ÓÕë¶ÔǶÈëʽϵͳ×öÁËÓÅ»¯£¬¿ÉÒԲο¼ÕâÀïhttp://mxh ......

LinuxÉ豸Çý¶¯¿ª·¢Ïê½â ±Ê¼Ç5 LinuxÎļþÓëÉ豸ϵͳ

Ó¦ÓóÌÐòºÍVFSÖ®¼äµÄ½Ó¿ÚÊÇϵͳµ÷Ó㬶øVFSÓë´ÅÅÌÎļþϵͳÒÔ¼°ÆÕͨÉ豸֮¼äµÄ½Ó¿ÚÊÇfile_operations½á¹¹Ìå³ÉÔ±º¯Êý¡£ÓÉÓÚ×Ö·ûÉ豸µÄÉϲãûÓдÅÅÌÎļþϵͳ£¬ËùÒÔ×Ö·ûÉ豸µÄfile_operations³ÉÔ±º¯ÊýÖ±½ÓÓÉÉ豸Çý¶¯ÌṩÁË£¬file_operationsÕýÊÇ×Ö·ûÉ豸Çý¶¯µÄºËÐÄ£¬Èçͼ£º
 
¶ø¶Ô¿éÉ豸À´Ëµ£¬ext2¡¢fat¡¢jffs2µÈÎļþÏµÍ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ