From owner-freebsd-bugs Fri Mar 7 00:10:03 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id AAA25143 for bugs-outgoing; Fri, 7 Mar 1997 00:10:03 -0800 (PST) Received: from meter.eng.uci.edu (root@meter.eng.uci.edu [128.200.85.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA25113; Fri, 7 Mar 1997 00:09:59 -0800 (PST) Received: from newport.ece.uci.edu by meter.eng.uci.edu (8.8.5) id AAA10605; Fri, 7 Mar 1997 00:09:48 -0800 (PST) Received: from localhost by newport.ece.uci.edu (8.8.5) id AAA22214; Fri, 7 Mar 1997 00:09:46 -0800 (PST) Message-Id: <199703070809.AAA22214@newport.ece.uci.edu> To: Bruce Evans cc: bugs@freebsd.org, current@freebsd.org, msmith@atrad.adelaide.edu.au Subject: Re: serial driver In-reply-to: Your message of "Fri, 07 Mar 1997 18:02:05 +1100." <199703070702.SAA04952@godzilla.zeta.org.au> Date: Fri, 07 Mar 1997 00:09:45 -0800 From: Steven Wallace Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Okay, by Mike suggestion, here is an example of what happens: I got out my break box and looked at the levels of the line Terminal Device <-----straight 25 pin to COM1-----> FreeBSD BOX Pin 2 TD OFF Pin 3 RD OFF Pin 4 RTS OFF Pin 6 DSR OFF Pin 8 CD OFF Pin 20 DTR OFF cat /dev/ttyd0 > output (hangs waiting for input on BSD box) Pin 2 TD OFF Pin 3 RD OFF Pin 4 RTS OFF Pin 6 DSR ON # PC now says now active Pin 8 CD ON # " Pin 20 DTR OFF output file into serial port of "terminal", thereby activating its serial port. Note the device raises DTR. This is similar to doing something like: cat file > serial device Both are device and PC operating at 9600 baud. Pin 2 TD ON # device sending data to PC Pin 3 RD OFF Pin 4 RTS ON Pin 6 DSR ON Pin 8 CD ON Pin 20 DTR ON # device saying its active File output grows larger. Device transmits 10016 bytes. file output on PC is now 10000 bytes Device drops DTR. up to last 16 bytes are lost on PC file remainas at 10000 bytes --- What I would expect is to receive the data transmitted before DTR was dropped. According to what Bruce says, data not read by the read() call is dropped after DTR is dropped in real time. I just tried setting clocal to the device and it received all the data its first time through. The disadvantage is that the cat program still sits there waiting for more data to output to the file so I had to press ^C to stop it. Is there any way to get the functionality I desire? I want the cat program to close / read to fail after all data is read before the DTR was dropped. Don't you think that makes more sense anyways? I'd hate to lose data because the load was too high or whatever and my process was not able to read() it before DTR/carrier was lost. Steven