From 6126525ed2ad3fb2543c43dbca6b01106af02180 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 8 Aug 2023 18:53:26 +0200 Subject: bootstrap: fix main()'s stack alignment --- src/user/bootstrap/entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/user/bootstrap/entry.S') diff --git a/src/user/bootstrap/entry.S b/src/user/bootstrap/entry.S index 04b4238..bd1b417 100644 --- a/src/user/bootstrap/entry.S +++ b/src/user/bootstrap/entry.S @@ -14,7 +14,6 @@ _start: mov $(STACK_PAGES * 0x1000), %rdx mov $MEMFLAG_PRESENT, %r10 syscall - mov $(STACK_TOP & ~0xF), %rsp mov $_SYS_MEMFLAG, %rdi mov $_bss_start, %rsi @@ -24,4 +23,5 @@ _start: mov %rsp, %r8 syscall - jmp main + mov $(STACK_TOP & ~0xF), %rsp + call main // and don't you dare return -- cgit v1.2.3