diff options
| author | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-02-27 01:59:33 +0100 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-02-27 01:59:33 +0100 |
| commit | 15f3911599a8d005edee46247470afe2a7a0b4aa (patch) | |
| tree | 3113b84e1ddddc1f4937ca5596d8e32aacc4f51f /kernel/src/devices/timer.c | |
| parent | a164ca67174ba6179170dea573479f23122513cc (diff) | |
almost done multitasking
Diffstat (limited to 'kernel/src/devices/timer.c')
| -rw-r--r-- | kernel/src/devices/timer.c | 5 |
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); + } } } |
