Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Christian Worley <cworley@altatech.com>
Subject: Slip doesn't work without a serial port in OSF/1; a tty/pty programming question
Date: 1995/07/25	[thread overview]
Message-ID: <3v3iou$jca@news.xmission.com> (raw)

We're running Dec's OSF1 v3.0.  When we try to slattach a 
pseudo-terminal (pty) thru "slattach" we get the error message:

	"Device is not a typewriter"

Does DEC want to put Smith-Corona back in business? ;)

We're trying to run slip without a serial port...the "slattach"
program works great thru a serial port (/dev/ttyN), but does
not work when we try to route the slip data thru a pseudo-
terminal (/dev/ttypN).

Using a pseudo-terminal allows us, in theory, to provide the
slip data in and out programatically rather than thru a serial device.

We're routing slip data thru a device that we make.  This is a 
proof-of-concept for a point-to-point network using our
hardware.

Our hardware is not the problem ;)  No, really, it's not!

We can route slip data back forth thru our hardware.  

We can connect a serial cable to our hardware in the bus, route
that cable to the serial port in the same box.  This 
Rube-Goldburg-ish slip implementation works great.  It just looks 
strange to see a serial cable with both ends attached to the same 
host!

Worse yet, when we use our serial output we have to serialize high 
speed data from our device, slowing down its potential speed 
considerably.

Since we already can read/write data to our device from the OSF/1 OS, 
it should be possible to throw away the serial cable altogether and
route the data thru a pseudo terminal (pty) instead of a tty as slip
expects.

We're not re-writing device drivers.  We've got ours, and the
slip driver is embedded in OSF/1.  We're trying to make them work
together without having to know about each other.

We first noticed that pseudo-terminals were, by default, streams
based and slip required a BSD implementation.  We reconfigured OSF
to use use BSD-style pseudo-terminals.  Note:  I recommend everybody
reconfigure their OSF/1 systems this way; the BSD implementation
is noticeably faster (xterms pop-up a lot quicker, etc.)!!
 
We open the master & slave pseudo-terminal, and attempt to push
the slip line discipline upon the slave in slattach:


        if (ioctl(fd, TIOCSETD, &slipdisc) < 0) {
                fputs(dev, stderr);
                perror(": set discipline:");
                syslog(LOG_INFO, "TIOCSETD: %m");
                exit(1);
        }

Here, the ENOTTY error is issued.  "perror" prints "Device not a typewriter".

Although we don't have the OSF/1 source, I looked up "ENOTTY" in the bsd
source.  It is never issued in response to "TIOCSETD", but everywhere "ENOTTY" is
issued, it is in response to an "isactty" call ("is terminal the controlling terminal
for the process").  So, I tried a "TIOCSCTTY" ioctl call before the "TIOCSETD" call to
force the terminal to be the controller; but still got the "typewriter" error message.

Conceptually, this should have worked without a problem.  There's something in OSF/1
that seems to be specifically trying to weed out the tty portion of a pty when invoking
the slip line discipline.

Two of us have been working on this for five days now...

Any help would be appreciated.

Chris




             reply	other threads:[~1995-07-25  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-07-25  4:00 Christian Worley [this message]
1995-07-26  4:00 ` Slip doesn't work without a serial port in OSF/1; a tty/pty programming question Charles M Richmond
1995-07-27  4:00   ` Ross Alexander
1995-07-28  4:00 ` Christian Worley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox