From 2ec1959fd1016a18ef3b2d154ce7076be8f237e4 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 31 May 2019 09:45:59 -0400 Subject: fork/wait/exit work --- initcode.S | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'initcode.S') diff --git a/initcode.S b/initcode.S index e097394..ca76972 100644 --- a/initcode.S +++ b/initcode.S @@ -2,22 +2,20 @@ # 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 + la a0, init + la a1, argv + li a7, SYS_exec + ecall # for(;;) exit(); exit: - mov $SYS_exit, %rax - syscall - jmp exit + li a7, SYS_exit + ecall + jal exit # char init[] = "/init\0"; init: @@ -28,4 +26,3 @@ init: argv: .long init .long 0 - -- cgit v1.2.3