diff options
author | Marvin Borner | 2019-10-02 20:01:17 +0200 |
---|---|---|
committer | Marvin Borner | 2019-10-02 20:01:17 +0200 |
commit | 3238ced93283a167675f20244ec9fd6310eb8002 (patch) | |
tree | 288078ca30e9e4b5d5ba9a178315cb5ee9f6a2d8 /src/kernel/timer | |
parent | 682c47a98844ffec3f3129160e9cdb98ba129989 (diff) |
Finally fixed VESA auto resolution finder
This was quite hard and strange but it works now!
Diffstat (limited to 'src/kernel/timer')
-rw-r--r-- | src/kernel/timer/timer.c | 6 | ||||
-rw-r--r-- | src/kernel/timer/timer.h | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/kernel/timer/timer.c b/src/kernel/timer/timer.c index 45b254e..f332429 100644 --- a/src/kernel/timer/timer.c +++ b/src/kernel/timer/timer.c @@ -1,7 +1,7 @@ #include "../interrupts/interrupts.h" #include "../io/io.h" -volatile unsigned int timer_ticks = 0; +static unsigned int timer_ticks = 0; void timer_phase(int hz) { int divisor = 1193180 / hz; @@ -25,6 +25,10 @@ void timer_wait(int ticks) { } } +unsigned int get_time() { + return timer_ticks; +} + // Install timer handler into IRQ0 void timer_install() { timer_phase(100); diff --git a/src/kernel/timer/timer.h b/src/kernel/timer/timer.h index 635c996..309896a 100644 --- a/src/kernel/timer/timer.h +++ b/src/kernel/timer/timer.h @@ -12,4 +12,10 @@ void timer_install(); */ void timer_wait(int ticks); +/** + * Get the current timer ticks + * @return The current timer ticks (100 ticks = 1 second) + */ +unsigned int get_time(); + #endif |