summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-10-17 01:00:27 +0200
committerMichal Idziorek <m.i@gmx.at>2014-10-17 01:00:27 +0200
commit3983a157056f10651f120cf39c5d3637aa956903 (patch)
tree5d956c9dfb4c625d975a2bc035fd32aa1950b84b /asm
parent1580f8b4401b5f7e6ead12c94cafd42bb045ec6b (diff)
added simple syscall interface
Diffstat (limited to 'asm')
-rw-r--r--asm/int_syscall_handler.asm41
1 files changed, 41 insertions, 0 deletions
diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm
new file mode 100644
index 0000000..e607ff5
--- /dev/null
+++ b/asm/int_syscall_handler.asm
@@ -0,0 +1,41 @@
+global int_syscall_handler
+
+[extern example_syscall]
+[extern example_syscall_2]
+
+[bits 32]
+int_syscall_handler:
+
+ cli
+
+ push ebx
+ push ecx
+ push edx
+
+ cmp eax, 10
+ je call_example_syscall
+
+ cmp eax, 20
+ je call_example_syscall_2
+
+done:
+
+ pop ebx
+ pop ecx
+ pop edx
+
+ mov ebx,eax
+
+ mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
+ out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+
+ sti
+ iret ;Interrupt-Return
+
+call_example_syscall:
+ call example_syscall
+ jmp done
+
+call_example_syscall_2
+ call example_syscall_2
+ jmp done