summaryrefslogtreecommitdiff
path: root/initcode.S
diff options
context:
space:
mode:
Diffstat (limited to 'initcode.S')
-rw-r--r--initcode.S28
1 files changed, 28 insertions, 0 deletions
diff --git a/initcode.S b/initcode.S
new file mode 100644
index 0000000..c87c4b1
--- /dev/null
+++ b/initcode.S
@@ -0,0 +1,28 @@
+# Initial process execs /init.
+
+#include "syscall.h"
+#include "traps.h"
+
+# exec(init, argv)
+start:
+ pushl $argv
+ pushl $init
+ pushl $0
+ movl $SYS_exec, %eax
+ int $T_SYSCALL
+
+# for(;;) exit();
+exit:
+ movl $SYS_exit, %eax
+ int $T_SYSCALL
+ jmp exit
+
+# "/init\0"
+init:
+ .string "/init\0"
+
+.p2align 2
+argv:
+ .long init
+ .long 0
+