Originally, I had a few oversights that prevented the PIT from functioning at all.
Now, when I try to implement the wait function, it's... horrible. The QEMU instance hangs and shits itself.
I assume this is some inefficiency that loads the virtual CPU too much for the instance to properly function, but that's just a hypothesis.
Code: Select all
// glass/src/dev/timer/pit/pit.c
void pit_deadline_wait(uint64_t delay_ticks) {
ticks = 0;
watching = true;
while (ticks < delay_ticks)
asm ("hlt");
watching = false;
return;
}