Page 2 of 2

Re: The PIT and VirtualBox

Posted: Tue Jul 29, 2008 1:53 pm
by Korona
Try the following snippet:

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);
}
It's possible that virtualbox cannot emulate all PIT operating modes; I guess it only emulates the most common modes.