ISR correct?
Posted: Thu Sep 26, 2002 8:05 am
I'm wondering if following ISR is correct:
This is just the code that sets up the ISR:
And this is the actual ISR:
I'm specially wondering, if the instructions
are correct. I think they are, but I need to be sure
This is just the code that sets up the ISR:
Code: Select all
[BITS 32]???; Protected Mode
[global setup_handlers]???; called by an extern function
[extern idt]
setup_handlers:
???; ok, let's just do it...
???; set up different interrupt handlers
???; all ISRs are defined in kernel/ints.asm
???; interrupts are still disabled (good)
???
???; IRQ1 (keyboard)
???extern int_irq1
???push ebx???; save
???push edx???; registers
???
???mov ebx, 0x21???; the interrupt number
???shl ebx, 3???; need to multiply by 8
???mov edx, [idt]???; address of IDT to edx
???mov [edx + ebx], dword int_irq1???; interrupt service routine
???pop edx???; restore
???pop ebx???; registers
???ret
Code: Select all
[BITS 32]
[global int_irq1]
int_irq1:
iret ; do nothing yet
Code: Select all
mov edx, [idt]???; address of IDT to edx
???mov [edx + ebx], dword int_irq1???; interrupt service routine