[Simh] Flushing Printer

Timothe Litt litt at ieee.org
Sun Sep 10 09:40:06 EDT 2017


On 10-Sep-17 08:14, David or Jan Takle wrote:
> Using the NOVA simulator, after every use of the printer it seems
> necessary to escape to the simH console and DETACH LPT in order to
> flush the rest of the simH buffer to the Windows file. Otherwise, the
> file may be incomplete.
> Is there another way to flush the buffer? By sending a particular
> control character to LPT? Or raising a control line? (NIOP LPT for
> example).
> I would really like to accomplish this under program control rather
> than having to interrupt the simulator manually.
> Thanks,
> ~David

This is a software issue in SimH, not something that code running under
simulation can (or should) fix.

Depending on the simulator, there can be two levels of buffering (plus
whatever the simulated OS does).  One is internal to the emulator -
typically buffering up to a line waiting for paper motion or hardware
buffer full.  The other is the usual C RTL buffering. (You'd expect
_IOLBF, which will flush when the simulator outputs a newline, but since
it's a disk file, it's _IOFBF - fully buffered.  How big that is is
unpredictable.  Plus WIN32 ignores _IOLBF...)  It's not uncommon for the
hardware buffer to be full, as paper motion is (somewhat
counter-intuitively) often determined at the START of a line.  (E.g. the
sequence seen by hardware is <LF>text<CR> or <FF>text, or...) I don't
recall what NOVA does. 

When I rewrote the LPT support for SimH to support PDF a several years
ago, I included code to flush output to the printers when they go idle
(for all output types).  This was done for all the then-existent simulators.

The code was not accepted (there was an infinite stream of 1+ requests &
I ran out of patience), but exists in my SimH fork.  However, I have not
kept it up with SimH evolution; the effort to merge it into current
sources is unknown; it's 4 years old & a quick look shows that fork is
1500 commits behind master...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20170910/b3180816/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4577 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20170910/b3180816/attachment-0001.bin>


More information about the Simh mailing list