Simplify task switches

No longer using the rsp from the entry to the kernel, but instead
switching rsp at task-switching time in assembly.

This currently breaks fork()
This commit is contained in:
Justin C. Miller
2019-03-31 22:49:24 -07:00
parent 5cdbedd4d1
commit ca2362f858
21 changed files with 311 additions and 178 deletions

32
src/kernel/tasking.inc Normal file
View File

@@ -0,0 +1,32 @@
struc TCB
.rsp: resq 1
.rsp0: resq 1
.pml4: resq 1
endstruc
struc CPU_DATA
.rsp0: resq 1
.rsp3: resq 1
.tcb: resq 1
endstruc
struc TSS
.res0: resd 1
.rsp0: resq 1
.rsp1: resq 1
.rsp2: resq 1
.ist0: resq 1
.ist1: resq 1
.ist2: resq 1
.ist3: resq 1
.ist4: resq 1
.ist5: resq 1
.ist6: resq 1
.ist7: resq 1
.res1: resq 1
.res2: resw 1
.iomap: resw 1
endstruc
; vim: ft=asm