[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:
Justin C. Miller
2021-02-03 17:01:19 -08:00
parent e4c8a36577
commit 2244764777

View File

@@ -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