From 619657614489d5953583749617e6fd5a0804ce23 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Fri, 22 Dec 2023 12:29:45 +0100 Subject: SysV ABI compliant stack alignment and fix outright memory corruption by the scheduler stack --- stage2/main.asm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'stage2') 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 -- cgit v1.2.3