Initial checkin of toy OS project.
[os.git] / kernel / hal / timer.c
1 //+----------------------------------------------------------------------------
2 //
3 // File:     timer.c
4 //
5 // Module:   
6 //
7 // Synopsis: 
8 //
9 // Created:  sgasch  21 Oct 2003
10 //
11 //+----------------------------------------------------------------------------
12
13 #include "kernel.h"
14 #include "hal.h"
15 #include "rtl.h"
16 #include "interrupts.h"
17
18 void
19 HalTimerInt(INTERRUPT_STATE *is)
20 {
21     static CHAR whee[] = "|/-\\\0";
22     static ULONG u = 0;
23     static BYTE b = 0;
24     static unsigned int foo;
25     BYTE *p = (BYTE *)0x000B8000;
26
27     out(0x61, 0x80);
28     u++;
29
30     CURRENT_STAMP(&foo);
31
32     if ((u % 500) == 0)
33     {
34         b++;
35         if (whee[b] == '\0')
36         {
37             b = 0;
38         }
39         *(p + 158) = whee[b];
40         *(p + 159) = ' ';
41     }
42 }
43