mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Set process stack pointer correctly
The rsp returned by initialize_main_user_stack() needs to be put into the cpu data area, not just put into the stack (the stack only fills in rbp).
This commit is contained in:
@@ -63,6 +63,7 @@ initialize_main_thread:
|
|||||||
|
|
||||||
; user rsp is now in rax, put it in the right place for sysret
|
; user rsp is now in rax, put it in the right place for sysret
|
||||||
mov [rsp + 0x30], rax
|
mov [rsp + 0x30], rax
|
||||||
|
mov [gs:CPU_DATA.rsp3], rax
|
||||||
|
|
||||||
; the entrypoint should already be on the stack
|
; the entrypoint should already be on the stack
|
||||||
jmp kernel_to_user_trampoline
|
jmp kernel_to_user_trampoline
|
||||||
|
|||||||
Reference in New Issue
Block a user