• Please review our updated Terms and Rules here

Running SerialDisk (os8diskserver) in virtual mode

jackrubin

Veteran Member
Joined
Mar 12, 2004
Messages
879
Location
Chicago, IL and Buchanan, MI
Kyle Owen's SerialDisk RK05 'emulator' can be run in stand-alone "virtual" mode, allowing you to load handlers, BUILD system disks, test server code, etc. without the need for any DEC hardware. This has been an on-again/off-again proposition because of a couple of bugs in SIMH that were exposed by Kyle's script but all issues have been resolved with the current (4a47113f) commit and this valuable tool now runs reliably in stand-alone mode. Prepare your disk image on your desk/laptop, transfer it to your server, then load and go on real hardware.

The requisite setup is already in the os8diskserver/SerialDisk/simh directory of Kyle's distribution. You will need to make sure that socat is loaded on your host system and that you have an Xclient on your remote system; for my Windows7 system, I use Xming. 'Make' a fresh instance of the current pdp8 sim, copy it into Kyle's simh directory, load your Xclient, and start the pdp8 program. Kyle's directory already has the appropriate disk.cfg and pdp8.ini files in place.

I've run SerialDisk in this mode using AbsoluteTelnet and PuTTY from my Windows system and from a Ubuntu terminal window in a VirtualBox session.

If SerialDisk seems to hang at "Booting...", you might need to give Xterm a little more time to get ready before sending the boot message to the server. I experienced this with PuTTY and got things to work by increasing the "sleep" interval before booting (line 18 in the pdp8.ini script) from 1 to 5. If you get funny socat errors (socket error 97) or the system hangs while executing the script, be sure you have the latest pdp8 build. If you get an xterm error about loading fonts (e.g. xterm: cannot load font '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1'), make sure you have a .Xdefault file in your SerialDisk server home directory.

Thanks to Kyle for this great utility, Crawford Griffith for his help with the .ini script and Mark Pizzalto for super quick turnaround squashing SIMH bugs.

Jack
 
Last edited:
So why do I need 'socat' (whatever that is) and X11 to just interface a serial port to a program? Shouldn't I just be able to 'wire' the (virtual) serial port that SerialDisk uses in SIMH to the serial port that the SerialDisk program talks to? I do all my SIMH on CYGWIN on Windows7 so trying to throw a VirtualBox Ubuntu machine into the mix seems like overkill. I have used com0com (https://sourceforge.net/projects/com0com/) to create cross-connected virtual serial ports for other applications, any reason to believe why it would not work here? Maybe I'll give it a go.

Don
 
Socat will take care of converting the telnet-able port that SimH uses to a "real" pseudo-TTY that I can connect to a terminal emulator or SerialDisk. If SimH could create its own pTTY, there'd be no need for socat.

You certainly don't need X11. For convenience, the script opens SerialDisk in xterm, but you can just as easily use any other terminal emulator to run it in, including Cygwin. You'll have to modify the pdp8.ini accordingly, or just do it manually.
 
Socat is a linux utility that pretty much does the same thing that com0com does - it this instance, it acts as a communication conduit between the SerialDisk server and an Xterm session. I'm certainly not advocating adding a VB Ubuntu machine into the mix just for comms - I only used it for testing because I don't have a dedicated linux box available. In real life (??), I'm using AbsoluteTelnet to access my RPi SerialDisk server. Being able to configure, load and test my disk images without having to run my PDP/8 makes development much quicker and easier (and more pleasant - the hardware is in the basement, not quite as comfy as my upstairs office).

I probably don't use CYGWIN as much as I should. I'll have to give it a go with SIMH.

Jack
 
Ok, got it to work on Win7 64b using com0com to create two virtual serial ports that are connected back to back. Here is my simh .ini:

Code:
show serial
at ttix line=0,connect=/dev/ttyS10,speed=19200-8N1
set ttox0 8b
load ../bootloader/bootloader.bin
go

I manually run serialdisk in another CYGWIN bash window and connect it to /dev/ttyS9.

