feat: introduced tasking, added paging (no vm), moved malloc, added

syscalls, other stuff
This commit is contained in:
2021-02-27 11:46:26 +01:00
parent 8f615b259c
commit 9f72d4bb1a
42 changed files with 907 additions and 292 deletions

42
kernel/tasks/task.S Normal file
View File

@@ -0,0 +1,42 @@
.code32
.global __task_entry_point
__task_entry_point:
# Load segments
popl %eax
movw %ax,%ds
movw %ax,%es
movw %ax,%fs
movw %ax,%gs
# pop isr_registers
popa
# Remove errono etc.
addl $8,%esp # Cleans up the pushed error code and pushed ISR number
sti
# return to program
iret # pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP
.global __task_entry_point_inner
__task_entry_point_inner:
add $8, %esp # Remove useresp and ss (only exists in user space)
call task_entry_point
.global switch_task
switch_task:
movl 4(%esp), %eax
movl 8(%esp), %edx
test %eax, %eax
jz _st_no_store
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp, (%eax)
_st_no_store:
movl %edx, %esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret