cos2000v2/lib/timer.c

42 lines
684 B
C
Executable File

#include "interrupts.h"
#include "types.h"
#include "asm.h"
#include "memory.h"
#include "timer.h"
#include "vga.h"
static u8 curs[4] = { "-\\|/" };
static u8 curspos = 0;
static u32 time = 0;
/******************************************************************************/
/* Récupère la valeur du timer */
u32 gettimer()
{
return time;
}
/******************************************************************************/
/* Handler d'interruption de la souris IRQ 0 */
void timer()
{
cli();
pushf();
pushad();
showchar(0, 0, curs[curspos], 7);
curspos = (curspos + 1) & 0x3;
time++;
irqendmaster();
popad();
popf();
sti();
asm("addl $0x0C, %esp;");
iret();
}