Update the timer to a more reasonable time slice of 50ms

This commit is contained in:
Drew Galbraith 2023-05-29 22:17:56 -07:00
parent 9869d1022a
commit 496dfeaef9
2 changed files with 4 additions and 3 deletions

View File

@ -118,8 +118,8 @@ uint64_t cnt = 0;
extern "C" void isr_timer(); extern "C" void isr_timer();
extern "C" void interrupt_timer(InterruptFrame*) { extern "C" void interrupt_timer(InterruptFrame*) {
cnt++; cnt++;
if (cnt % 1000 == 0) { if (cnt % 20 == 0) {
dbgln("timer: %u", cnt); dbgln("timer: %us", cnt * 50 / 1000);
} }
outb(PIC1_COMMAND, PIC_EOI); outb(PIC1_COMMAND, PIC_EOI);
} }

View File

@ -22,7 +22,8 @@ extern "C" void zion() {
InitSyscall(); InitSyscall();
SetFrequency(/* hertz= */ 2000); // Schedule every 50ms.
SetFrequency(/* hertz= */ 20);
sched::InitScheduler(); sched::InitScheduler();
sched::EnableScheduler(); sched::EnableScheduler();