Ticket #2393 (closed defect: duplicate)
Timer stalls in mode 2
|Reported by:||ncafferkey||Owned by:|
|Version:||VirtualBox 2.0.2||Keywords:||timer PIT|
|Host type:||Mac OS X|
When the emulated timer runs in mode 2, it counts down from its initial value to 1, but does not then reload the initial value. Instead, it stays at 1.
This behaviour prevents AROS ( http://www.aros.org) from booting under VBox.
This is the code used by AROS to initialise the timer:
/* Start the timer2 */
outb((inb(0x61) & 0xfd) | 1, 0x61); /* Enable the timer (set GATE on) */
outb(0xb4, 0x43); /* Binary mode on Timer2, count mode 2 */
outb(0x00, 0x42); /* We're counting whole range */
And this is the code used to read the timer's value:
/* Latch the current time value */
/* Read out current 16-bit time */
time = inb(0x42);
time += inb(0x42) << 8;
This works on real machines and on several other emulators. I don't know if it's much different from what other OSs do.