kernel threads

kernel threads and preemptive multitasking
This commit is contained in:
Matheus
2022-08-13 14:00:26 -03:00
parent ac5339453b
commit e7f4245c6d
14 changed files with 274 additions and 44 deletions
+32
View File
@@ -0,0 +1,32 @@
global arch_switchcontext
arch_switchcontext:
mov rsp,rdi
add rsp, 8 ; cr2
pop rax
mov gs,rax
pop rax
mov fs,rax
pop rax
mov es,rax
pop rax
mov ds,rax
pop rax
pop rbx
pop rcx
pop rdx
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
pop rdi
pop rsi
pop rbp
add rsp,8 ; remove error code
swapgs
iretq