2007-08-21 19:22:08 +00:00
|
|
|
# Initial process execs /init.
|
|
|
|
|
|
|
|
#include "syscall.h"
|
|
|
|
#include "traps.h"
|
|
|
|
|
2011-07-28 00:35:46 +00:00
|
|
|
|
2007-08-21 19:22:08 +00:00
|
|
|
# exec(init, argv)
|
2007-08-27 23:32:16 +00:00
|
|
|
.globl start
|
2007-08-21 19:22:08 +00:00
|
|
|
start:
|
|
|
|
pushl $argv
|
|
|
|
pushl $init
|
2009-07-12 02:26:01 +00:00
|
|
|
pushl $0 // where caller pc would be
|
2007-08-21 19:22:08 +00:00
|
|
|
movl $SYS_exec, %eax
|
|
|
|
int $T_SYSCALL
|
|
|
|
|
|
|
|
# for(;;) exit();
|
|
|
|
exit:
|
|
|
|
movl $SYS_exit, %eax
|
|
|
|
int $T_SYSCALL
|
|
|
|
jmp exit
|
|
|
|
|
2007-08-24 19:37:24 +00:00
|
|
|
# char init[] = "/init\0";
|
2007-08-21 19:22:08 +00:00
|
|
|
init:
|
|
|
|
.string "/init\0"
|
|
|
|
|
2007-08-24 19:37:24 +00:00
|
|
|
# char *argv[] = { init, 0 };
|
2007-08-21 19:22:08 +00:00
|
|
|
.p2align 2
|
|
|
|
argv:
|
|
|
|
.long init
|
|
|
|
.long 0
|
|
|
|
|