From 15f3911599a8d005edee46247470afe2a7a0b4aa Mon Sep 17 00:00:00 2001 From: Aleksa Vuckovic Date: Mon, 27 Feb 2023 01:59:33 +0100 Subject: almost done multitasking --- kernel/src/devices/timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kernel/src/devices') 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 #include #include +#include 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); + } } } -- cgit v1.2.3