[LinuxBIOS] emulator PIT setup

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Oct 8 19:15:19 CEST 2007

On 08.10.2007 19:01, Marc Jones wrote:
> Tom Sylla wrote:
>> Many moons ago I had a problem with an XGI VGA option ROM in the emulator:
>> http://www.linuxbios.org/pipermail/linuxbios/2006-December/017568.html
>> I poked at it again this week, and found that my PIT was not set up on
>> my platform, so port 61 was not ticking, and the delay routines in the
>> option ROM were getting stuck.
>> It looks like the emulator attempts to set up something in the PIT:
>> http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/src/devices/emulator/biosemu.c#L301
>> but that is timer 0, which is for the timer tick, not the refresh
>> timer (port 61).
>> To fix my problem, I just added LX's PIT counter 1 init I/Os:
>> http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/src/cpu/amd/model_lx/syspreinit.c#L32
>> before the Counter 0 code, and the XGI ROM then loaded ok.
>> My first question is about the current PIT code in the emulator. What
>> is it trying to do? Is it supposed to be turning on counter 1, and
>> just broken? Or is it really meant to be enabling the timer tick?
>> The next question is where would be a good place for the Counter 1
>> init? It seems like it should be done generically in LB for any SB
>> with a PIT.
> I agree with Tom. The PIT should be setup by linuxbios for x86 systems. 
> I can't think of an x86 that doesn't have a PIT. I don't see a good 
> generic place to put this. PIT init should go in early init so that it 
> can be used for timing loops.

Agreed. IIRC Linux even complains about the non-initialized PIT.


More information about the coreboot mailing list