Subject: Re: The infernal com driver revisited (take 4)
To: None <port-i386@NetBSD.ORG>
From: Mike Long <mike.long@analog.com>
List: port-i386
Date: 01/29/1997 10:10:53
>From: mycroft@gnu.ai.mit.edu (Charles M. Hannum)
>Date: 28 Jan 1997 16:08:50 -0500

>bad@flatlin.ka.sub.org (Christoph Badura) writes:
>
>> >* Fixing a bug for this snapshot has introduced an incompatibility
>> >with kermit.  Basically, if we have carrier detection enabled and we
>> >lose DCD, then we drop DTR.
>> 
>> Why?  What has the loss of Data Carrier Detect to do with the state of
>> Data Terminal Ready?  Why isn't DTR simply asserted as long as the
>> port is open?
>
>Honestly, I have no idea.  That's just how it was done before.  It
>seems to me that in the usual case (e.g. getty, a shell, pppd,
>whatever) the loss of DCD is going to cause all the processes holding
>the port open to die, so it will get closed and DTR will be dropped
>anyway.  In the case where something like kermit is holding it open,
>you probably don't want DTR to be dropped automatically.
>
>> >  If a program wants to continue using the
>> >port, it must either close and reopen it, or set CLOCAL mode and then
>> >do a TIOCSDTR.  kermit tries to continue using the port after just
>> >setting CLOCAL, and thus fails if the device on the other end is
>> >waiting for carrier.  It's unclear whether or not we should be
>> >clearing DTR in this case, but that seems to be what the majority of
>> >existing systems do.

The "close and reopen" bit rang a bell for me.  If you look at the
netbsd target in the C-Kermit makefile, the only difference between it
and the generic bsd44c target is the addition of one flag: -DNOCOTFMC.
If you read the ckuins.doc file, you can see that the way the NOCOTFMC
flag alters Kermit's behavior is to keep it from closing and reopening
the TTY to force certain mode changes.

Try using the bsd44c target to build C-Kermit instead of the netbsd
target, and see if that solves the problem.  I will try this for
myself as soon as I can rebuild a kernel with the latest version of
Charles' driver.
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil