Re: The PIT and VirtualBox
Posted: Tue Jul 29, 2008 1:53 pm
Try the following snippet:
It's possible that virtualbox cannot emulate all PIT operating modes; I guess it only emulates the most common modes.
Code: Select all
void timer_set_freq(uint16 freq) {
uint32 divisor = 1193180 / freq;
outb(0x43, 0x34); // according to the wiki this byte should be 34 and not 36
outb(0x40, divisor & 0xFF);
outb(0x40, (divisor >> 8) & 0xFF);
}