I had also done a Linux port of Dan's code because I couldn't get his BSD Unix comm port initialization routines to work under Linux. Mike says he normally runs under CYGWIN and the build file supplied in his archive no longer works for Linux. To work under CYGWIN Mike has added the O_BINARY file mode in the files main.c and file.c. It is defined in CYGWIN, but not the standard Linuc GCC include files. I added the following at the top of tu58.h to get things to compile:
#ifndef __CYGWIN__ #define O_BINARY 0 #endifObviously this could also be done in a Linux specific make file, but the above seems to compile nicely under gcc in Linux 2.0.36. It was interesting, the Linux binary supplied in Mike's archive ran fine under Linux kernel 2.4, but not 2.0. Recompiling with the patch above worked under 2.0. I also had some problems with Mike's MAKEFILE under 2.0.36, the were some case sensitivity issues regarding file names and dependancies. However all modules compiled cleanly and after linking it ran as advertised.
I present a brief summary of the changes I see regarding Mike's implementation of MRSP.
Mikes implementation accepts any byte from the host as an acknowledgment. I think its supposed to be a CONTINUE flag, but maybe a real TU58 doesn't care either.
Mike also does a flush at the begining of cwget(). Depending on machine speeds, I think this has the potential of erasing an acknowledgment which has already been sent. In tests where I was driving Mike's emulator from a faster machine this seemed to occur. It probably does NOT occur if one is running the emulator on a current day machine and talking to a physical PDP-11!
Re-reading the RSP specifications I notice that a break followed by two INIT flags is supposed to flush the buffers and return the TU58 to a known state ready to accept commands. I do not believe Dan's original code, Mike's patch, nor my MSDOS code do this correctly. If we start to send a packet, or a series of packets in a multi-block transfer, we keep sending data until we are done regardless of whether the host asked us to flush our buffers and start over. At some time in the future I hope to address this issue.
The bottom line is that Mike says this works for him in a production RSX environment, so it must be pretty stable.