diff options
Diffstat (limited to 'driver/timer.c')
| -rw-r--r-- | driver/timer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/driver/timer.c b/driver/timer.c index 30a30c6..4b8f050 100644 --- a/driver/timer.c +++ b/driver/timer.c @@ -1,6 +1,7 @@ +#include "timer.h" +#include "interrupts.h" #include "kernel.h" #include "log.h" -#include "timer.h" #include "asm_x86.h" #include "asm_pit.h" @@ -148,6 +149,11 @@ static uint64_t get_rtc_time() return epoch_seconds; } +uint32_t timer_interrupt(uint32_t esp) +{ + asm_pit_tick(); + return esp; +} // PIT uint64_t timer_init() @@ -156,7 +162,9 @@ uint64_t timer_init() task_system_clock_start=epoch_time*25; // since pit ticks 25times a second asm_pit_rate_40ms(); //tick at 25hz fixme("pit rate does only seem to work occasionally.. 1/25 seconds???" ); + interrupt_register(INTERRUPT_PIT_TIMER,&timer_interrupt); return epoch_time; + } uint64_t timer_get_ms() |
