diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-04 22:23:37 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-04 22:23:37 +0200 |
commit | 05a6f2fcf4556ba9f3d0384c07554c387f6efba2 (patch) | |
tree | 85d430b47f0d5b1ad004f04d9ab4fbc602c83ed2 /src/hardware/interrupts.asm | |
parent | e6efe69c614d7781d18a7189831e8243abf57664 (diff) | |
download | abaos-05a6f2fcf4556ba9f3d0384c07554c387f6efba2.tar.gz abaos-05a6f2fcf4556ba9f3d0384c07554c387f6efba2.tar.bz2 |
got scheduling of task A and B working (now graphics output and termination is broken)
Diffstat (limited to 'src/hardware/interrupts.asm')
-rw-r--r-- | src/hardware/interrupts.asm | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/src/hardware/interrupts.asm b/src/hardware/interrupts.asm index 155b2af..30204e7 100644 --- a/src/hardware/interrupts.asm +++ b/src/hardware/interrupts.asm @@ -53,6 +53,8 @@ IRQ_BASE equ 0x20 global interrupts_handle_irq_%1 interrupts_handle_irq_%1: mov [interrupt_no], byte IRQ_BASE + %1 + ; error + push 0x0 jmp int_entry %endmacro @@ -62,11 +64,18 @@ irq_stub 0x0C int_entry: ; safe state of interrupted code - pusha - push ds - push es - push fs - push gs + ;pusha + push ebp + push edi + push esi + push edx + push ecx + push ebx + push eax + ;push ds + ;push es + ;push fs + ;push gs ; call the static C handler with the correct interrupt number ; uint32_t interrupts_handle_interrupt( uint8_t interrupt_no, uint32_t esp ); @@ -74,15 +83,25 @@ int_entry: mov eax, [interrupt_no] push eax call interrupts_handle_static_interrupt - ;add esp, 8 + ; switch stack mov esp, eax - ; restore state - pop gs - pop fs - pop es - pop ds - popa + ; restore state (no popa or pusha, we have to align to cpu_state in tasks.h) + ;pop gs + ;pop fs + ;pop es + ;pop ds + ;popa + pop eax + pop ebx + pop ecx + pop edx + pop esi + pop edi + pop ebp + + ; remove error from the stack + add esp, 4 iret |