summaryrefslogtreecommitdiff
path: root/kern/timer.c
diff options
context:
space:
mode:
authorHanjie Wu <hanjiew@andrew.cmu.edu>2023-04-28 21:14:37 -0400
committerHanjie Wu <hanjiew@andrew.cmu.edu>2023-04-28 21:14:37 -0400
commit119b5e6fde37c53a5037a6ba959ba60c882bd6d0 (patch)
treea41be842bfc966befb80324cc405414b35cf91d2 /kern/timer.c
parentff90341c64565ac7d8034d2f8cf460532a5b51fd (diff)
commentHEADmaster
Diffstat (limited to 'kern/timer.c')
-rw-r--r--kern/timer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kern/timer.c b/kern/timer.c
index 0d623ae..387c5f9 100644
--- a/kern/timer.c
+++ b/kern/timer.c
@@ -40,9 +40,6 @@ void timer_test_handler();
void timer_init() {
/* use 10x slower frequency for APIC timer testing */
int counter = TIMER_RATE / (TIMER_FREQ / 10);
- outb(TIMER_MODE_IO_PORT, TIMER_ONE_SHOT);
- outb(TIMER_PERIOD_IO_PORT, counter & 0xFF);
- outb(TIMER_PERIOD_IO_PORT, (counter >> 8) & 0xFF);
if (heap_init(&timers) != 0) {
panic("no space to initialize timer heap");
}
@@ -70,6 +67,7 @@ void timer_init() {
}
}
+ /* 10 10x slow tests to calculate LAPIC frequency */
lapic_dt = (0xffffffff - lapic_read(LAPIC_TIMER_CUR)) / 100;
lapic_write(LAPIC_TIMER_INIT, 0);
idt[TIMER_IDT_ENTRY] = old_idt;