SIMH connects the serial device to ttyS10 (COM11) and serialdisk is attached to ttyS9 (COM10). com0com connects COM10 to COM11 in the windows serial subsystem. Running SIMH and serialdisk both under CYGWIN on a Win7 64b box. Here is the successful boot:

Capture.jpg

Also, it runs a lot faster if you set the baud rate for serialdisk to 230400 (fastest it will go) in disk.cfg, and set the baud rate to 0 (meaning go as fast as possible) in the SIMH .ini file. Runs quite spiffy in this mode.

According to some googling more or less the same function should be available in Linux using socat:

Code:
socat PTY,link=/dev/ttyS98 PTY,link=/dev/ttyS99

This is a bit different than the distributed socat setup using telnet ports, but probably works, altho I have no way to test it. So YMMV.

SIMH .ini:
Code:
show serial
at ttix line=0,connect=/dev/ttyS10,speed=0-8N1
set ttox0 8b
load ../bootloader/bootloader.bin
go
os8disk disk.cfg:
Code:
230400
1
/dev/ttyS9

Here is my original .png capture since all the images I post here come out minimized: https://drive.google.com/open?id=0B7Csc-dWWfTYcmpwN0FjckNyZjQ

Or for the truly lazy ... launches and kills serialdisk from within SIMH running under CYGWIN (or probably linux as well). Assuming at least on Windows that com0com is already setup for COM10/COM11 linking.

SIMH .ini:
Code:
! ../server/os8disk -1 ../disks/diagpack2_new2.rk05 >/dev/null &
at ttix line=0,connect=/dev/ttyS10,speed=0-8N1
set ttox0 8b
load ../bootloader/bootloader.bin
go
! kill -1 $(ps -s | grep os8disk | perl -ne '{print $1 if m/^\s*(\d+)/;}')
exit

BTW a long time ago this is the way I wired TU58EM into SIMH before SIMH added the TU58 as a (mostly) fully functional simulated device within the last year or so. I say mostly because SIMH TU58 does not support 128B blocks or MRSP mode, and limits the device image size to 512 512B blocks.

-----

PS: I made the following minor update to the main os8disk server.c file to do a clean exit on receiving a SIGHUP (kill -1) without any dialog as happens when you type a ^C (SIGINT) and the program asks a Y/N question to quit or not.

Code:
server[573] diff server.c.asd server.c
78a79
> void hup_handler(int);
140a142
>       signal(SIGHUP, hup_handler);
407a410,417
> }
>
> void hup_handler(int sig)
> {
>       signal(sig, SIG_IGN);
>       printf("Exiting on HUP\n");
>       fclose(disk);
>       exit(0);
 
Last edited:
I made the following update to the main os8disk server.c file to do a clean exit on receiving a SIGHUP (kill -1) without any dialog as happens when you type a ^C (SIGINT) and the program asks a Y/N question to quit or not.

Note this change is a little bit different from that in the previous post; it checks for both of disk1 and disk2 being open, and closes each before calling exit(0) to quit the program. I think this is a minor bug in the server code, it currently only closes disk1 if open on exit.

Code:
server[514] diff server.c.asd server.c
78a79
> void hup_handler(int);
140a142
>       signal(SIGHUP, hup_handler);
409a412,420
> void hup_handler(int sig)
> {
>       signal(sig, SIG_IGN);
>       printf("Exiting on HUP\n");
>       [B]if (use_disk1 && disk) fclose(disk);[/B]
>       [B]if (use_disk2 && disk2) fclose(disk2);[/B]
>       exit(0);
> }
>
418c429,430
<               fclose(disk);
---
>              [B] if (use_disk1 && disk) fclose(disk);[/B]
>               [B]if (use_disk2 && disk2) fclose(disk2);[/B]
 
Last edited:
Don, all,

For a little less violent way of terminating, I wrote a small pdp8 routine that sends an'Q' to the server and it quits. Kyle was surprised that it does that, he'd forgotten that he'd accounted for that in the code.

- Crawford
 
For a little less violent way of terminating, I wrote a small pdp8 routine that sends an'Q' to the server and it quits.

I did that to mine too.
I've arranged my Raspberry Pi to autostart the os8server when it boots and I also added a 'system("sudo shutdown -h now");' to shut down the Raspberry Pi cleanly. I don't think this is very portable but it works OK on the Pi.
 
So I think I've run out of ideas trying to run serialdisk in stand-alone "virtual" mode with Cygwin under Windows 10/64 bit. I've tried

- method as described using socat in both the same and different windows - result is always that the terminal isn't available.
- tried com0com but can't find a version which will install in W10 (installs after a fashion but with errors and can't run serialdisk.
- actually got things working using the Eltima Virtual Serial Port Driver but it fails after a shortish while with the 'received characters during a write' error from serialdisk which throws things out of sync.

This last attempt looked promising but I've not been able to nail the problem.
Actually this is an error which I've had not infrequently at high speeds/long cables using actual hardware which I've always put down to crosstalk noise triggering a false RX, but not so likely with a software hookup.
So a bit of a bummer - it would have been handy for shuffling images around.

If anyone has any ideas I'm all ears, otherwise I'll have to build up a unix machine to give it a go.
 
Reported here: http://forums.hrdsoftwarellc.com/fo...virtual-com-port-software-for-sdr-cat-control
that the signed v3.0.0 of com0com installs and runs on W10 64b. Can't vouch for this as I have experience with W7 64b and Wxp only.

Found this commercial solution: http://www.hhdsoftware.com/virtual-serial-ports but it is not inexpensive. No experience with it directly, altho I have used other HHD Software products that work really well.

Found this free solution: http://freevirtualserialports.com/ as pointed to by the above site. Again no experience using it (yet), but I am going to try it.

Might try upgrading your OS to W7 64b from W10 64b :)

