diff --git a/x86_64/startup-x86_64.asm b/x86_64/startup-x86_64.asm index 60593319523524ab6ef751bab270b362913060fc..963d72b930016dffb96f4d655024cdb81415c064 100644 --- a/x86_64/startup-x86_64.asm +++ b/x86_64/startup-x86_64.asm @@ -122,9 +122,21 @@ long_mode: mov gs, rax mov ss, rax - mov rsp, 0xFFFFFF000009F000 - - ;rust init + ; kernel_base + mov rdi, kernel_base + ; kernel_size + mov rsi, kernel_file.length + ; stack_base + mov rdx, 0xFFFFFF0000080000 + ; stack_size + mov rcx, 0x1F000 + + ; set stack pointer + mov rsp, rdx + add rsp, rcx + sub rsp, 256 + + ; entry point mov rax, [kernel_base + 0x18] jmp rax