feat(scheduler): working scheduler

This commit is contained in:
karina
2026-04-29 17:00:11 +04:00
parent 3f51d93a4e
commit e06abbcb23
12 changed files with 220 additions and 17 deletions
+8 -4
View File
@@ -52,14 +52,18 @@ void GICCWriteEOIR(UInt32 irqID) {
GICC[kGICCEOIR / 4] = irqID;
}
void GICDispatch(ExceptionsType type) {
if (type != ExceptionsIRQEl1h && type != ExceptionsIRQEl064) return;
Address GICDispatch(ExceptionsContext* frame, ExceptionsType type) {
if (type != ExceptionsIRQEl1h && type != ExceptionsIRQEl064) return (Address)frame;
UInt32 irqID = GICCReadIAR() & 0x3FF;
if (irqID == 1023) return; // spurious interrupt
if (irqID == 1023) return (Address)frame; // spurious interrupt
Address newStackPointer = (Address)frame;
if (irqID == kTimerIRQ) {
TimerReset(kTimerFrequency);
newStackPointer = TimerHandler(frame);
}
GICCWriteEOIR(irqID);
return newStackPointer;
}