Skip to content
Snippets Groups Projects
Commit d10d324e authored by Frans Kaashoek's avatar Frans Kaashoek
Browse files

Remove sys_init syscall

Invoke initlog from forkret on first user process
parent 39f8cc56
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
# exec(init, argv) # exec(init, argv)
.globl start .globl start
start: start:
movl $SYS_init, %eax
int $T_SYSCALL
pushl $argv pushl $argv
pushl $init pushl $init
pushl $0 // where caller pc would be pushl $0 // where caller pc would be
......
...@@ -60,7 +60,7 @@ mpmain(void) ...@@ -60,7 +60,7 @@ mpmain(void)
scheduler(); // start running processes scheduler(); // start running processes
} }
pde_t enterpgdir[]; pde_t enterpgdir[]; // For entry.S
// Start the non-boot (AP) processors. // Start the non-boot (AP) processors.
static void static void
......
...@@ -322,8 +322,14 @@ yield(void) ...@@ -322,8 +322,14 @@ yield(void)
void void
forkret(void) forkret(void)
{ {
static int first = 1;
// Still holding ptable.lock from scheduler. // Still holding ptable.lock from scheduler.
release(&ptable.lock); release(&ptable.lock);
if (first) {
first = 0;
initlog();
}
// Return to "caller", actually trapret (see allocproc). // Return to "caller", actually trapret (see allocproc).
} }
......
...@@ -99,15 +99,7 @@ extern int sys_wait(void); ...@@ -99,15 +99,7 @@ extern int sys_wait(void);
extern int sys_write(void); extern int sys_write(void);
extern int sys_uptime(void); extern int sys_uptime(void);
int
sys_init(void)
{
initlog();
return 0;
}
static int (*syscalls[])(void) = { static int (*syscalls[])(void) = {
[SYS_init] sys_init,
[SYS_fork] sys_fork, [SYS_fork] sys_fork,
[SYS_exit] sys_exit, [SYS_exit] sys_exit,
[SYS_wait] sys_wait, [SYS_wait] sys_wait,
...@@ -122,7 +114,6 @@ static int (*syscalls[])(void) = { ...@@ -122,7 +114,6 @@ static int (*syscalls[])(void) = {
[SYS_sbrk] sys_sbrk, [SYS_sbrk] sys_sbrk,
[SYS_sleep] sys_sleep, [SYS_sleep] sys_sleep,
[SYS_uptime] sys_uptime, [SYS_uptime] sys_uptime,
// File system calls that are run in a transaction:
[SYS_open] sys_open, [SYS_open] sys_open,
[SYS_write] sys_write, [SYS_write] sys_write,
[SYS_mknod] sys_mknod, [SYS_mknod] sys_mknod,
......
// System call numbers // System call numbers
#define SYS_init 0
#define SYS_fork 1 #define SYS_fork 1
#define SYS_exit 2 #define SYS_exit 2
#define SYS_wait 3 #define SYS_wait 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment