System III uucp modem line turnaround
Brad Templeton
brad at looking.UUCP
Thu Dec 8 09:13:46 AEST 1983
I have written line turnaround code for Unix system III that should work
on a binary licence machine. It works when I test it with my own code,
but fails with UUCP. The documentation I have on the tty driver is scant,
so I was wondering if anybody could help. Once I get it working, I'll post
to the net if people are interested. I am using an Onyx C8002, Unix release
3.0.1
The idea is to replace the getty for the modem line with a special modem
control process. This is done in /etc/inittab. My process forks off
a getty caller. The getty caller loops forking off getty on the dialin
line. It also opens the line, and when it gets a carrier detect, it
creates the uucp LCK..dialout file. It then waits for getty to terminate
with a wait(0) call. It then unlinks the LCK file and loops back.
The parent process is the modem dialer. It listens to named pipe /dev/dialer,
and expects a phone number of the sort uucp writes to the ACU when you use
a line of the form
ACU dialout dialer 1200
in the L-devices file. When it gets the phone number, it kills its child,
thus removing the getty from the line. It then dials the number, in this
case using HAYES Smartmodem dial codes.
This is the tricky part, because you must write to the modem without
carrier present. To do this I first open it with O_NDELAY, and then set
CLOCAL in the tty driver. I then open without O_NDELAY (using fcntl to
turn this bit off does not seem to work) and use this channel to dial the
phone. I turn CLOCAL off and close the files.
This all works fine. If you write a phone number to /dev/dialer, it dials
the phone, and then you can open the modem and talk to the dialed site.
But uucp refuses to work. If you do a uucico, it does everything fine
up to forking and writing to the ACU, but then just stops. The open
of the modem never returns, in spite of the fact that carrier detect
arrives when the connection completes. The last thing it prints is
ACU write ok, and then it hangs until timeout.
The setting of CLOCAL in the dialer seems to be part of the problem.
Just what does CLOCAL do? The documents I have say one line about
ignoring modem control. If this is the case, then why doesn't uucp's
open return immediately (and print dcf is xx as it does with direct lines
or when the /dev/dialer is not doing fancy stuff).
Anybody know?
--
Brad Templeton - Waterloo, Ontario (519) 886-7304
More information about the Comp.unix.wizards
mailing list