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
+13
View File
@@ -0,0 +1,13 @@
#include <arch/regs.h>
void arch_regs_setupkernel(arch_regs* regs, void* ip, void* stack, bool interrupts){
regs->rip = ip;
regs->rsp = stack;
regs->cs = 0x28;
regs->ds = 0x30;
regs->es = 0x30;
regs->fs = 0x30;
regs->gs = 0x30;
regs->ss = 0x30;
regs->rflags = interrupts ? 0x200 : 0;
}