|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.
serial1=nullmodem server usedtr port:5000
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.
Next make sure you have SERIAL1 in your EMU71.INI file. I have mine as my 6th HPIL device.
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.
my $host = shift;
my $port = shift;
my $sock = IO::Socket::INET->new(
PeerAddr => $host,
PeerPort => $port,
die "could not open socket";
my $line = $_;
$line =~ s/[^[:print:]]//g;
my $revline = reverse($line);
print "recv: $line\n";
print "send: $revline\n";
print $sock "$revline\n";
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$ @ DIMB$
20 INPUT "STRING: ";A$
30 OUTPUT :6 ;A$
40 ENTER :6 ;B$
50 DISP "GNIRTS:";B$
60 GOTO 20
Windows/XP + Cygwin/X (for Perl):
$ ./echorev.pl localhost 5000
recv: FOO BLAH BLEH BAR
send: RAB HELB HALB OOF
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.