2018-09-28 20:35:51 +02:00
|
|
|
/*******************************************************************************/
|
|
|
|
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
|
|
|
/* */
|
2018-08-17 16:46:56 +02:00
|
|
|
#include "interrupts.h"
|
2007-04-02 15:41:56 +02:00
|
|
|
#include "types.h"
|
|
|
|
#include "asm.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "timer.h"
|
|
|
|
#include "vga.h"
|
|
|
|
|
2018-08-17 16:46:56 +02:00
|
|
|
static u8 curs[4] = { "-\\|/" };
|
2007-04-02 15:41:56 +02:00
|
|
|
|
2018-08-17 16:46:56 +02:00
|
|
|
static u8 curspos = 0;
|
2007-04-02 15:41:56 +02:00
|
|
|
|
2018-08-22 17:36:30 +02:00
|
|
|
static u32 time = 0;
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Récupère la valeur du timer */
|
|
|
|
|
2018-09-28 20:35:51 +02:00
|
|
|
u32 gettimer(void)
|
2018-09-27 17:47:27 +02:00
|
|
|
{
|
|
|
|
return time;
|
2018-08-22 17:36:30 +02:00
|
|
|
}
|
|
|
|
|
2018-08-17 16:46:56 +02:00
|
|
|
/******************************************************************************/
|
|
|
|
/* Handler d'interruption de la souris IRQ 0 */
|
2007-04-02 15:41:56 +02:00
|
|
|
|
2018-09-28 20:35:51 +02:00
|
|
|
void timer(void)
|
2018-08-17 16:46:56 +02:00
|
|
|
{
|
|
|
|
cli();
|
|
|
|
pushf();
|
|
|
|
pushad();
|
|
|
|
showchar(0, 0, curs[curspos], 7);
|
|
|
|
curspos = (curspos + 1) & 0x3;
|
2018-09-27 17:47:27 +02:00
|
|
|
time++;
|
2018-08-17 16:46:56 +02:00
|
|
|
irqendmaster();
|
|
|
|
popad();
|
|
|
|
popf();
|
2007-04-02 15:41:56 +02:00
|
|
|
sti();
|
2018-12-05 14:00:43 +01:00
|
|
|
leave();
|
2018-08-17 16:46:56 +02:00
|
|
|
iret();
|
|
|
|
}
|
2018-09-28 20:35:51 +02:00
|
|
|
|
|
|
|
/*******************************************************************************/
|