diff options
| author | Miguel <m.i@gmx.at> | 2018-08-23 03:20:56 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-23 03:20:56 +0200 |
| commit | 4404fa9b3d98646f942e32146722a9d0a68edc13 (patch) | |
| tree | 79e494ec81a462db0217fc763a7ddae1827c02bd /asm/int_syscall_handler.asm | |
| parent | 98bf7b67543b36b6fe49f2b68c115ebeaf630603 (diff) | |
never ending struggle with forking
Diffstat (limited to 'asm/int_syscall_handler.asm')
| -rw-r--r-- | asm/int_syscall_handler.asm | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm index a26592f..4031f3d 100644 --- a/asm/int_syscall_handler.asm +++ b/asm/int_syscall_handler.asm @@ -148,29 +148,31 @@ call_exit: ;;;; call_fork: + + pusha ;Push all standard registers - 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 ds + push es + push fs + push gs + mov ebx, esp ; pass it in push ebx call task_fork ;Call C code - mov [pid],eax + pop ebx - mov esp, ebx ;Replace the stack with what the C code gave us - + pop ds + pop es + pop fs + pop gs + + mov [pid],eax ; save return val, so it survives popa popa ;Put the standard registers back mov ebx,[pid] - sti - iretd ;Interrupt-Return - ;;;; call_timeofday: call syscall_gettimeofday |
