From f7752e7c082bd8557fce006b533687d9736baa87 Mon Sep 17 00:00:00 2001 From: Ry Date: Sun, 5 Mar 2023 17:36:30 -0800 Subject: [PATCH] kernel/main: Only set rsp if we aren't running under an existing kernel --- kernel/main.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/main.asm b/kernel/main.asm index 1082386..def282e 100644 --- a/kernel/main.asm +++ b/kernel/main.asm @@ -68,8 +68,6 @@ jump_table_end: ; initialization code entry: - mov rsp, SYSTEM_STACK - ; before doing anything, check if we are running on top of an existing instance of the kernel ; we can do this by comparing our load address to the known load address that the bootloader loads us to ; only the high 16 bits are checked @@ -92,6 +90,8 @@ entry: rjmp 0 entry_ok: + mov rsp, SYSTEM_STACK + ; save the boot disk id that the bootloader passed in r0 mov.8 [current_disk_id], r0