kernel/main: Only set rsp if we aren't running under an existing kernel

This commit is contained in:
Ry 2023-03-05 17:36:30 -08:00
parent 6318fbb6f9
commit f7752e7c08

View File

@ -68,8 +68,6 @@ jump_table_end:
; initialization code ; initialization code
entry: entry:
mov rsp, SYSTEM_STACK
; before doing anything, check if we are running on top of an existing instance of the kernel ; 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 ; 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 ; only the high 16 bits are checked
@ -92,6 +90,8 @@ entry:
rjmp 0 rjmp 0
entry_ok: entry_ok:
mov rsp, SYSTEM_STACK
; save the boot disk id that the bootloader passed in r0 ; save the boot disk id that the bootloader passed in r0
mov.8 [current_disk_id], r0 mov.8 [current_disk_id], r0