1
0
mirror of synced 2026-01-29 13:01:49 +00:00

3 Commits

4 changed files with 11 additions and 7 deletions

View File

@@ -32,6 +32,8 @@ Note:
``` ```
So it appears that the drivers for real comm ports handle BREAK correctly, as does the driver for the USB ftdi adapter, on both WinXP and Linux. The USB prolific adapter hardware and/or driver do not handle a BREAK, altho all data transfers operate correctly. So it appears that the drivers for real comm ports handle BREAK correctly, as does the driver for the USB ftdi adapter, on both WinXP and Linux. The USB prolific adapter hardware and/or driver do not handle a BREAK, altho all data transfers operate correctly.
Configuring your serial card in the PDP-11 requires it be setup as 8-N-1 (8b data, no parity, one stop) AND that the serial interface card (example, a DL11-W in a UNIBUS system) be setup at the standard address of 776500 thru 776506. Also make sure that the card is enabled to send BREAK as that is an integral part of the TU58 serial protocol.
A cygwin folder with a precompiled 32b cygwin executable (tu58em.exe) is included for those without cygwin environment access. Under Windows, just open a standard CMD.EXE window, change to the cygwin folder, and run the <B>tu58em.exe</B> executable as a command line program. A cygwin folder with a precompiled 32b cygwin executable (tu58em.exe) is included for those without cygwin environment access. Under Windows, just open a standard CMD.EXE window, change to the cygwin folder, and run the <B>tu58em.exe</B> executable as a command line program.
If the emulator is run with no options, it prints a usage screen: If the emulator is run with no options, it prints a usage screen:

3
main.c
View File

@@ -83,6 +83,7 @@
// so that BREAKs are handled correctly via setjmp/longjmp // so that BREAKs are handled correctly via setjmp/longjmp
// Update tu58drive.c to intercept rx byte read routine to // Update tu58drive.c to intercept rx byte read routine to
// detect input line BREAK and process as required. // detect input line BREAK and process as required.
// v2.0b - 03 Apr 2018 - donorth - Change iflags from PARMRK|IGNPAR to PARMRK|INPCK
// //
@@ -93,7 +94,7 @@
static char copyright[] = "(C) 2005-2017 Don North <ak6dn" "@" "mindspring.com>, " \ static char copyright[] = "(C) 2005-2017 Don North <ak6dn" "@" "mindspring.com>, " \
"(C) 1984 Dan Ts'o <Rockefeller University>"; "(C) 1984 Dan Ts'o <Rockefeller University>";
static char version[] = "tu58 tape emulator v2.0a"; static char version[] = "tu58 tape emulator v2.0b";
static char port[32] = "1"; // default port number (COM1, /dev/ttyS0) static char port[32] = "1"; // default port number (COM1, /dev/ttyS0)
static long speed = 9600; // default line speed static long speed = 9600; // default line speed

View File

@@ -9,25 +9,26 @@ ifeq ($(OPSYS),Darwin)
# mac: UNIX comms model, but on MACOSX # mac: UNIX comms model, but on MACOSX
OPTIONS = -DMACOSX OPTIONS = -DMACOSX
LFLAGS = -lpthread LFLAGS = -lpthread
BINDIR = /usr/local/bin
else ifeq ($(OPSYS:CYGWIN%=CYGWIN),CYGWIN) else ifeq ($(OPSYS:CYGWIN%=CYGWIN),CYGWIN)
# win: WINDOWS comms model under CYGWIN (any version) # win: WINDOWS comms model under CYGWIN (any version)
OPTIONS = -DCYGWIN -DWINCOMM OPTIONS = -DCYGWIN -DWINCOMM
LFLAGS = -lpthread -lrt LFLAGS = -lpthread -lrt
BINDIR = /cygdrive/e/DEC/tools/exe
else ifeq ($(OPSYS),Linux) else ifeq ($(OPSYS),Linux)
# unix: UNIX comms model under LINUX, use PARMRK serial mode # unix: UNIX comms model under LINUX, use PARMRK serial mode
OPTIONS = -DLINUX -DUSE_PARMRK OPTIONS = -DLINUX -DUSE_PARMRK
LFLAGS = -lpthread -lrt LFLAGS = -lpthread -lrt
BINDIR = /usr/local/bin
else # unknown environment else # unknown environment
OPTIONS = OPTIONS =
LFLAGS = -lpthread -lrt LFLAGS = -lpthread -lrt
BINDIR = /usr/local/bin
endif endif
# default program name, redefine PROG=xxx on command line if wanted # default program name, redefine PROG=xxx on command line if wanted
PROG = tu58em PROG = tu58em
# put your binary installation directory here...
BINDIR = /cygdrive/e/DEC/tools/exe
# compiler flags and libraries # compiler flags and libraries
CC = gcc CC = gcc
CFLAGS = -I. -O3 -Wall -c $(OPTIONS) CFLAGS = -I. -O3 -Wall -c $(OPTIONS)

View File

@@ -586,10 +586,10 @@ void devinit (char *port,
// open serial port // open serial port
int32_t euid = geteuid(); int32_t euid = geteuid();
int32_t uid = getuid(); int32_t uid = getuid();
setreuid(euid, -1); if (setreuid(euid, -1)) fatal("setreuid(euid,-1) failed");
if (sscanf(port, "%u", &n) == 1) sprintf(name, "/dev/ttyS%u", n-1); else strcpy(name, port); if (sscanf(port, "%u", &n) == 1) sprintf(name, "/dev/ttyS%u", n-1); else strcpy(name, port);
if ((device = open(name, O_RDWR|O_NDELAY|O_NOCTTY)) < 0) fatal("no serial line [%s]", name); if ((device = open(name, O_RDWR|O_NDELAY|O_NOCTTY)) < 0) fatal("no serial line [%s]", name);
setreuid(uid, euid); if (setreuid(uid, euid)) fatal("setreuid(uid,euid) failed");
// get current line params, error if not a serial port // get current line params, error if not a serial port
if (tcgetattr(device, &lineSave)) fatal("not a serial device [%s]", name); if (tcgetattr(device, &lineSave)) fatal("not a serial device [%s]", name);
@@ -602,7 +602,7 @@ void devinit (char *port,
INLCR | IGNCR | ICRNL | IXON | IXOFF | INLCR | IGNCR | ICRNL | IXON | IXOFF |
IUCLC | IXANY | PARMRK | IGNPAR ); IUCLC | IXANY | PARMRK | IGNPAR );
#ifdef USE_PARMRK #ifdef USE_PARMRK
line.c_iflag |= ( PARMRK | IGNPAR ); line.c_iflag |= ( PARMRK | INPCK );
#else // !USE_PARMRK #else // !USE_PARMRK
line.c_iflag |= ( 0 ); line.c_iflag |= ( 0 );
#endif // !USE_PARMRK #endif // !USE_PARMRK