* Slip doesn't work without a serial port in OSF/1; a tty/pty programming question
@ 1995-07-25 4:00 Christian Worley
1995-07-26 4:00 ` Charles M Richmond
1995-07-28 4:00 ` Christian Worley
0 siblings, 2 replies; 4+ messages in thread
From: Christian Worley @ 1995-07-25 4:00 UTC (permalink / 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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Slip doesn't work without a serial port in OSF/1; a tty/pty programming question
1995-07-25 4:00 Slip doesn't work without a serial port in OSF/1; a tty/pty programming question Christian Worley
@ 1995-07-26 4:00 ` Charles M Richmond
1995-07-27 4:00 ` Ross Alexander
1995-07-28 4:00 ` Christian Worley
1 sibling, 1 reply; 4+ messages in thread
From: Charles M Richmond @ 1995-07-26 4:00 UTC (permalink / raw)
The tty ports are clist and the ptys are streams based. Try using the
public domain ppp s/w for pty connections , or switch to a different
(ie also pd s/w) slip implementation.
Charlie
--
*****************************************************************************
* Charles Richmond Integrated International Systems Corporation *
* cmr@asoko.iisc.com cmr@world.std.com *
* Specializing in UNIX, X, Image Processing, and Communications. *
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Slip doesn't work without a serial port in OSF/1; a tty/pty programming question
1995-07-26 4:00 ` Charles M Richmond
@ 1995-07-27 4:00 ` Ross Alexander
0 siblings, 0 replies; 4+ messages in thread
From: Ross Alexander @ 1995-07-27 4:00 UTC (permalink / raw)
cmr@world.std.com (Charles M Richmond) writes:
>The tty ports are clist and the ptys are streams based. Try using the
>public domain ppp s/w for pty connections , or switch to a different
>(ie also pd s/w) slip implementation.
The other hack is to do it via a loopback pty (rlogin localhost).
Ugly, but I've been told it works.
Ross
--
Ross Alexander, ve6pdq -- (403) 675 6311 -- rwa@cs.athabascau.ca
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Slip doesn't work without a serial port in OSF/1; a tty/pty programming question
1995-07-25 4:00 Slip doesn't work without a serial port in OSF/1; a tty/pty programming question Christian Worley
1995-07-26 4:00 ` Charles M Richmond
@ 1995-07-28 4:00 ` Christian Worley
1 sibling, 0 replies; 4+ messages in thread
From: Christian Worley @ 1995-07-28 4:00 UTC (permalink / raw)
The problem is OSF/1 specific. A DEC network Guru read the post
and told me of the problem.
Basically, you can't switch line disciplines on a pty device (that's
close enough to the truth, without a long explanation).
It can be faked by creating a device driver with an ioctl
that contains two entry points. The first must be called
before the line discipline is switched. It should execute
the following code:
linesw[SLIPDISC].l_rint = ttyinput;
Where SLIPDISC is the index for the discipline to be used. You may need
to define ttyinput as an external function.
Then, switch disciplines. Afterwords, set the linesw table back
to the appropriate entry with your other ioctl entry:
linesw[SLIPDISC].l_rint = slinput;
This may not work for all disciplines; there must be a reason
why DEC put that code there; but, it worked for slip!!
Chris
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1995-07-28 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-07-25 4:00 Slip doesn't work without a serial port in OSF/1; a tty/pty programming question Christian Worley
1995-07-26 4:00 ` Charles M Richmond
1995-07-27 4:00 ` Ross Alexander
1995-07-28 4:00 ` Christian Worley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox