SOLVED: ISR problems
Posted: Mon Sep 21, 2009 11:21 am
Ok, so this is probably a very basic problem but I'm having trouble with the idt & isrs.
The problem is that whenever a hardware interrupt fires, say a "Divide by zero error" happens the interrupt get's called but it continually repeat's itself. But if a software interrupt fires like "int 0" then the interrupt is called and returns normally.
Here is my isrs.S: (at&t syntax)
Sorry if I'm being a bit unclear about all of this, I just can't figure out what's wrong with it.
The problem is that whenever a hardware interrupt fires, say a "Divide by zero error" happens the interrupt get's called but it continually repeat's itself. But if a software interrupt fires like "int 0" then the interrupt is called and returns normally.
Here is my isrs.S: (at&t syntax)
Code: Select all
.code32
#define ISR(n) \
.global isr##n ; \
isr##n: \
cli; \
pushl $0; \
pushl $##n; \
jmp isr_stub
#define ISR_ERR(n) \
.global isr##n ; \
isr##n: \
cli ; \
pushl $##n ; \
jmp isr_stub
ISR(0)
ISR(1)
ISR(2)
ISR(3)
ISR(4)
ISR(5)
ISR(6)
ISR(7)
ISR_ERR(8)
ISR(9)
ISR_ERR(10)
ISR_ERR(11)
ISR_ERR(12)
ISR_ERR(13)
ISR_ERR(14)
ISR(15)
ISR(16)
ISR(17)
ISR(18)
ISR(19)
ISR(20)
ISR(21)
ISR(22)
ISR(23)
ISR(24)
ISR(25)
ISR(26)
ISR(27)
ISR(28)
ISR(29)
ISR(30)
ISR(31)
isr_stub:
pushal
pushl %ds
pushl %es
pushl %fs
pushl %gs
movw $0x10, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
movl %esp, %eax
pushl %eax
movl $isrs_caller, %eax
calll * %eax
popl %eax
popl %gs
popl %fs
popl %es
popl %ds
popal
add $8, %esp
iret