kern

diff src/syscall.c @ 54:4eaecb14fe31

bringing the task switching thing into shape with proper per-process kernel stacks and shit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 14 Aug 2011 16:57:23 +0300
parents fa65b4f45366
children 0be4615594df
line diff
     1.1 --- a/src/syscall.c	Mon Aug 08 09:53:10 2011 +0300
     1.2 +++ b/src/syscall.c	Sun Aug 14 16:57:23 2011 +0300
     1.3 @@ -35,26 +35,26 @@
     1.4  		return;
     1.5  	}
     1.6  
     1.7 +	/* the return value goes into the interrupt frame copy of the user's eax
     1.8 +	 * so that it'll be restored into eax before returning to userland.
     1.9 +	 */
    1.10  	frm->regs.eax = sys_func[idx](frm->regs.ebx, frm->regs.ecx, frm->regs.edx, frm->regs.esi, frm->regs.edi);
    1.11 -	schedule();
    1.12  }
    1.13  
    1.14  static int sys_exit(int status)
    1.15  {
    1.16 +	printf("SYSCALL: exit\n");
    1.17  	return -1;	/* not implemented yet */
    1.18  }
    1.19  
    1.20  static int sys_hello(void)
    1.21  {
    1.22 -	/*printf("process %d says hello!\n", get_current_pid());*/
    1.23 +	printf("process %d says hello!\n", get_current_pid());
    1.24  	return 0;
    1.25  }
    1.26  
    1.27  static int sys_sleep(int sec)
    1.28  {
    1.29 -	int pid = get_current_pid();
    1.30 -	/*printf("process %d will sleep for %d sec\n", pid, sec);*/
    1.31 -	start_timer(sec * 1000, (timer_func_t)unblock_proc, (void*)pid);
    1.32 -	block_proc(pid);
    1.33 -	return 0;
    1.34 +	printf("SYSCALL: sleep\n");
    1.35 +	return -1;
    1.36  }