Permalink
Browse files

yes

  • Loading branch information...
2 parents 7727fd5 + 8d97b2c commit 5a25fed6a8a17a165fcd1775cb72e4ad79b80041 @grantborthwick committed Oct 28, 2012
Showing with 6 additions and 6 deletions.
  1. +0 −1 src/lib/user/syscall.c
  2. BIN src/userprog/filesys.dsk.backup
  3. +6 −5 src/userprog/syscall.c
View
@@ -1,6 +1,5 @@
#include <syscall.h>
#include "../syscall-nr.h"
-#include <stdio.h>
/* Invokes syscall NUMBER, passing no arguments, and returns the
return value as an `int'. */
Binary file not shown.
View
@@ -77,9 +77,12 @@ syscall_handler (struct intr_frame *f)
unsigned call_nr;
int args[3];
+
/* Get the system call. */
copy_in(&call_nr, f->esp, sizeof call_nr);
+ printf("entering SYSCALLER: %d\n", call_nr);
+
if(call_nr >= sizeof syscall_table / sizeof *syscall_table)
thread_exit();
sc = syscall_table + call_nr;
@@ -193,16 +196,16 @@ sys_exit (int exit_code)
static int
sys_exec (const char *ufile)
{
-/* Add code */
- thread_exit ();
+ char *kfile = copy_in_string(ufile);
+ return process_execute(kfile);
}
/* Wait system call. */
static int
sys_wait (tid_t child)
{
- process_wait(child);
//thread_exit ();
+ return process_wait(child);
}
/* Create system call. */
@@ -217,7 +220,6 @@ sys_create (const char *ufile, unsigned initial_size)
sucess = filesys_create (kfile, (off_t)initial_size);
}
lock_release (&fs_lock);
-
return sucess;
}
@@ -400,7 +402,6 @@ sys_tell (int handle)
file_tell(fd->file);
lock_release (&fs_lock);
}
- thread_exit ();
}
/* Close system call. */

0 comments on commit 5a25fed

Please sign in to comment.