interrupt handler problem which doesn't relate to hardware
Posted: Sun Jul 04, 2004 11:19 am
This is a code I wrote to test my kb interrupt handler
I invoked the kb interrupt handler by software , not by IRQs so that IDT problems are discarded
( as mega-tokyo FAQs recommend ) :
//interrupts.c
asm volatile ( "jmp KB_IRQ1_Handler_Wrapper" ) ;
BOCHSHALT ;// This is a c macro written by Brendan to breakpoint into c code
??? //, at any rate it stops execution here.
;int_wrappers.asm
GLOBAL _KB_IRQ1_Handler_Wrapper
EXTERN KB_IRQ1_Handler
ALIGN 4
KB_IRQ1_Handler_Wrapper :
pushad
call KB_IRQ1_Handler
popad
???;after debugging using bochs I found that
???;if you put "hlt" here then no exceptions occur , but
???;if you continue then exception will be raised .
iret
I invoked the kb interrupt handler by software , not by IRQs so that IDT problems are discarded
( as mega-tokyo FAQs recommend ) :
//interrupts.c
asm volatile ( "jmp KB_IRQ1_Handler_Wrapper" ) ;
BOCHSHALT ;// This is a c macro written by Brendan to breakpoint into c code
??? //, at any rate it stops execution here.
;int_wrappers.asm
GLOBAL _KB_IRQ1_Handler_Wrapper
EXTERN KB_IRQ1_Handler
ALIGN 4
KB_IRQ1_Handler_Wrapper :
pushad
call KB_IRQ1_Handler
popad
???;after debugging using bochs I found that
???;if you put "hlt" here then no exceptions occur , but
???;if you continue then exception will be raised .
iret