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-27 17:47:27 +02:00
|
|
|
u32 gettimer()
|
|
|
|
{
|
|
|
|
return time;
|
2018-08-22 17:36:30 +02:00
|
|
|
}
|
|
|
|
|
2018-08-17 16:46:56 +02:00
|
|
|
/******************************************************************************/
|
2007-04-02 15:41:56 +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
|
|
|
|
|
|
|
void timer()
|
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-08-17 16:46:56 +02:00
|
|
|
asm("addl $0x0C, %esp;");
|
|
|
|
iret();
|
|
|
|
}
|