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/de...
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/cp...
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.
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/de...
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/cp...
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.
Thoughts? Marc
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/de...
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/cp...
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.
Carl-Daniel
Carl-Daniel Hailfinger wrote:
On 08.10.2007 19:01, Marc Jones wrote:
Tom Sylla wrote:
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.
Carl-Daniel
Carl-Daniel,
Do you have an opinion where this should go in the code?
Marc
Just make PIT a device or, if it is simple enough, create a library routine and have either hardwaremain or mainboard
call that function.
ron
* ron minnich rminnich@gmail.com [071009 18:55]:
Just make PIT a device or, if it is simple enough, create a library routine and have either
where is the PIT located? Southbridge?
Stefan Reinauer wrote:
- ron minnich rminnich@gmail.com [071009 18:55]:
Just make PIT a device or, if it is simple enough, create a library routine and have either
where is the PIT located? Southbridge?
Some southbridges have incorporated the PIT but it can be a separate part - 8253/8254.
Interestingly, I found hardwaremain() contains a call to timer_init(). timer_init() doesn't really init the timer completely. I will look at this more closely.
Marc