]> git.dujemihanovic.xyz Git - nameless-os.git/blobdiff - kernel/arch/x86/irq/sample_handler.c
Add Intel 8254 driver and print elapsed seconds
[nameless-os.git] / kernel / arch / x86 / irq / sample_handler.c
index f4f4a4bfefad5aacf742f3c6ce2046c86eb1b85e..be6829871d68c1b0845f2832962302c4f637f259 100644 (file)
@@ -2,6 +2,9 @@
 #include <irq/i8259a.h>
 #include <io.h>
 #include <stdint.h>
+#include <time/i8254.h>
+
+unsigned int ticks = 0;
 
 typedef uint32_t uword_t;
 
@@ -31,3 +34,10 @@ halt:
        goto halt;
 }
 
+
+__attribute__((interrupt))
+void timer_tick(struct interrupt_frame *frame)
+{
+       pic_send_eoi(0);
+       ticks++;
+}