The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

EMU71 and TCP/IP
Message #1 Posted by Egan Ford on 26 Mar 2007, 2:07 p.m.

While getting DOSBox setup on my Linux machines so that I could run EMU71 I noticed that DOSBox supports serial port virtualization using TCP/IP. (DOSBox is an x86/DOS emulator, a bit like Bochs, but DOS emulation is part of it and it is much easier to use. It runs on top of Linux, OS/X, Windows, and many other platforms.)

The setup is pretty straightforward (I tested this with DOSBox on Windows/XP).

Put the following in your configuration file.

[serial]
serial1=nullmodem server usedtr port:5000
serial2=dummy
serial3=disabled
serial4=disabled

DOSBox uses your existing filesystem--no need to create an image. Create a dosbox directory with EMU71 (http://membres.lycos.fr/jeffcalc/emu71.html) and BNU (http://www.pcmicro.com/bnu/) installed, then mount as drive C, e.g. my dosbox directory on Linux is /home/egan/dosbox, for Windows/XP c:\home\egan\dosbox. The command for any OS to mount within dosbox is:

mount c /home/egan/dosbox
First run bnu.com. BNU provides INT 14 needed by EMU71 serial port emulation.
c:
cd bnu
bnu.com
Next make sure you have SERIAL1 in your EMU71.INI file. I have mine as my 6th HPIL device.

Thatís it.

To test it I created a small reverse echo service using Perl. It will run on any computer with Perl. I tested it with Windows/XP.

#!/usr/bin/perl

use strict; use IO::Socket; use IO::File;

my $host = shift; my $port = shift;

my $sock = IO::Socket::INET->new( PeerAddr => $host, PeerPort => $port, );

if(!defined($sock)) { die "could not open socket"; }

while(<$sock>) { chomp(); my $line = $_; $line =~ s/[^[:print:]]//g; my $revline = reverse($line); print "recv: $line\n"; print "send: $revline\n"; print $sock "$revline\n"; }

exit(0);

All this service does is connect to the host and port passed on the command line and waits for a message and then returns the reverse string of the message.

To test start up the service:

echorev.pl localhost 5000
From EMU71 type:
10 DIMA$[64] @ DIMB$[64]
20 INPUT "STRING: ";A$
30 OUTPUT :6 ;A$
40 ENTER :6 ;B$
50 DISP "GNIRTS:";B$
60 GOTO 20

RUN

Example session:

Windows/XP + Cygwin/X (for Perl):

$ ./echorev.pl localhost 5000
recv: FOO BLAH BLEH BAR
send: RAB HELB HALB OOF
recv: aaaabbbbCCCCddddEEEE
send: EEEEddddCCCCbbbbaaaa

Windows/XP + Dosbox + EMU71:

I am sure that there are other serial port virtualization solutions that may run natively on Windows so that EMU71 would not need to run in DOSBox.

      
Re: EMU71 and TCP/IP
Message #2 Posted by Howard Owen on 28 Mar 2007, 8:53 p.m.,
in response to message #1 by Egan Ford

Oh, man!

What a neat shortcut to the 71B enthusiast's dream: an HP-IL<->TCP/IP gateway!

OK, so this won't let us work on HP-IL/IP, which is what I'd really like to do. But it's very, very cool nonetheless.

You've got mail. 8)

Regards,
Howard

            
Re: EMU71 and TCP/IP
Message #3 Posted by GE on 29 Mar 2007, 6:40 a.m.,
in response to message #2 by Howard Owen

This deserves an entry in the Articles Section.

                  
Re: EMU71 and TCP/IP
Message #4 Posted by Howard Owen on 29 Mar 2007, 3:57 p.m.,
in response to message #3 by GE

I absolutely agree.

Egan, if you have time, could you consider transferring what you've written to the articles forum? I think it would do fine just like it is, but you'd be free to bend, fold and/or mutilate as you saw fit. 8)

Regards,
Howard

                        
Re: EMU71 and TCP/IP
Message #5 Posted by Egan Ford on 29 Mar 2007, 4:30 p.m.,
in response to message #4 by Howard Owen

I have a few more things to test first then I will post a more complete article.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall