From ceb9471fed96f907e37a6ba031825c31167a8ff4 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 21 Apr 2025 16:45:28 -0400 Subject: update userland to compile --- user/lib/entry.S | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'user/lib/entry.S') diff --git a/user/lib/entry.S b/user/lib/entry.S index 87ad9c7..34390a0 100644 --- a/user/lib/entry.S +++ b/user/lib/entry.S @@ -1,25 +1,15 @@ -// -// user-level startup routine -// - .text .globl _start - .globl main - .globl exit + .extern main + .extern exit -// entry point - this is where the kernel starts us running + .section .text + .code64 _start: - // we immediately call main() call main - // if we come back from that, it means the user - // program didn't call exit(), in which case the - // value returned from main() is the exit status - - // push that value onto the stack and call exit() - subl $12, %esp - pushl %eax + subq $16, %rsp # ??? + pushq %rax call exit - // if we come back from that, something bad has - // happened, so we just lock up -1: jmp 1b +halt: + jmp halt -- cgit v1.2.3-freya