|  |  |  |  |  |  | 
					            
						            
							            
								            |  | 
	Windows内核调试帖子发起人: Thomson   发起时间: 2008-09-09 10:15 上午   回复: 3
 
	 
		
			| 
					
						|         | 
						      
						        | 帖子排序: |  |  |  |  
				
					| 
							
								| 
										
											|  2008-09-09, 10:15 上午 |  
											| 
													 Thomson 
 
   注册: 2008-07-03
 发 贴: 211
 | 
													
														| ![Sad [:(]](/emoticons/emotion-6.gif) 什么是SPURIOUS INTERRUPT? 
 |  
														|  |  |  
											| 
													
														|   |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-09-09, 12:59 下午 |  
											| 
													 格蠹老雷 
 
   注册: 2005-12-19
 发 贴: 1,303
 | 
													
														| Re: 什么是SPURIOUS INTERRUPT? 
 |  
														|  |  |  
											| 
													
														|   | 
																
																	| 假造的中断。这样的中断不是来自硬件和中断控制器,而是使用软件方式触发的,所以处理时不需要做EOI(End Of Interrupt)动作。 举例来说,在HAL中,可以看到两个有关的处理例程:
 lkd> uf hal!HalpApicSpuriousService
 hal!HalpApicSpuriousService:
 806cffd0 cf              iretd
 lkd> uf hal!PicSpuriousService37
 hal!PicSpuriousService37:
 806cf728 cf              iretd
 它们都是直接返回。
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-09-09, 14:50 下午 |  
											| 
													 Thomson 
 
   注册: 2008-07-03
 发 贴: 211
 | 
													
														| Re: 什么是SPURIOUS INTERRUPT? 
 |  
														|  |  |  
											| 
													
														|   | 
																
																	| 那这种是否是属于spurious interrupt呢? 
 一个硬件中断到来,ISR被调用,但是是ISR里面(halbeginsysteminterrupt)判断出这个中断对应的IRQL是小于被中断的code,所以把这个中断排队在了虚拟的中断寄存器里面,直接返回,不处理对应中断,也不设置EOI.
 
 
 另外,软件方式触发的中断,是什么形式的?
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-09-10, 22:25 下午 |  
											| 
													 格蠹老雷 
 
   注册: 2005-12-19
 发 贴: 1,303
 | 
													
														| Re: 什么是SPURIOUS INTERRUPT? 
 |  
														|  |  |  
											| 
													
														|   | 
																
																	| 对于第一问,既然是“一个硬件中断到来”,那么它就不是spurious interrupt。 下面的一些汇编指令有助于你理解:
 nt!KiInterruptDispatch+0x15:
 80ad8d35 51              push    ecx
 80ad8d36 ff159030a080    call    dword ptr [nt!_imp__HalBeginSystemInterrupt (80a03090)]
 80ad8d3c 0bc0            or      eax,eax
 ;这里eax是HalBeginSystemInterrupt的返回值。如果返回0,那么就是spurious interrupt
 80ad8d3e 0f84bb000000    je      nt!KiInterruptDispatch+0xdf (80ad8dff)
 ;如果是spurious interrupt就跳到下面即将中断返回了
 
 ....
 ;如果不是,那么会调用驱动程序注册的中断处理函数,即KINTERRUPT结构的 ServiceRoutine(偏移0xc)
 ;下面普通中断的出口,调用HalEndSystemInterrupt
 nt!KiInterruptDispatch+0xc8:
 80ad8de8 83c40c          add     esp,0Ch
 80ad8deb beeb8dad80      mov     esi,offset nt!KiInterruptDispatch+0xcb (80ad8deb)
 80ad8df0 fa              cli
 80ad8df1 ff159430a080    call    dword ptr [nt!_imp__HalEndSystemInterrupt (80a03094)]
 80ad8df7 e960c1ffff      jmp     nt!KiExceptionExit (80ad4f5c)
 ;下面是假造中断的出口
 nt!KiInterruptDispatch+0xdf:
 80ad8dff 83c408          add     esp,8
 80ad8e02 be028ead80      mov     esi,offset nt!KiInterruptDispatch+0xe2 (80ad8e02)
 80ad8e07 e950c1ffff      jmp     nt!KiExceptionExit (80ad4f5c)
 
 尽管不确认NT内核是不是这样使用,但是INT指令就可以触发软件中断呀。说白了,就是让CPU转移到IDT表中对应的中断门描述符......
 
 
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
		
			| 高端调试 » 软件调试 » Windows内核调试 » Re: 什么是SPURIOUS INTERRUPT? |  |  
 |  |  |  |