Mercurial > hg > Members > tobaru > CbC_xv6
diff src/initcode.S @ 0:83c23a36980d
Init
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 26 May 2017 23:11:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/initcode.S Fri May 26 23:11:05 2017 +0900 @@ -0,0 +1,28 @@ +# Initial process execs /init. + +#include "syscall.h" + +.globl start + +# exec(init, argv) +start: + LDR r1, =init + LDR r2, =argv + MOV r0, #SYS_exec + SWI 0x00 + +exit: + MOV r0, #SYS_exit + SWI 0x00 + B exit + +# char init[] = "/init\0"; +init: + .string "/init\0" + +# char *argv[] = { init, 0 }; +.p2align 2 +argv: + .word init + .word 0 +