summaryrefslogtreecommitdiff
path: root/stage2/main.asm
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-22 12:29:45 +0100
committerLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-22 12:30:23 +0100
commit619657614489d5953583749617e6fd5a0804ce23 (patch)
treeb5eb413e7dbd196f705e752bcd474daa8e772936 /stage2/main.asm
parent2834bff2cf6131202a788b59a5fd81994e1ed5aa (diff)
downloadcuddles-619657614489d5953583749617e6fd5a0804ce23.tar.xz
SysV ABI compliant stack alignment
and fix outright memory corruption by the scheduler stack
Diffstat (limited to 'stage2/main.asm')
-rw-r--r--stage2/main.asm4
1 files changed, 4 insertions, 0 deletions
diff --git a/stage2/main.asm b/stage2/main.asm
index 7eec56d..3cfb5d2 100644
--- a/stage2/main.asm
+++ b/stage2/main.asm
@@ -44,4 +44,8 @@ long_mode:
mov gs, ax
mov ss, ax
+ ; align stack
+ and rsp, ~(0x0f)
+ sub rsp, 8
+
; kernel begins here