diff options
author | rsc <rsc> | 2007-08-21 19:22:08 +0000 |
---|---|---|
committer | rsc <rsc> | 2007-08-21 19:22:08 +0000 |
commit | f32f3638f4c34fbf2fc4398878e6304612bb3283 (patch) | |
tree | cabca9bf9ac8b1465b2c59e27e3dc8020c02e2be /initcode.S | |
parent | 2d61a40b2059b9a198e7c4ff04c6ced88cb3ce65 (diff) | |
download | xv6-labs-f32f3638f4c34fbf2fc4398878e6304612bb3283.tar.gz xv6-labs-f32f3638f4c34fbf2fc4398878e6304612bb3283.tar.bz2 xv6-labs-f32f3638f4c34fbf2fc4398878e6304612bb3283.zip |
Various cleanup:
- Got rid of dummy proc[0]. Now proc[0] is init.
- Added initcode.S to exec /init, so that /init is
just a regular binary.
- Moved exec out of sysfile to exec.c
- Moved code dealing with fs guts (like struct inode)
from sysfile.c to fs.c. Code dealing with system call
arguments stays in sysfile.c
- Refactored directory routines in fs.c; should be simpler.
- Changed iget to return *unlocked* inode structure.
This solves the lookup-then-use race in namei
without introducing deadlocks.
It also enabled getting rid of the dummy proc[0].
Diffstat (limited to 'initcode.S')
-rw-r--r-- | initcode.S | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/initcode.S b/initcode.S new file mode 100644 index 0000000..c87c4b1 --- /dev/null +++ b/initcode.S @@ -0,0 +1,28 @@ +# Initial process execs /init. + +#include "syscall.h" +#include "traps.h" + +# exec(init, argv) +start: + pushl $argv + pushl $init + pushl $0 + movl $SYS_exec, %eax + int $T_SYSCALL + +# for(;;) exit(); +exit: + movl $SYS_exit, %eax + int $T_SYSCALL + jmp exit + +# "/init\0" +init: + .string "/init\0" + +.p2align 2 +argv: + .long init + .long 0 + |