[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedos-user
Subject:    Re: [Freedos-user] Long-term survival of FreeDOS
From:       john s wolter <johnswolter () wolterworks ! com>
Date:       2013-01-03 23:27:04
Message-ID: CANwh-fpT67SvtUE4W0Zsj7DmEkE-qqVvumWD_xbx_KiY0iuiGA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


It's the clock, just the clock.  It's a square wave usually, the old up and
down.  Pin 19, CLK, on the Intel 8086 DIP

When emulating the speed of a 8088, 8086, 80286,... CPUs you need to
emulate the Clock cycles

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_...etc...

So sticking in NOPs may not work.

 -_nopnopnop-_nopnopnop-_nopnopnop-_...etc

...the Clock cycles are still too short.  You want...
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_...of the correct cycle length,
..the infamous buss instruction T-state lengths are what this is about.

You need to emulate at the CPU buss T-state level.

I have a DOS simulator package of that 80286.  It lets you step through an
instruction's execution T-state by T-state.  It's very instructional.  I
did not find a 80386 version or 80486.  I did find and purchase 18 years
ago a book "80x86 Architecture &
Programming<http://www.amazon.com/80X86-Architecture-Programming-Reference-Implementations/dp/0132454327>"
 that had the T-state information for a 80486.

References:
http://www.cpu-world.com/info/Pinouts/8086.html
http://matthieu.benoit.free.fr/cross/data_sheets/Intel_8086_users_manual.htm
http://www.ece.msstate.edu/~reese/EE3724/lectures/bustran/bustran.pdf
http://en.wikipedia.org/wiki/Intel_8086
http://en.wikipedia.org/wiki/X86_architecture
https://docs.google.com/viewer?url=http%3A%2F%2Fdatasheets.chipdb.org%2FIntel%2Fx86%2F808x%2Fdatashts%2F8088%2F231456-006.pdf


Now you can program your own emulator.

Cheers
John S Wolter
------------------------
LinkedIn: johnswolter <http://www.linkedin.com/in/johnswolter>

- Mailto:johnswolter@wolterworks.com
- Desk: 734-408-1263
- USA, Eastern Standard Time, -5 GMT, -4 GMT DST



On Thu, Jan 3, 2013 at 5:52 PM, Mark Littlejohn <elab@zip.com.au> wrote:

> There should also be made a distinction between real time input and real
> time output and servo loop. If you are capturing timing events you really
> only need to respond to an event and store a time for later processing. I
> usually use a microcontroller and write a routine around its interrupts so
> that it can respond easily down to microseconds and give good resolution
> (this has been mainly for medical projects that are not particularly high
> frequency). So you have the interrupts running code real time, and the
> normal loop crunching the numbers and providing output.
> Real time output can be set up very much like above, where the internal
> counter triggers the interrupt which outputs a value. Say you want to
> output a particular current at a particular time.
> Servo is much harder because it must respond to an input, and process it
> to give an output, at a defined frequency response. This is usually
> demonstrated with the "balancing hammer" where the servo balances a hammer
> on its end. There are systems that achieve this even if the hammer has a
> jointed hinge in the middle. I have even heard of it being done where there
> are two joints. This is a bit like trying to reverse a 3 bogey semi-trailer
> up a country lane at freeway speed.
> When you see Windows attempt the hammer demo you can see that every
> keyboard press or mouse movement causes instability, and opening a browser
> can make the hammer fall over. Often a simple microcontroller can beat even
> a really fast powerful computer, mainly because you can use the interrupts
> which I have found are almost impossible to "get at" in computers.
> 
> 
> 
> > "Real time" simply means "guaranteed to respond to an external event
> > within a specified period".  What time period is required?
> > 
> > > > But on modern hardware, "other time-critical programs that will carve
> > > > out slices of CPU time" are likely a "Who cares?" issue.  Commonly
> > > > used hardware is orders of magnitude faster than the machines DOS was
> > > > made to run on, and there are cases like games where you might
> > > > specifically *want* to steal CPU slices, because otherwise your game
> > > > runs *too* fast and is unplayable. .
> > > > 
> > > I have had to do this once, when writing an assembly code driver for a
> > > digital rotation encoder. The read cycle had to be slowed down by a
> > > specified number of NOPs to allow the register to load. The problem is
> > > that when a program is monitoring response devices such as the mouse and
> > > keyboard and presenting an animated display to the user, even a
> > > millisecond lost to some other program is a disaster. As I can often see
> > > the system "blink" on modern PCs running Windows and even Linux, I'm
> > > reasonably certain that I can't trust them to be accurately recording
> > > reaction times. One of my colleagues thought that she had solved the
> > > problem by buying an expensive test battery until I showed her the
> > > "uncertainty" factor that came with every response recorded.
> > 
> > How accurately do you *need* to be recording reaction times?
> > 
> > For that use case, I'm not sure I'd try to run DOS on top of Linux,
> > even with a Linux version modified for RTOS usage.
> > 
> > The best option might be custom monitoring software running directory
> > on the RTOS, without DOS in the loop.
> > 
> > 
> 
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> Freedos-user mailing list
> Freedos-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-user
> 
> 


[Attachment #5 (text/html)]

<font color="#000000"><font><font face="arial,helvetica,sans-serif">It&#39;s the \
clock, just the clock.   It&#39;s a square wave usually, the old up and down.   Pin \
19, CLK, on the Intel 8086 DIP</font></font></font><div><font face="arial, helvetica, \
sans-serif"><br>

</font></div><div><font face="arial, helvetica, sans-serif">When emulating the speed \
of a 8088, 8086, 80286,... CPUs you need to emulate the Clock cycles   \
</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div>

<div><font face="arial, helvetica, sans-serif">-_-_-_-_</font><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_</span><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_</span><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_</span><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_...etc...</span></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font \
face="arial, helvetica, sans-serif">So sticking in NOPs may not \
work.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div>

<div><span style="font-family:arial,helvetica,sans-serif">  -_nopnopnop-_</span><span \
style="font-family:arial,helvetica,sans-serif">nopnopnop</span><span \
style="font-family:arial,helvetica,sans-serif">-_</span><span \
style="font-family:arial,helvetica,sans-serif">nopnopnop</span><span \
style="font-family:arial,helvetica,sans-serif">-_...etc</span></div>

<div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span \
style="font-family:arial,helvetica,sans-serif">...the Clock cycles are still too \
short.   You want...</span></div><div><div><font face="arial, helvetica, \
sans-serif">-_-_-_-_</font><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_</span><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_</span><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_</span><span \
style="font-family:arial,helvetica,sans-serif">-_-_-_-_...of the correct cycle \
length,</span></div>

<div><span style="font-family:arial,helvetica,sans-serif">..the infamous buss \
instruction T-state lengths are what this is about.</span></div></div><div><span \
style="font-family:arial,helvetica,sans-serif"><br></span></div>

<div><div><font face="arial, helvetica, sans-serif">You need to emulate at the CPU \
buss T-state level.</font></div><div><font face="arial, helvetica, \
sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I have a \
DOS simulator package of that 80286.   It lets you step through an instruction&#39;s \
execution T-state by T-state.   It&#39;s very instructional.   I did not find a 80386 \
version or 80486.   I did find and purchase 18 years ago a book &quot;<a \
href="http://www.amazon.com/80X86-Architecture-Programming-Reference-Implementations/dp/0132454327">80x86 \
Architecture &amp; Programming</a>&quot; that had the T-state information for a \
80486.</font></div>

<div><font color="#000000"><font><font \
face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font \
color="#000000"><font><font \
face="arial,helvetica,sans-serif">References:</font></font></font></div><div> <font \
color="#000000"><font><font face="arial,helvetica,sans-serif"><a \
href="http://www.cpu-world.com/info/Pinouts/8086.html">http://www.cpu-world.com/info/Pinouts/8086.html</a></font></font></font></div>
 <div><font color="#000000"><font><font face="arial,helvetica,sans-serif"><a \
href="http://matthieu.benoit.free.fr/cross/data_sheets/Intel_8086_users_manual.htm">ht \
tp://matthieu.benoit.free.fr/cross/data_sheets/Intel_8086_users_manual.htm</a></font></font></font></div>


<div><font color="#000000"><font><font face="arial,helvetica,sans-serif"><a \
href="http://www.ece.msstate.edu/~reese/EE3724/lectures/bustran/bustran.pdf">http://ww \
w.ece.msstate.edu/~reese/EE3724/lectures/bustran/bustran.pdf</a></font></font></font></div>


<div><font color="#000000"><font><font face="arial,helvetica,sans-serif"><a \
href="http://en.wikipedia.org/wiki/Intel_8086">http://en.wikipedia.org/wiki/Intel_8086</a></font></font></font></div><div><font \
color="#000000"><font><font face="arial,helvetica,sans-serif"><a \
href="http://en.wikipedia.org/wiki/X86_architecture">http://en.wikipedia.org/wiki/X86_architecture</a></font></font></font></div>


<div><font color="#000000"><font><font face="arial,helvetica,sans-serif"><a \
href="https://docs.google.com/viewer?url=http%3A%2F%2Fdatasheets.chipdb.org%2FIntel%2F \
x86%2F808x%2Fdatashts%2F8088%2F231456-006.pdf">https://docs.google.com/viewer?url=http \
%3A%2F%2Fdatasheets.chipdb.org%2FIntel%2Fx86%2F808x%2Fdatashts%2F8088%2F231456-006.pdf</a></font></font></font></div>


<div><font color="#000000"><font><font \
face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font \
color="#000000"><font><font face="arial,helvetica,sans-serif">Now you can program \
your own emulator.</font></font></font></div>

<div><font color="#000000"><font><font face="arial,helvetica,sans-serif"><br \
clear="all"></font></font></font><div>Cheers<br>John S \
Wolter<br>------------------------<div>LinkedIn: <a \
href="http://www.linkedin.com/in/johnswolter" target="_blank">johnswolter</a></div>

<div><br></div><div><div><div>- Mailto:<a href="mailto:johnswolter@wolterworks.com" \
target="_blank">johnswolter@wolterworks.com</a></div><div>- Desk: \
734-408-1263</div><div>- USA, Eastern Standard Time, -5 GMT, -4 GMT DST</div>

</div></div><div><br></div></div>
<br><br><div class="gmail_quote">On Thu, Jan 3, 2013 at 5:52 PM, Mark Littlejohn \
<span dir="ltr">&lt;<a href="mailto:elab@zip.com.au" \
target="_blank">elab@zip.com.au</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">

There should also be made a distinction between real time input and real time output \
and servo loop. If you are capturing timing events you really only need to respond to \
an event and store a time for later processing. I usually use a microcontroller and \
write a routine around its interrupts so that it can respond easily down to \
microseconds and give good resolution (this has been mainly for medical projects that \
are not particularly high frequency). So you have the interrupts running code real \
time, and the normal loop crunching the numbers and providing output.<div>


Real time output can be set up very much like above, where the internal counter \
triggers the interrupt which outputs a value. Say you want to output a particular \
current at a particular time.<br><div>Servo is much harder because it must respond to \
an input, and process it to give an output, at a defined frequency response. This is \
usually demonstrated with the &quot;balancing hammer&quot; where the servo balances a \
hammer on its end. There are systems that achieve this even if the hammer has a \
jointed hinge in the middle. I have even heard of it being done where there are two \
joints. This is a bit like trying to reverse a 3 bogey semi-trailer up a country lane \
at freeway speed.</div>


<div>When you see Windows attempt the hammer demo you can see that every keyboard \
press or mouse movement causes instability, and opening a browser can make the hammer \
fall over. Often a simple microcontroller can beat even a really fast powerful \
computer, mainly because you can use the interrupts which I have found are almost \
impossible to &quot;get at&quot; in computers.<div class="im">

<br>
<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br> </div>&quot;Real \
time&quot; simply means &quot;guaranteed to respond to an external event<br> within a \
specified period&quot;.   What time period is required?<br> <div><br>
&gt;&gt; But on modern hardware, &quot;other time-critical programs that will \
carve<br> &gt;&gt; out slices of CPU time&quot; are likely a &quot;Who cares?&quot; \
issue.   Commonly<br> &gt;&gt; used hardware is orders of magnitude faster than the \
machines DOS was<br> &gt;&gt; made to run on, and there are cases like games where \
you might<br> &gt;&gt; specifically *want* to steal CPU slices, because otherwise \
your game<br> &gt;&gt; runs *too* fast and is unplayable. .<br>
&gt;&gt;<br>
&gt; I have had to do this once, when writing an assembly code driver for a<br>
&gt; digital rotation encoder. The read cycle had to be slowed down by a<br>
&gt; specified number of NOPs to allow the register to load. The problem is<br>
&gt; that when a program is monitoring response devices such as the mouse and<br>
&gt; keyboard and presenting an animated display to the user, even a<br>
&gt; millisecond lost to some other program is a disaster. As I can often see<br>
&gt; the system &quot;blink&quot; on modern PCs running Windows and even Linux, \
I&#39;m<br> &gt; reasonably certain that I can&#39;t trust them to be accurately \
recording<br> &gt; reaction times. One of my colleagues thought that she had solved \
the<br> &gt; problem by buying an expensive test battery until I showed her the<br>
&gt; &quot;uncertainty&quot; factor that came with every response recorded.<br>
<br>
</div>How accurately do you *need* to be recording reaction times?<br>
<br>
For that use case, I&#39;m not sure I&#39;d try to run DOS on top of Linux,<br>
even with a Linux version modified for RTOS usage.<br>
<br>
The best option might be custom monitoring software running directory<br>
on the RTOS, without DOS in the loop.<br>
<br></blockquote></div><div style="display:inline"></div>
</div></div></div>
<br>------------------------------------------------------------------------------<br>
 Master Visual Studio, SharePoint, SQL, <a href="http://ASP.NET" \
target="_blank">ASP.NET</a>, C# 2012, HTML5, CSS,<br> MVC, Windows 8 Apps, JavaScript \
and much more. Keep your skills current<br> with LearnDevNow - 3,200 step-by-step \
video tutorials by Microsoft<br> MVPs and experts. ON SALE this month only -- learn \
more at:<br> <a href="http://p.sf.net/sfu/learnmore_122712" \
target="_blank">http://p.sf.net/sfu/learnmore_122712</a><br>_______________________________________________<br>
 Freedos-user mailing list<br>
<a href="mailto:Freedos-user@lists.sourceforge.net">Freedos-user@lists.sourceforge.net</a><br>
 <a href="https://lists.sourceforge.net/lists/listinfo/freedos-user" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/freedos-user</a><br> \
<br></blockquote></div><br></div></div>



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712

_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic