testbios and the system timer

2004-06-03 Thread Richard Smith
I've been pouring over various logs from testbios and what my M1 Vbios does in various conditions. Man what a bitch. One thing I've found testbios dosen't handle properly is the 8254 system timer. In numerious locations my Vbios is writing a 0x00 to IO 0x43 and then does 2 reads from 0x40. S

Re: testbios and the system timer

2004-06-03 Thread Li-Ta Lo
On Thu, 2004-06-03 at 02:56, Richard Smith wrote: > > What i've noticed that the emulator causes the Vbios to get stuck in > some delay loops. Eventually it probally would exit but its currently > making my logs huge and causing the knashing of much teeth. > > So I'm thinking that the emulator

Re: testbios and the system timer

2004-06-03 Thread ron minnich
On Thu, 3 Jun 2004, Li-Ta Lo wrote: > Probably we need an other way to emulate the timer. can we just read the timer? ron ___ Linuxbios mailing list [EMAIL PROTECTED] http://www.clustermatic.org/mailman/listinfo/linuxbios

Re: testbios and the system timer

2004-06-03 Thread Li-Ta Lo
On Thu, 2004-06-03 at 09:35, ron minnich wrote: > On Thu, 3 Jun 2004, Li-Ta Lo wrote: > > > Probably we need an other way to emulate the timer. > > can we just read the timer? > > ron > richard's point is that the emulator is much slower than the timer. The delay loop is facing overflow proble

Re: testbios and the system timer

2004-06-03 Thread ron minnich
On Thu, 3 Jun 2004, Li-Ta Lo wrote: > richard's point is that the emulator is much slower than the > timer. The delay loop is facing overflow problem with the > "emulated" io access to the "physical" counter. oops, sorry. Too much email this morning. I did not read his note carefully enough. Ac

Re: testbios and the system timer

2004-06-03 Thread Peter Stuge
On Thu, Jun 03, 2004 at 03:56:29AM -0500, Richard Smith wrote: > timer. In numerious locations my Vbios is writing a 0x00 to IO 0x43 and > then does 2 reads from 0x40. So its latching the value of counter 0 and > then reading it out. Right, it also sets counter mode 0, zero detection interrupt

Re: testbios and the system timer

2004-06-03 Thread ron minnich
what about this. Build a composite timer with the top X bits coming from TSC, and the bottom Y bits coming from the time-of-day counter. Would that work? ron ___ Linuxbios mailing list [EMAIL PROTECTED] http://www.clustermatic.org/mailman/listinfo/lin

Re: testbios and the system timer

2004-06-03 Thread ron minnich
OK, I finally read this in detail and I'm sorry for my noise on this subject. I think it would be useful to keep an 'emulated instruction count' in the emulator, and have a virtual timer that increments very X (pick a number) instructions. X can be constant across different architectures as we

Re: testbios and the system timer

2004-06-03 Thread Richard Smith
Peter Stuge wrote: On Thu, Jun 03, 2004 at 03:56:29AM -0500, Richard Smith wrote: timer. In numerious locations my Vbios is writing a 0x00 to IO 0x43 and then does 2 reads from 0x40. So its latching the value of counter 0 and then reading it out. Right, it also sets counter mode 0, zero detecti

Re: testbios and the system timer

2004-06-03 Thread Richard Smith
ron minnich wrote: OK, I finally read this in detail and I'm sorry for my noise on this subject. I think it would be useful to keep an 'emulated instruction count' in the emulator, and have a virtual timer that increments very X (pick a number) instructions. X can be constant across different

Re: testbios and the system timer

2004-06-03 Thread ron minnich
On Thu, 3 Jun 2004, Richard Smith wrote: > Yes. I think it would. Got any ideas on the implementation? I'm ready > to try an implement this. in the main loop for instruction decode there is a single instruction dispatch function. Create a global counter (emulate_counter?) and increment it o

Re: testbios and the system timer

2004-06-03 Thread ron minnich
On Thu, 3 Jun 2004, Richard Smith wrote: > This will only skip the jump (and do the BX decrement) if ax is zero. > For ax to be zero the result of the 2's complement subtraction must be > zero or the when the 2 reads are the same number. But I just don't see > how this would happen repeatably

Re: testbios and the system timer

2004-06-03 Thread Richard Smith
ron minnich wrote: On Thu, 3 Jun 2004, Richard Smith wrote: This will only skip the jump (and do the BX decrement) if ax is zero. For ax to be zero the result of the 2's complement subtraction must be zero or the when the 2 reads are the same number. But I just don't see how this would happen

Re: testbios and the system timer

2004-06-04 Thread Peter Stuge
On Thu, Jun 03, 2004 at 03:32:58PM -0500, Richard Smith wrote: > Peter Stuge wrote: > > >On Thu, Jun 03, 2004 at 03:56:29AM -0500, Richard Smith wrote: > > > >>timer. In numerious locations my Vbios is writing a 0x00 to IO 0x43 and > >>then does 2 reads from 0x40. So its latching the value of c

Re: testbios and the system timer

2004-06-08 Thread Eric W. Biederman
ron minnich <[EMAIL PROTECTED]> writes: > You can in the emulator redirect I/O port access to a function. Write the > code to handle read/write on those ports and use the emulate_counter to > drive the clock value. Let me ask this quick question. Does the emulator restrict port I/O to just the

Re: testbios and the system timer

2004-06-08 Thread Richard Smith
Eric W. Biederman wrote: You can in the emulator redirect I/O port access to a function. Write the code to handle read/write on those ports and use the emulate_counter to drive the clock value. Let me ask this quick question. Does the emulator restrict port I/O to just the resources on a particu

Re: testbios and the system timer

2004-06-08 Thread Eric W. Biederman
Richard Smith <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: > > >> You can in the emulator redirect I/O port access to a function. Write the > >> code to handle read/write on those ports and use the emulate_counter to drive > > >> the clock value. > > Let me ask this quick question. Do

Re: testbios and the system timer

2004-06-08 Thread Richard Smith
Eric W. Biederman wrote: No. It allows full access to all IO ports. Otherwise it would have never been able to get to the system timer. I was afraid of that. So not only will it have to emulate x86 instructions it will have to emulate some of the generic x86 hardware setup. Exactly. But in this

Re: testbios and the system timer

2004-06-09 Thread ron minnich
On 8 Jun 2004, Eric W. Biederman wrote: > ron minnich <[EMAIL PROTECTED]> writes: > > You can in the emulator redirect I/O port access to a function. Write the > > code to handle read/write on those ports and use the emulate_counter to > > drive the clock value. > > Let me ask this quick questi