system calls

This commit is contained in:
Matheus
2022-08-15 21:52:57 -03:00
parent 21e6a0ad1a
commit 432e85b837
17 changed files with 187 additions and 26 deletions
+6 -2
View File
@@ -162,9 +162,9 @@ void sched_timerhook(arch_regs* regs){
spinlock_release(&running.lock);
memcpy(current->regs, regs, sizeof(arch_regs));
arch_regs_saveextra(&current->extraregs);
spinlock_acquire(&currentqueue->lock);
@@ -198,6 +198,8 @@ static void switch_thread(thread_t* thread){
arch_setkernelstack(thread->kernelstack);
arch_regs_setupextra(&thread->extraregs);
arch_switchcontext(thread->regs);
__builtin_unreachable();
@@ -291,6 +293,8 @@ void sched_runinit(){
printf("ELF load error: %s\n", strerror(ret));
_panic("Could not load init", 0);
}
thread->extraregs.gsbase = 0xFFFFFFFFDEADBEEF;
switch_thread(thread);