diff options
Diffstat (limited to 'src/kernel/timer/timer.c')
-rw-r--r-- | src/kernel/timer/timer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel/timer/timer.c b/src/kernel/timer/timer.c index dd4e165..9bf6014 100644 --- a/src/kernel/timer/timer.c +++ b/src/kernel/timer/timer.c @@ -1,6 +1,7 @@ #include <kernel/interrupts/interrupts.h> #include <kernel/io/io.h> #include <kernel/system.h> +#include <kernel/tasks/task.h> unsigned long timer_ticks = 0; @@ -8,14 +9,15 @@ void timer_phase(int hz) { int divisor = (int) (3579545.0 / 3.0 / (double) hz); outb(0x43, 0x36); // 01 10 11 0b // CTR, RW, MODE, BCD - outb(0x40, divisor & 0xFF); - outb(0x40, divisor >> 8); + outb(0x40, (uint8_t) (divisor & 0xFF)); + outb(0x40, (uint8_t) (divisor >> 8)); } // Executed 1000 times per second void timer_handler(struct regs *r) { timer_ticks++; + // switch_task(); } // "Delay" function with CPU sleep |