diff options
Diffstat (limited to 'user/lib/entry.S')
-rw-r--r-- | user/lib/entry.S | 26 |
1 files changed, 8 insertions, 18 deletions
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 |