diff options
Diffstat (limited to 'src/interrupts.asm')
-rw-r--r-- | src/interrupts.asm | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/interrupts.asm b/src/interrupts.asm index c21229c..9a05883 100644 --- a/src/interrupts.asm +++ b/src/interrupts.asm @@ -37,13 +37,27 @@ interrupts_ignore_request: ; void interrupts_handle_request_0x00( ); %macro exception_stub 1 -global interrupts_handle_request_%1 -interrupts_handle_request_%1: +global interrupts_handle_exception_%1 +interrupts_handle_exception_%1: mov [interrupt_no], byte %1 + jmp int_entry %endmacro exception_stub 0x00 +; IRQs and exceptions would normally collidate, that's why the +; hardware interrupts must be transposed by an offset +IRQ_BASE equ 0x20 + +%macro irq_stub 1 +global interrupts_handle_irq_%1 +interrupts_handle_irq_%1: + mov [interrupt_no], byte IRQ_BASE + %1 + jmp int_entry +%endmacro + +irq_stub 0x00 + int_entry: ; safe state of interrupted code pusha |