Kernel: Implement syscalls for i686 and cleanup x86_64

This actually allows i686 to boot properly!
This commit is contained in:
2024-04-03 02:23:23 +03:00
parent 9e073e9fa0
commit 0dd74e3c9d
8 changed files with 120 additions and 48 deletions

View File

@@ -1,19 +1,31 @@
.global sys_fork_trampoline
sys_fork_trampoline:
ud2
subl $4, %esp
pushl %ebx
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
call read_ip
testl %eax, %eax
je .done
jz .reload_stack
movl %esp, %ebx
subl $8, %esp
pushl %eax
pushl %esp
pushl %ebx
call sys_fork
addl $16, %esp
.done:
popl %ebp
.done:
popl %edi
popl %esi
popl %ebx
addl $4, %esp
popl %ebp
ret
.reload_stack:
call get_thread_start_sp
movl %eax, %esp
xorl %eax, %eax
jmp .done