Driver section separation

This commit is contained in:
xamidev
2024-08-05 19:33:16 +02:00
parent 4b6beb5ba9
commit f05347f73b
7 changed files with 10 additions and 9 deletions

21
src/drivers/timer.c Normal file
View File

@@ -0,0 +1,21 @@
#include "../kernel/system.h"
#include "../libc/stdio.h"
volatile unsigned long global_ticks = 0;
void timer_handler()
{
global_ticks++;
}
void timer_install()
{
irq_install_handler(0, timer_handler);
}
void delay(int ticks)
{
unsigned long eticks;
eticks = global_ticks + ticks;
while (global_ticks < eticks);
}