Interrupt in Linux£¨Ó²¼þƪ£©—— PIC
±¾ÎÄÀ´×Ô£ºhttp://blog.chinaunix.net/u2/66786/showart.php?id=601766
1.1Ê·Ç°µÄPIC
8259AÊǼ´ÎÒÃÇͨ³£ËµµÄPIC£¬Èçͼ1-1Ëùʾ£º
ͼ1-1 8259A
ÆäÖÐ×îÖØÒªµÄ¹Ü½ÅÊÇIR0~IR7£¨Interrupt Request0~7£¬ÓÃÓÚÁ¬½ÓÉ豸£©¡¢INT£¨Á¬½ÓCPU,µ±ÓÐÖжÏÇëÇóʱ£¬À¸ß¸Ã¹Ü½ÅÒÔ֪ͨCPUÖжϵĵ½À´£©¡¢INTA£¨Á¬½ÓCPU£¬CPUͨ¹ý¸Ã¹Ü½ÅÓ¦´ðÖжÏÇëÇ󣬲¢Í¨ÖªPICÌá½»ÖжϵÄvectorµ½Êý¾ÝÏߣ©¡£´ËÍ⣬ÓÉÓÚһƬ8259AÖ»ÄÜÁ¬½Ó8¸öÉ豸£¬¶ÔÓÚÏÖ´úPC¼Ü¹¹À´ËµÏԵùýÉÙ£¬Í¨³£»áͨ¹ýCS£¨Æ¬Ñ¡£©½«Á½¸ö8259AÁ¬ÔÚÒ»Æð¹¹³ÉÒ»¸ö¿ÉÒÔÁ¬½Ó15¸öÉ豸£¨ÓÐÒ»¸ö¹Ü½ÅÓÃÓÚ´®ÁªÁíһƬ8259A£©µÄPIC¡£
¼ÈÈ»Êǿɱà³ÌµÄоƬ£¬8259Aµ±È»ÉÙ²»Á˼ĴæÆ÷¡£³ýÁËICW£¨Initialization Command Word£¬³õʼ»¯ÃüÁî¼Ä´æÆ÷£¬ÓÃÓÚ³õʼ»¯8259A£©ºÍOCW£¨Operation Command Word£¬²Ù×÷ÃüÁî×Ö£¬ÓÃÓÚ¿ØÖÆ8259A£©Í⣬×îÖØÒªµÄÓÐ3¸ö¼Ä´æÆ÷£º
u IRR£ºInterrupt Request Register£¬ÖжÏÇëÇó¼Ä´æÆ÷£¬¹²8bit£¬¶ÔÓ¦IR0~IR7°Ë¸öÖжϹܽš£µ±Ä³¸ö¹Ü½ÅµÄÖжÏÇëÇóµ½À´ºó£¬Èô¸Ã¹Ü½ÅûÓб»ÆÁ±Î£¬IRRÖжÔÓ¦µÄbit±»ÖÃÒ»¡£±íʾPICÒѾÊÕµ½É豸µÄÖжÏÇëÇ󣬵«»¹Î´Ìá½»¸øCPU¡£
u ISR£ºIn Service Register£¬·þÎñÖмĴæÆ÷£¬¹²8bit£¬Ã¿bitÒâÒåͬÉÏ¡£µ±IRRÖеÄij¸öÖжÏÇëÇó±»·¢Ë͸øCPUºó£¬ISRÖжÔÓ¦µÄbit±»ÖÃÒ»¡£±íʾÖжÏÒÑ·¢Ë͸øCPU£¬µ«CPU»¹Î´´¦ÀíÍê¡£
u IMR£ºInterrupt Mask Register£¬ÖжÏÆÁ±Î¼Ä´æÆ÷£¬¹²8bit£¬Ã¿bitÒâÒåͬÉÏ¡£ÓÃÓÚÆÁ±ÎÖжϡ£µ±Ä³bitÖÃһʱ£¬¶ÔÓ¦µÄÖжϹܽű»ÆÁ±Î¡£
ÓëAPIC²»Í¬£¬PICµÄÿ¸ö¹Ü½Å¾ßÓÐÓÅÏȼ¶£¬ÒÔ0ºÅ¹Ü½Å×î¸ß¡£Ò²¾Í˵£¬Á¬½ÓºÅÂë½ÏСµÄÉ豸¾ßÓнϸߵÄÖжÏÓÅÏȼ¶¡£Í¨¹ý¶ÔPICµÄICW¼Ä´æÆ÷±à³Ì£¬¿ÉÒÔÉ趨ÆðʼvectorºÅ£¬ÒÔ¼ÆË㵱ǰÖжϵÄvector¡£ÀýÈ磬ÆðʼvectorºÅÉèΪ16£¬IR3¹Ü½Å²úÉúÁËÖжÏÇëÇó£¬ÔòIR3¶ÔÓ¦µÄvector = 16+3 =19¡£Í¨¹ýPIC·¢ÆðÖжϵĵäÐÍÁ÷³ÌÈçÏ£º
1¡¢ Ò»¸ö»ò¶à¸öIR¹Ü½ÅÉϲúÉúµçƽÐźţ¬Èô¶ÔÓ¦µÄÖжÏûÓб»ÆÁ±Î£¬IRRÖÐÏàÓ¦µÄbit±»ÖÃÒ»¡£
2¡¢ PICÀ¸ßINT¹Ü½Å֪ͨCPUÖжϷ¢Éú¡£
3¡¢ CPUͨ¹ýINTA¹Ü½ÅÓ¦´ðPIC£¬±íʾÖжÏÇëÇóÊÕµ½¡£
4¡¢ PICÊÕµ½INTAÓ¦´ðºó£¬½«IRRÖоßÓÐ×î¸ßÓÅÏȼ¶µÄbitÇåÁ㣬²¢ÉèÖÃISRÖжÔÓ¦µÄbit¡£
5¡¢ CPUͨ¹ýINTA¹Ü½ÅµÚ¶þ´Î·¢³öÂö³å£¬PICÊÕµ½ºó¼ÆËã×î¸ßÓÅÏȼ¶ÖжϵÄvector£¬²¢½«ËüÌá½»µ½Êý¾ÝÏßÉÏ¡£
6¡¢ µÈ´ýCPUдEO
Ïà¹ØÎĵµ£º
-------------------------------------------------------------------------------------------------------
By:yuyongbao
QQ:673360056
£±¡¢ linuxϹ²ÏíÎļþ¡£°²×°smbserver¡£È»ºóÔÚ¡¶ÏµÍ³ÉèÖá·Öдò¿ª¡¶·þÎñÆ÷ÉèÖ᷵ġ¶smb¡¡server¡··þÎñÆ÷£¬ÊäÈëÏà¹Ø·¾¶¼´¿É¡£È»ºóÔÚwindowÖУ¬Ê¹ÓÃÍøÂçÁÚ¾Ó²éÕÒlinux¡££¨×¢ ......
LinuxÉ豸Çý¶¯Ñ§Ï°£Davinci¿ª·¢°åÉÏÔËÐеÄhelloÄ£¿é
¿´Á˺ܶà¸öhello worldÁË£¬×Ô¼ºÀ´Ð´Ò»¸öÔÚdavinci°å¿éÉÏÅܵİɡ£
Ö÷ÌåºÜ¼òµ¥£¬¾ÍÊÇÒ»¸öCÎļþhello_davinci.c¡£
/*================hello_davinci.c==============*/
#include <linux/module.h> /*ËùÓÐÄ£¿é¶¼ÐèÒªµÄÍ·Îļþ*/
#include <lin ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
Linux
ÊÀ½çºÜ¾«²Ê£¬ÁîÈËÑÛ»¨çÔÂÒ¡£½üÆÚÒÔÀ´£¬¸÷ÖÖÇáÐÍ
Linux
°æ±¾²»¶ÏµÇ̨ÁÁÏ֪࣬ÃûµÄ
Puppy
£¨Ð¡¹·Ö®Ãû£©±ãÊÇÒ»Àý¡£ºÎ¹Ê£¿
......
1¡¢ÒýÑÔ
ÔÚlinuxϵͳÏ£¬Èç¹ûÄãÏÂÔز¢°²×°ÁËÓ¦ÓóÌÐò£¬ºÜÓпÉÄÜÔÚ¼üÈëËüµÄÃû³Æʱ³öÏÖ“command not found”µÄÌáʾÄÚÈÝ¡£Èç¹ûÿ´Î¶¼µ½°²×°Ä¿±êÎļþ¼ÐÄÚ£¬ÕÒµ½¿ÉÖ´ÐÐÎļþÀ´½øÐвÙ×÷¾ÍÌ«·±ËöÁË¡£ÕâÉæ¼°µ½»·¾³±äÁ¿PATHµÄÉèÖÃÎÊÌ⣬¶øPATHµÄÉèÖÃÒ²ÊÇÔÚlinux϶¨ÖÆ»·¾³±äÁ¿µÄÒ»¸ö×é³É²¿·Ö¡£±¾ÎÄ»ùÓ ......
ÔÚ¿´LKD(µÚ¶þ°æ)µÚÁùÕÂ(ÖжϺÍÖжϴ¦Àí³ÌÐò)µÄʱºò£¬¸Õ¿ªÊ¼½Ó´¥µ½ÖжÏÏߺź͹²ÏíÖжÏÏßµÄʱºò°ëÌìã¶ÊÇûÓÐÏëÃ÷°×£¬ÔÀ´Àí½âµÄÖжϺÍÖжϺÍÖжϴ¦Àí³ÌÐò¾ÍÊÇͨ¹ýÖжÏÏߺÅÀ´½øÐйØÁª£¬Ó²¼þ·¢ÉúÖжϣ¬È»ºóͨ¹ýÖжÏÏߺŲéÕÒ¶ÔÓ¦µÄÖжϴ¦Àí³ÌÐò£¬×îºóÖжϴ¦Àí³ÌÐò·µ»Ø£¬´Ë´ÎÖжÏÔò´¦ÀíÍê±Ï£¬Ã»Ïë ......