diff options
Diffstat (limited to 'src/interrupt_stub.s')
-rw-r--r-- | src/interrupt_stub.s | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/interrupt_stub.s b/src/interrupt_stub.s index 3d2ba53..3838048 100644 --- a/src/interrupt_stub.s +++ b/src/interrupt_stub.s @@ -8,9 +8,10 @@ .macro handle_exception num -.global handle_irq\num -handle_irq\num: +.global handle_exception\num +handle_exception\num: movb $\num, (int_number) + movl $exch_\num, (int_handler) jmp int_bottom .endm @@ -18,40 +19,45 @@ handle_irq\num: .global handle_irq\num handle_irq\num: movb $\num + IRQ_BASE, (int_number) + movl $irqh_\num, (int_handler) jmp int_bottom .endm handle_irq 0x00 handle_irq 0x01 +handle_exception 0x00 +handle_exception 0x01 +handle_exception 0x02 +handle_exception 0x03 +handle_exception 0x06 +handle_exception 0x07 +handle_exception 0x08 handle_exception 0x0D +int_ignore: + + movb $0xFF, (int_number) + movl $0x00, (int_handler) + int_bottom: - pop %eax - push int_bottom - pusha - pushl %ds - pushl %es - pushl %fs - pushl %gs - + + cli + pushl %esp - pushl %eax push (int_number) + pushl (int_handler) call handle_int movl %eax, %esp // Set the stack pointer to the return value of handle_int - popl %gs - popl %fs - popl %es - popl %ds - popa - - iret - -int_ignore: pop %eax + pop %eax + pop %eax + pop %eax + + sti - iret + hlt .data int_number: .byte 0 + int_handler: .int 0 |