Interrupt in Linux£¨Ó²¼þƪ£©—— APIC2
1.2.2 LAPIC
ÊÕµ½À´×ÔIOAPICµÄÖжÏÏûÏ¢ºó£¬LAPIC»á½«¸ÃÖжϽ»ÓÉCPU´¦Àí¡£ºÍIOAPIC±È½Ï£¬LAPIC¾ßÓиü¶àµÄ¼Ä´æÆ÷ÒÔ¼°¸ü¸´ÔӵĻúÖÆ¡£µ«¶ÔÓÚ´¦ÀíÀ´×ÔIOAPICµÄÖжÏÏûÏ¢£¬×îÖØÒªµÄ¼Ä´æÆ÷»¹ÊÇIRR¡¢ISRÒÔ¼°EOI¡£
ͼ1-4ÏÔʾÁËx86ƽ̨ÉÏ£¬IRRºÍISRµÄ¸ñʽ£º
ͼ1-4 IRR¡¢ISR¹¹³É
ÓëPICÖеÄIRR¡¢ISR²»Í¬µÄÊÇ£¬LAPICµÄISR¡¢IRR¾ùΪ256bit¼Ä´æÆ÷£¬¶ÔÓ¦x86ƽ̨ÉϵÄ256¸öÖжÏvector£¬ÆäÖÐ0~15Ϊ¼Ü¹¹Ô¤Áô¡£
u IRR£º¹¦ÄܺÍPICµÄÀàËÆ£¬´ú±íLAPICÒѽÓÊÕÖжϣ¬µ«»¹Î´½»CPU´¦Àí¡£
u ISR£º¹¦ÄܺÍPICÀàËÆ£¬´ú±íCPUÒÑ¿ªÊ¼´¦ÀíÖжϣ¬µ«»¹Î´Íê³É¡£ÓëPICÓÐËù²»Í¬µÄÊÇ£¬µ±CPUÕýÔÚ´¦ÀíijÖжÏʱ£¬Í¬ÀàÐÍÖжÏÈç¹û·¢Éú£¬ÏàÓ¦µÄIRR bit»áÔÙ´ÎÖÃÒ»£¨PICģʽÏ£¬Í¬ÀàÐ͵ÄÖжϱ»ÆÁ±Î£©£»Èç¹ûijÖжϱ»pendingÔÚIRRÖУ¬Í¬ÀàÐ͵ÄÖжϷ¢Éú£¬ÔòISRÖÐÏàÓ¦µÄbit±»ÖÃÒ»¡£Õâ˵Ã÷ÔÚAPICϵͳÖУ¬Í¬Ò»ÀàÐÍÖжÏ×î¶à¿ÉÒÔ±»¼ÆÊýÁ½´Î£¨Ï벻ͨʲôÒâ˼£¿Ï벻ͨ¾ÍÁªÏëÒ»ÏÂLinux¿ÉÐÅÐźţ©¡£³¬¹ýÁ½´Îʱ£¬²»Í¬¼Ü¹¹´¦Àí²»Ò»Ñù¡£¶ÔÓÚPentiumϵÁÐCPUºÍP6¼Ü¹¹£¬ÖжÏÏûÏ¢±»LAPIC¾Ü¾ø£»¶ÔÓÚPentium4ºÍXeonϵÁУ¬ÐÂÀ´µÄÖжϺÍIRRÖжÔÓ¦µÄbitÖصþ¡£
±ÊÕߣºÉÏͼ»¹ÓиöTMR¼Ä´æÆ÷£¬¼´Trigger Mode Register£¬ÓÃÓÚ±íʾµ±Ç°ÕýÔÚ´¦ÀíÖжϵĴ¥·¢Ä£Ê½¡£1Ϊlevel£¬0Ϊedge¡£¶ÔÓÚlevel´¥·¢µÄÖжϣ¬µ±Èí¼þдEOIʱ£¬»á±»¹ã²¥µ½ËùÓÐIOAPIC£¬ÏûÏ¢Öк¬ÓÐÖжϵÄvector£¬IOAPICÊÕµ½ºó¼ì²é×Ô¼ºµÄPRT±í£¬°ÑÏàÓ¦RTEµÄRemote IRRλÇåÁã¡£
¶ÔÓÚIRR£¬x86 spec˵£º“µ±CPU×¼±¸´¦ÀíÖжÏʱ£¬IRRÖÐ×î¸ßÓÅÏȼ¶µÄbit±»ÇåÁ㣬ISRÖжÔÓ¦bit±»ÖÃÒ»”¡£ÕâÑù˵²»ÄÜËã´í£¬µ«ÖÁÉÙ²»×¼È·¡£¸ù¾Ý¡¶Multi-Processor Computer System With Interrupt Controllers Providing Remote Reading¡·Ò»ÎÄÖÐAPICµÄʵÏÖ£¬Ö»ÓжÔÓÚedge´¥·¢µÄÖжϣ¬ISR¶ÔÓ¦bitÖÃһʱIRRÏàÓ¦ bit²ÅÇåÁã¡£¶ÔÓÚlevel´¥·¢£¬IRRÖеÄbit±£Áôµ½Èí¼þдEOI£¬LAPICÊÕµ½IOAPIC·¢³öµÄLevel-deassertÏûÏ¢ºó²ÅÇåÁã¡£
Èç¹ûÄã×Ðϸ¿´ÁËÇ°Ãæ¹ØÓÚRemote IRRµÄ½éÉÜ£¬´Ëʱһ¶¨»á²úÉúÒ»¸öÒÉÎÊ¡£ÕâÀï˵ͬÀàÐÍÖжϷ¢ÉúÁ½´Î£¬»áͬʱPendingÔÚISRºÍIRRµÄ¶ÔÓ¦bitÖС£ÎÊÌâÊÇ£¬Ç°ÃæRemote IRRµÄÒì»òÂß¼±£Ö¤ÁËÔÚдEOIÇ°£¬ÐµÄÖжϲ»»á·¢¹ýÀ´°¡£¿ºÇºÇ£¬»òÐíÄãÏëµ½´ð°¸ÁË£¬ÕâÖÖpendingÁ½´ÎµÄ»úÖÆ£¬Ö»¶Ôedge´¥·¢ÖжÏÓÐЧ¡£
ÓëPICÒ»Ñù£¬LAPICͬÑùÐèÒªÈí¼þдEOIÀ´Öª»áÖжϴ¦ÀíµÄÍê³É£¬²»Í¬µÄÊÇ£¬LAPICÖеÄEOIÊÇÒ»¸ö32bit¼Ä
Ïà¹ØÎĵµ£º
Linux Execution and Virtual Memory Utilization
LinuxÖ´ÐÐÒÔ¼°ÐéÄâÄÚ´æÖ®ÓÃ
When Linux boots, it starts with the MMU disabled, so initially it deals only with physical
memory. The kernel image is copied to physical address 0x8000 in DRAM and executed. First a master page table is created ......
ÔÚ³¬¼¶Óû§ÏÂÏÔʾLinuxϵͳÖÐÕýÔÚÔËÐеÄÈ«²¿½ø³Ì£¬Ó¦Ê¹ÓõÄÃüÁî¼°²ÎÊýÊÇ ps -aux ¡£
Linux psÃüÁîÏê½â£º
1)ps a ÏÔʾÏÖÐÐÖն˻úϵÄËùÓгÌÐò,°üÀ¨ÆäËûÓû§µÄ³ÌÐò.
2)ps -A ÏÔʾËùÓгÌÐò.
3)ps c Áгö³ÌÐòʱ,ÏÔʾÿ¸ö³ÌÐòÕæÕýµÄÖ¸ÁîÃû³Æ,¶ø²»°üº¬Â·¾¶,²ÎÊý»ò³ ......
aishen944-163.com
תÌùÇë×¢Ã÷³ö´¦£¬Ð»Ð»£¡£¡
Æäʵ͸Ã÷ÌùͼµÄÔÀí¾ÍÊǽøÐÐxorÔËË㣬
»ù±¾¹«Ê½£ºA xor A = 0 A xor 0 = A A xor A xor B = B
¼ÙÈçÏÖÔÚÓÐÁ½ÕÅͼƬ£¬Ò»ÕÅÊÇÎÒÃÇÒª¶ÔÆä½øÐÐÌùͼµÄͼƬA£¬ ÁíÍâÒ»ÕÅÊÇÒª±»ÌùͼµÄͼƬB
1£¬ ¸´ÖÆͼƬBµÄÒ»·Ý¿½±´ÎªC
2£¬ ½«CÖÐÖ¸¶¨ ......
linuxÖйØÓÚÁ´½ÓÀàÐÍ·ÖΪӲÁ´½ÓºÍÈíÁ´½Ó
Ó²Á´½ÓÖ¸Áî ln Îļþ Á´½ÓÃû³Æ
ÈíÁ´½ÓÖ¸Áî ln -s Îļþ Á´½ÓÃû³Æ
¹²Í¬µã£º
¶¼¿ÉÒÔͨ¹ýÁ´½ÓÃû³ÆÈ¥·ÃÎʱ»Á´½ÓµÄÎļþ
²»Í¬µã£º
Ó²Á´½Ó»á²úÉúÒ»¸öºÍÔ´ÎļþÏàͬµÄÎļþ ²»ÂÛ´óСºÍÊôÐÔ
ɾ³ýÔ´Îļþ²»»á¶ÔÁ´½ÓÎļþ²úÉúÓ°Ïì
&nbs ......