root/user/initcode.S

/* [<][>][^][v][top][bottom][index][help] */
   1 # Initial process that execs /init.
   2 # This code runs in user space.
   3 
   4 #include "syscall.h"
   5 
   6 # exec(init, argv)
   7 .globl start
   8 start:
   9         la a0, init
  10         la a1, argv
  11         li a7, SYS_exec
  12         ecall
  13 
  14 # for(;;) exit();
  15 exit:
  16         li a7, SYS_exit
  17         ecall
  18         jal exit
  19 
  20 # char init[] = "/init\0";
  21 init:
  22   .string "/init\0"
  23 
  24 # char *argv[] = { init, 0 };
  25 .p2align 2
  26 argv:
  27   .quad init
  28   .quad 0

/* [<][>][^][v][top][bottom][index][help] */