diff options
Diffstat (limited to 'asm')
| -rw-r--r-- | asm/int_clock_handler.asm | 2 | ||||
| -rw-r--r-- | asm/int_syscall_handler.asm | 30 |
2 files changed, 29 insertions, 3 deletions
diff --git a/asm/int_clock_handler.asm b/asm/int_clock_handler.asm index 6301dc6..5e48658 100644 --- a/asm/int_clock_handler.asm +++ b/asm/int_clock_handler.asm @@ -9,7 +9,7 @@ cli pusha ;Push all standard registers mov eax, esp ;save current stack pointer in esp -mov esp, 0x1000 ;now put the stack outside of virtual memory in kernel space! +mov esp, 0x7000 ;now put the stack outside of virtual memory in kernel space! push eax ;Push pointer to all the stuff we just pushed call task_switch_next ;Call C code diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm index 504d3e8..70090f0 100644 --- a/asm/int_syscall_handler.asm +++ b/asm/int_syscall_handler.asm @@ -1,6 +1,7 @@ global int_syscall_handler [extern task_fork] [extern task_exit] +[extern task_wait] [extern syscall_exit] @@ -25,13 +26,15 @@ pid: dd 0x0 int_syscall_handler: - cmp eax, 72 je call_fork cmp eax, 60 je call_exit +cmp eax, 77 +je call_wait + cli push ebx @@ -96,12 +99,35 @@ done_blocking: iret ;Interrupt-Return +call_wait: + + cli + + pusha ;Push all standard registers + + mov ebx, esp ;save current stack pointer in esp + mov esp, 0x7000 ;now put the stack outside of virtual memory in kernel space! + + push ebx ;Push pointer to all the stuff we just pushed + + call task_wait ;Call C code + + mov esp, eax ;Replace the stack with what the C code gave us + + popa ;Put the standard registers back + + sti + + iretd ;Interrupt-Return + ;;;; + call_exit: cli pusha ;Push all standard registers + mov ebx, esp ;save current stack pointer in esp mov esp, 0x7000 ;now put the stack outside of virtual memory in kernel space! push ebx ;Push pointer to all the stuff we just pushed @@ -126,7 +152,7 @@ call_fork: mov ebx, esp ;save current stack pointer in esp mov esp, 0x7000 ;now put the stack outside of virtual memory in kernel space! - push ebx ;Push pointer to all the stuff we just pushed + push ebx call task_fork ;Call C code mov [pid],eax |
