完成第一次实验

This commit is contained in:
2024-03-24 16:38:45 +08:00
parent 8b4ccf9bd1
commit cd4dff43d2
3 changed files with 101 additions and 7 deletions

View File

@@ -33,8 +33,8 @@ void
clock_init(void) {
// set 8253 timer-chip
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
outb(IO_TIMER1, TIMER_DIV(100) % 256);
outb(IO_TIMER1, TIMER_DIV(100) / 256);
outb(IO_TIMER1, TIMER_DIV(1000) % 256);
outb(IO_TIMER1, TIMER_DIV(1000) / 256);
// initialize time counter 'ticks' to zero
ticks = 0;