summaryrefslogtreecommitdiff
path: root/kernel/src/devices
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/devices')
-rw-r--r--kernel/src/devices/timer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/src/devices/timer.c b/kernel/src/devices/timer.c
index 7971b20..41bcced 100644
--- a/kernel/src/devices/timer.c
+++ b/kernel/src/devices/timer.c
@@ -5,6 +5,7 @@
#include <io.h>
#include <idt.h>
#include <process.h>
+#include <scheduler.h>
uint32_t scheduler_ticks = 0;
uint32_t seconds_tick = 0;
@@ -33,7 +34,9 @@ void timer_handler(uint64_t rsp)
scheduler_ticks++;
if (scheduler_ticks >= TICKS_PER_SECOND / CONTEXT_SWITCHES_PER_SECOND) {
scheduler_ticks = 0;
-/* context_switch(rsp); */
+ if (sched_init) {
+ context_switch(rsp);
+ }
}
}