-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclock.c
More file actions
60 lines (38 loc) · 710 Bytes
/
clock.c
File metadata and controls
60 lines (38 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "clock.h"
#include "gdebug.h"
#include "idt.h"
#include "vga.h"
#include "i8259A.h"
#include "task.h"
void clock_handler(void);
void init_clock(void);
device_operator clock_operator = {
0,
"system clock",
0,
&init_clock,
NULL,
NULL,
NULL,
NULL,
NULL
};
void init_clock(void){
/*
WORD value = 11932;
cli();
_sys_set_irq_handle(0, &clock_handler);
enable_IRQ_line(0);
outb(0x43, 0x34);
outb(0x40, value & 0xff);
outb(0x40, value >> 8);
sti();
*/
}
void clock_handler(void){
//_sys_printf("clock!\n");
if(exist_task()){
/* vmが実行すべきタスクが存在する */
exec_task();
}
}