summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2011-08-22 20:05:15 -0400
committerFrans Kaashoek <[email protected]>2011-08-22 20:05:15 -0400
commitd10d324e79bdcd7d7ab57952e6b140009737e868 (patch)
treeab693343b57db922a91e5fc33266742370595bd6
parent39f8cc56d30bd1aaf097f17de0c410424c59a3f0 (diff)
downloadxv6-labs-d10d324e79bdcd7d7ab57952e6b140009737e868.tar.gz
xv6-labs-d10d324e79bdcd7d7ab57952e6b140009737e868.tar.bz2
xv6-labs-d10d324e79bdcd7d7ab57952e6b140009737e868.zip
Remove sys_init syscall
Invoke initlog from forkret on first user process
-rw-r--r--initcode.S2
-rw-r--r--main.c2
-rw-r--r--proc.c6
-rw-r--r--syscall.c9
-rw-r--r--syscall.h1
5 files changed, 7 insertions, 13 deletions
diff --git a/initcode.S b/initcode.S
index d86660a..109341a 100644
--- a/initcode.S
+++ b/initcode.S
@@ -7,8 +7,6 @@
# exec(init, argv)
.globl start
start:
- movl $SYS_init, %eax
- int $T_SYSCALL
pushl $argv
pushl $init
pushl $0 // where caller pc would be
diff --git a/main.c b/main.c
index 129a0e9..13fed7c 100644
--- a/main.c
+++ b/main.c
@@ -60,7 +60,7 @@ mpmain(void)
scheduler(); // start running processes
}
-pde_t enterpgdir[];
+pde_t enterpgdir[]; // For entry.S
// Start the non-boot (AP) processors.
static void
diff --git a/proc.c b/proc.c
index 96a9c8e..23a53bc 100644
--- a/proc.c
+++ b/proc.c
@@ -322,8 +322,14 @@ yield(void)
void
forkret(void)
{
+ static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
+
+ if (first) {
+ first = 0;
+ initlog();
+ }
// Return to "caller", actually trapret (see allocproc).
}
diff --git a/syscall.c b/syscall.c
index 71c369c..0918da7 100644
--- a/syscall.c
+++ b/syscall.c
@@ -99,15 +99,7 @@ extern int sys_wait(void);
extern int sys_write(void);
extern int sys_uptime(void);
-int
-sys_init(void)
-{
- initlog();
- return 0;
-}
-
static int (*syscalls[])(void) = {
-[SYS_init] sys_init,
[SYS_fork] sys_fork,
[SYS_exit] sys_exit,
[SYS_wait] sys_wait,
@@ -122,7 +114,6 @@ static int (*syscalls[])(void) = {
[SYS_sbrk] sys_sbrk,
[SYS_sleep] sys_sleep,
[SYS_uptime] sys_uptime,
-// File system calls that are run in a transaction:
[SYS_open] sys_open,
[SYS_write] sys_write,
[SYS_mknod] sys_mknod,
diff --git a/syscall.h b/syscall.h
index e9e43a2..59a4576 100644
--- a/syscall.h
+++ b/syscall.h
@@ -1,5 +1,4 @@
// System call numbers
-#define SYS_init 0
#define SYS_fork 1
#define SYS_exit 2
#define SYS_wait 3