mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-05-02 14:40:21 +08:00
计量时间
This commit is contained in:
@@ -5,16 +5,20 @@
|
||||
#define PIT_CTRL 0x0043
|
||||
#define PIT_CNT0 0x0040
|
||||
|
||||
struct TIMERCTL timerctl;
|
||||
|
||||
void init_pit(void)
|
||||
{
|
||||
io_out8(PIT_CTRL, 0x43);
|
||||
io_out8(PIT_CNT0, 0x9c);
|
||||
io_out8(PIT_CNT0, 0x2e);
|
||||
timerctl.count = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
void inthandler20(int *esp)
|
||||
{
|
||||
io_out8(PIC0_OCW2, 0x60); /* 把IRQ-00信号接收完了的信息通知给PIC */
|
||||
/* 暂时什么也不做 */
|
||||
timerctl.count++;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user