Could also use the brute force hardware approach and use a couple of USB-to-serial converters connected back to back thru a null modem cable. If nothing else this could get you going in the short term while looking for a software only solution.

Don

PS: I tried the 'free virtual serial ports' software and could not get it to work with SeriaDisk. It worked with two TeraTerm windows, however. Looks like the 'free' version is just a crippled version of their regular software. Any attempt at configuration drops you into the 'you must purchase the licensed version to do that' dialog. So since com0com works fine for me on W7 64b I'm sticking with that alternative. At least until 2020 or so.
 
Last edited:
I'm also running SerialDisk on an RPi and so I've stuck with using a terminal emulator and a remote X-client. I keep all my working disk images in a single directory on the Pi; for development, I have a script for that loads SIMH from the os8diskserver/SerialDisk/simh directory and for "real"(?) work in the 8, I load os8disk from the os8diskserver/SerialDisk/server directory. In either case, I always load my disk images from os8diskserver/SerialDisk/disks so there isn't any question of which version of the image I'm using.

On the remote side, I use Absolute Telnet for my console port but anything other emulatore that supports telnet ought to work. Don't forget that you still have to run a remote X-client as well; again, I use X-ming here, which must be started before your console session. I also find that the first time around, the remote client may not "take" (or maybe I don't wait long enough for it?). The second time always works.

Before you build a full linux box, you might want to try the VirtualBox/Ubuntu setup as proof-of-concept.

I also like Don's idea of an upgrade to Win7!

Jack
 
"I also like Don's idea of an upgrade to Win7!"

Yes, I accepted the W10 upgrade from u$ several months ago so it's a hassle to rewind now and W10 has actually been flawless otherwise (just the usual nuisances with things in different places, or hidden, or absent, or not installed by default etc.). I share the study PC with my wife so it's best not to muck about with it too much ;). But it's no great hassle to dig out a unix box - I have one in the loft loaded with Cadence and Mentor stuff from my IC design days - just a matter of finding some space for it. Actually now I think of it I think my workshop PC has a dual-boot WXP/Ubuntu on it so I might try that first.
 
You can monitoring the data RS232/422/485 COM ports and also displays, logs and analyzes all serial port activity in a system by utility Serial Port Monitor by Eltima. I also used it in my work to "sniff" the serial commands sent/received over the serial port. It's not free, but you have 14 days to test it. This product is fully baked. Good developer tech support. Product does all it claims to do. (http://www.eltima.com/products/serial-port-monitor/)
 
Back
Top