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
+14
View File
@@ -1,5 +1,9 @@
#include <Arch/Timer.h>
#include <Arch/GIC.h>
#include <OS/Scheduler.h>
#include <Arch/Exceptions.h>
static volatile UInt64 sTimerCounter = 0;
void TimerInitialize() {
GICEnableInterrupt(kTimerIRQ);
@@ -12,3 +16,13 @@ void TimerReset(UInt64 interval) {
__asm__ volatile ("msr cntv_tval_el0, %0" :: "r"(frequency /interval));
__asm__ volatile ("msr cntv_ctl_el0, %0" :: "r"((UInt64)1));
}
Address TimerHandler(ExceptionsContext* frame) {
sTimerCounter++;
TimerReset(kTimerFrequency);
return SchedulerNext((Address)frame);
}
UInt64 TimerGetCounter() {
return sTimerCounter;
}