Kernel: Implement syscalls for i686 and cleanup x86_64
This actually allows i686 to boot properly!
This commit is contained in:
@@ -6,13 +6,16 @@ sys_fork_trampoline:
|
||||
pushq %r13
|
||||
pushq %r14
|
||||
pushq %r15
|
||||
|
||||
call read_ip
|
||||
testq %rax, %rax
|
||||
je .done
|
||||
je .reload_stack
|
||||
|
||||
movq %rax, %rsi
|
||||
movq %rsp, %rdi
|
||||
call sys_fork
|
||||
.done:
|
||||
|
||||
.done:
|
||||
popq %r15
|
||||
popq %r14
|
||||
popq %r13
|
||||
@@ -20,3 +23,9 @@ sys_fork_trampoline:
|
||||
popq %rbp
|
||||
popq %rbx
|
||||
ret
|
||||
|
||||
.reload_stack:
|
||||
call get_thread_start_sp
|
||||
movq %rax, %rsp
|
||||
xorq %rax, %rax
|
||||
jmp .done
|
||||
|
||||
@@ -7,7 +7,7 @@ read_ip:
|
||||
# void start_kernel_thread()
|
||||
.global start_kernel_thread
|
||||
start_kernel_thread:
|
||||
call get_start_kernel_thread_sp
|
||||
call get_thread_start_sp
|
||||
movq %rax, %rsp
|
||||
|
||||
# STACK LAYOUT
|
||||
@@ -27,7 +27,7 @@ start_kernel_thread:
|
||||
|
||||
.global start_userspace_thread
|
||||
start_userspace_thread:
|
||||
call get_start_kernel_thread_sp
|
||||
call get_thread_start_sp
|
||||
movq %rax, %rsp
|
||||
|
||||
# STACK LAYOUT
|
||||
|
||||
Reference in New Issue
Block a user