summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-20 04:51:23 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-20 04:51:23 +0100
commit1acde03a7c0f85aca9919e374e3df6cee6f0bd08 (patch)
tree10ae84ce2693bad62e5c7376cd0c3c40a80c93df /asm
parentbcab3c0be8ff5fe1db1fac9e01973531cc29f554 (diff)
workin on syscall interface etc..
Diffstat (limited to 'asm')
-rw-r--r--asm/int_syscall_handler.asm52
1 files changed, 52 insertions, 0 deletions
diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm
index 25de51a..e9bc79d 100644
--- a/asm/int_syscall_handler.asm
+++ b/asm/int_syscall_handler.asm
@@ -4,6 +4,12 @@ global int_syscall_handler
[extern syscall_read]
[extern syscall_readdir]
[extern syscall_execve]
+[extern syscall_open]
+[extern syscall_close]
+[extern syscall_fstat]
+[extern syscall_isatty]
+[extern syscall_lseek]
+[extern syscall_sbrk]
[bits 32]
int_syscall_handler:
@@ -26,6 +32,24 @@ int_syscall_handler:
cmp eax, 64
je call_execve
+ cmp eax, 65
+ je call_open
+
+ cmp eax, 66
+ je call_close
+
+ cmp eax, 67
+ je call_fstat
+
+ cmp eax, 68
+ je call_isatty
+
+ cmp eax, 69
+ je call_lseek
+
+ cmp eax, 70
+ je call_sbrk
+
done:
mov ebx,eax
@@ -53,11 +77,37 @@ call_write:
call syscall_write
jmp done
+call_open:
+ call syscall_open
+ jmp done
+
call_readdir:
call syscall_readdir
jmp done
+call_close:
+ call syscall_close
+ jmp done
+
+call_fstat:
+ call syscall_fstat
+ jmp done
+
+call_isatty:
+ call syscall_isatty
+ jmp done
+
+call_lseek:
+ call syscall_lseek
+ jmp done
+
+call_sbrk:
+ call syscall_sbrk
+ jmp done
+
+ ;;; THIS CALLS NEED REENABLE INTERRUPTS BEFORE calling workers
call_read:
+
mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
sti
@@ -67,9 +117,11 @@ call_read:
jmp done_blocking
call_execve:
+
mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
sti
+
call syscall_execve
jmp $ ; this should never return TODO: pop stack!?