summaryrefslogtreecommitdiff
path: root/user/lib/entry.S
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-21 16:45:28 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-21 16:45:33 -0400
commitceb9471fed96f907e37a6ba031825c31167a8ff4 (patch)
treed98392e420b4541a6ba926ff4d8b3ebe85734580 /user/lib/entry.S
parentupdate linker scripts (diff)
downloadcomus-ceb9471fed96f907e37a6ba031825c31167a8ff4.tar.gz
comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.tar.bz2
comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.zip
update userland to compile
Diffstat (limited to 'user/lib/entry.S')
-rw-r--r--user/lib/entry.S26
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