*BSD News Article 25750


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!paladin.american.edu!howland.reston.ans.net!cs.utexas.edu!uunet!nwnexus!sandy
From: sandy@halcyon.com (Jeremy Scofield)
Newsgroups: comp.os.386bsd.questions
Subject: Question about serial driver design in NetBSD
Date: 8 Jan 1994 15:04:17 -0800
Organization: "A World of Information at your Fingertips"
Lines: 51
Sender: news@nwfocus.wa.com
Message-ID: <2gne5h$1hq@nwfocus.wa.com>
NNTP-Posting-Host: nwfocus.wa.com
Keywords: CLOCAL, calling units, carrier detect

I'm looking for some info from the *BSD developers, or anyone who
understands the design of the serial-port driver in NetBSD.  Since this
may not be the best place to ask, I also solicit suggestions on where I
might find an answer.

I've been trying to get a modem attached to my NetBSD 0.9 system, to
use for dialing in and out.  Unfortunately, the serial-port driver
isn't making this easy.  The man page termios(4) says that an ordinary
open() of the device will block until carrier is detected (provided
that CLOCAL is off).  The driver isn't working that way -- getty gets
the device open immediately and writes the prompt, causing a hard echo
loop between the port and the modem.  (I know that I can can fix this
particular problem by telling the modem not to echo while in command
mode, but that doesn't solve the other related problems with the
driver.)

Reading through the driver code (com.c), I found what appears to be the
reason -- the line

	comsoftCAR |= 1 << unit;	/* XXX */

in the comattach() routine.  This makes the driver act as if CD
(carrier detect) is always on.

I have three questions.

    1.  What is that line doing there?  The XXX suggests that maybe it
	was added as a temporary fix.  Is there a problem supporting real
	CD on PC serial ports?

    2.  I don't see any code in com.c to support Berkeley ``calling
	units'' (e.g. cu00 corresponding to tty00), that make it
	possible to dial *out* on a port while getty is blocked waiting
	for CD.  According to an old comp.unix.bsd article by Terry
	Lambert, the ``calling unit'' approach is simpler *and* more
	robust than the uugetty/O_NDELAY/CLOCAL jazz.  So if this is a
	Berkeleyism, and it was available in some versions of 386BSD,
	and it's technically superior, why isn't it in the NetBSD code?

    3.  What are the NetBSD developers planning to do about serial
	ports?  Will CD be supported, at least on those serial cards
	that can do it?  Will there be ``calling units'', or are they
	moving away from that idea for some reason?  (I may do some
	whacking on the driver, but I'd like to avoid going off in a
	completely different direction.)

Thanks.

    Jeremy Scofield		(posting via a friend's account)
    Cedar River Software	cs.washington.edu!cedar!jeremy
    Renton, WA			jeremy@cedar.uucp