initcode.S (423B)
1 # Initial process execs /init. 2 3 #include "syscall.h" 4 #include "traps.h" 5 6 7 # exec(init, argv) 8 .globl start 9 start: 10 pushl $argv 11 pushl $init 12 pushl $0 // where caller pc would be 13 movl $SYS_exec, %eax 14 int $T_SYSCALL 15 16 # for(;;) exit(); 17 exit: 18 movl $SYS_exit, %eax 19 int $T_SYSCALL 20 jmp exit 21 22 # char init[] = "/init\0"; 23 init: 24 .string "/init\0" 25 26 # char *argv[] = { init, 0 }; 27 .p2align 2 28 argv: 29 .long init 30 .long 0 31