[haiku-commits] Re: r41683 - haiku/trunk/src/system/boot/platform/bios_ia32

2011/5/24 Michael Lotz <mmlr@xxxxxxxx>:

Hi Michael,

> Since the APIC timer is calibrated using the TSC which in turn is
> calibrated using the PIT it's not so surprising that both fail in this
> case.
>
> What you could try is to still use mode 0, but instead use a different
> channel, channel 2 (as channel one isn't usually implemented anymore)
> in the TSC calibration. That is the combination that Linux uses for
> their "fast TSC calibration using PIT" and I think also for the
> corresponding "slow" version. The dmesg output of Linux should tell you
> if and how it calibrated the TSC which should indicate what method is
> usable.

Bingo!
Using PIT channel 2 (in the kernel) works, and haiku boots correctly
on XenServer. Note that modifying the code in the boot loader didn't
make a difference. I had instead to change line 55 of
src/system/kernel/arch/x86/timer/x86_pit.cpp

from
out8(PIT_SELCH0 | PIT_RWBOTH | PIT_MD_INTON0, PIT_CTRL);
to
out8(PIT_SELCH2 | PIT_RWBOTH | PIT_MD_INTON0, PIT_CTRL);

If applied, would close ticket #4500. Thanks for the tip!

Note that I still have to disable the apic in the virtual machine,
otherwise I experience the symptoms described in ticket #7497.

Other related posts: