Modularize interrupt handlers, split up scheduler and PIT interrupt handlers

This commit is contained in:
2025-11-17 01:08:23 +01:00
parent f2b7c5da57
commit 77b5a4a153
6 changed files with 70 additions and 25 deletions

View File

@ -16,8 +16,9 @@
#include "std/string.h"
#include "cpu/gdt.h"
#include "intr/intr.h"
#include "switch.h"
#include "intr/pic.h"
#include "vmm/vmm.h"
#include "proc/switch.h"
#include "elf.h"
#include "errors.h"
#include "kprintf.h"
@ -252,10 +253,18 @@ void proc_killself(void) {
proc_kill(proc);
}
int proc_intr(IntrStackFrame *frame) {
intr_pic_eoi();
proc_sched(frame);
return INTR_NOEOI;
}
void proc_init(void) {
spinlock_init(&PROCS.spinlock);
PROCS.procs = NULL;
intr_attchhandler(&proc_intr, INTR_IRQBASE+0);
Proc *init = proc_spawnuser("base", "/bin/init");
PROCS.current = init;
proc_register(init);