aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/interrupts/irq.asm
diff options
context:
space:
mode:
authorMarvin Borner2019-12-04 20:38:10 +0100
committerMarvin Borner2019-12-04 20:38:10 +0100
commited3da12bb378d82878fff1d50e5e9e7af3d7265d (patch)
tree53200ca859511e5464bfd50923a3229590997607 /src/kernel/interrupts/irq.asm
parente9407b091b34d93014b89660601da62f13df37aa (diff)
More-working syscall logic (parameters work!)
Diffstat (limited to 'src/kernel/interrupts/irq.asm')
-rw-r--r--src/kernel/interrupts/irq.asm167
1 files changed, 32 insertions, 135 deletions
diff --git a/src/kernel/interrupts/irq.asm b/src/kernel/interrupts/irq.asm
index c485613..f616944 100644
--- a/src/kernel/interrupts/irq.asm
+++ b/src/kernel/interrupts/irq.asm
@@ -1,136 +1,33 @@
-global irq0
-global irq1
-global irq2
-global irq3
-global irq4
-global irq5
-global irq6
-global irq7
-global irq8
-global irq9
-global irq10
-global irq11
-global irq12
-global irq13
-global irq14
-global irq15
-
-; 32: IRQ0
-irq0:
- cli
- push byte 0
- push byte 32
- jmp irq_common_stub
-
-; 33: IRQ1
-irq1:
- cli
- push byte 0
- push byte 33
- jmp irq_common_stub
-
-; 34: IRQ2
-irq2:
- cli
- push byte 0
- push byte 34
- jmp irq_common_stub
-
-; 35: IRQ3
-irq3:
- cli
- push byte 0
- push byte 35
- jmp irq_common_stub
-
-; 36: IRQ4
-irq4:
- cli
- push byte 0
- push byte 36
- jmp irq_common_stub
-
-; 37: IRQ5
-irq5:
- cli
- push byte 0
- push byte 37
- jmp irq_common_stub
-
-; 38: IRQ6
-irq6:
- cli
- push byte 0
- push byte 38
- jmp irq_common_stub
-
-; 39: IRQ7
-irq7:
- cli
- push byte 0
- push byte 39
- jmp irq_common_stub
-
-; 40: IRQ8
-irq8:
- cli
- push byte 0
- push byte 40
- jmp irq_common_stub
-
-; 41: IRQ9
-irq9:
- cli
- push byte 0
- push byte 41
- jmp irq_common_stub
-
-; 42: IRQ10
-irq10:
- cli
- push byte 0
- push byte 42
- jmp irq_common_stub
-
-; 43: IRQ11
-irq11:
- cli
- push byte 0
- push byte 43
- jmp irq_common_stub
-
-; 44: IRQ12
-irq12:
- cli
- push byte 0
- push byte 44
- jmp irq_common_stub
-
-; 45: IRQ13
-irq13:
- cli
- push byte 0
- push byte 45
- jmp irq_common_stub
-
-; 46: IRQ14
-irq14:
- cli
- push byte 0
- push byte 46
- jmp irq_common_stub
-
-; 47: IRQ15
-irq15:
- cli
- push byte 0
- push byte 47
- jmp irq_common_stub
+%macro IRQ 2
+ global irq%1
+ irq%1:
+ cli
+ push byte 0
+ push byte %2
+ jmp irq_common_stub
+%endmacro
+
+IRQ 0, 32
+IRQ 1, 33
+IRQ 2, 34
+IRQ 3, 35
+IRQ 4, 36
+IRQ 5, 37
+IRQ 6, 38
+IRQ 7, 39
+IRQ 8, 40
+IRQ 9, 41
+IRQ 10, 42
+IRQ 11, 43
+IRQ 12, 44
+IRQ 13, 45
+IRQ 14, 46
+IRQ 15, 47
extern irq_handler
-
irq_common_stub:
pusha
+
push ds
push es
push fs
@@ -141,17 +38,17 @@ irq_common_stub:
mov es, ax
mov fs, ax
mov gs, ax
- mov eax, esp
+ cld
- push eax
- mov eax, irq_handler
- call eax
- pop eax
+ push esp
+ call irq_handler
+ add esp, 4
pop gs
pop fs
pop es
pop ds
popa
+
add esp, 8
- iret
+ iret \ No newline at end of file