blob: e09739466a09ba0d5b6be538f36f75e31b95cee9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# Initial process execs /init.
# This code runs in user space.
#include "syscall.h"
#include "traps.h"
# exec(init, argv)
.globl start
start:
mov $init, %rdi
mov $argv, %rsi
mov $SYS_exec, %rax
syscall
# for(;;) exit();
exit:
mov $SYS_exit, %rax
syscall
jmp exit
# char init[] = "/init\0";
init:
.string "/init\0"
# char *argv[] = { init, 0 };
.p2align 2
argv:
.long init
.long 0
|