From 496dfeaef903bbed300e478ce795207565d89090 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Mon, 29 May 2023 22:17:56 -0700 Subject: [PATCH] Update the timer to a more reasonable time slice of 50ms --- zion/interrupt/interrupt.cpp | 4 ++-- zion/zion.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zion/interrupt/interrupt.cpp b/zion/interrupt/interrupt.cpp index bc0b5f2..e5665b5 100644 --- a/zion/interrupt/interrupt.cpp +++ b/zion/interrupt/interrupt.cpp @@ -118,8 +118,8 @@ uint64_t cnt = 0; extern "C" void isr_timer(); extern "C" void interrupt_timer(InterruptFrame*) { cnt++; - if (cnt % 1000 == 0) { - dbgln("timer: %u", cnt); + if (cnt % 20 == 0) { + dbgln("timer: %us", cnt * 50 / 1000); } outb(PIC1_COMMAND, PIC_EOI); } diff --git a/zion/zion.cpp b/zion/zion.cpp index d872cc9..503bc56 100644 --- a/zion/zion.cpp +++ b/zion/zion.cpp @@ -22,7 +22,8 @@ extern "C" void zion() { InitSyscall(); - SetFrequency(/* hertz= */ 2000); + // Schedule every 50ms. + SetFrequency(/* hertz= */ 20); sched::InitScheduler(); sched::EnableScheduler();