From owner-freebsd-questions@FreeBSD.ORG Wed Jun 12 16:08:59 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4DB725D4 for ; Wed, 12 Jun 2013 16:08:59 +0000 (UTC) (envelope-from rstor22@gmail.com) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 268F318C3 for ; Wed, 12 Jun 2013 16:08:59 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id x12so5269117ief.40 for ; Wed, 12 Jun 2013 09:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=QiyjcHLuFUskpqHj4p4BWSjiKfMhJahaQGnQUX3T9oI=; b=fjijOX3HzImvKoXwDpjO/KIe5i+qX18XNECrTreevil5PQwyeUv9CpB1xU6MK8/9wy aOlf6bOq2a8415TU02QfXikyl+U1R3KHPHrXEh0+PmKCuyhv44llA2RxlNZkWjB0KMeD s/wwB60QfjfF30CdfwoSdxKkZM7dpeuxWA5c3QyIxu/+g8iMxrGGt7ScmfFcxLb44zdt OJd6JsPrajDoncpZFcdNI8HeB02NCjJui9MePm918D7UpEpD/38q0jFMd+FR/8hJ0bK1 pEd8y8ZUp2ahxI3mjH0zz4RdZap4wAih10qdLKMxXqbeh8D26X5Uu1y0r48ERM0vKCLx yUgQ== MIME-Version: 1.0 X-Received: by 10.42.95.147 with SMTP id f19mr8185442icn.24.1371053338839; Wed, 12 Jun 2013 09:08:58 -0700 (PDT) Received: by 10.50.27.37 with HTTP; Wed, 12 Jun 2013 09:08:58 -0700 (PDT) Date: Wed, 12 Jun 2013 12:08:58 -0400 Message-ID: Subject: FreeBSD 9.1 Carrier Detection From: Rad Stor To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2013 16:08:59 -0000 Background: I was having troubles with carrier detection for modems/null modem connections under Solaris 8 (i.e. login session remains active after the modem disconnects). I tried two different dumb modems (do not respond to AT commands). They both output the appropriate voltage on the CD line when a carrier is detected/not detected (I have confirmed this using a volt meter and applying the appropriate carrier tone via a function generator). I then decided to try a null modem connection When accessing the serial console on the Solaris 8 system using a null modem cable, the login session remains active when disconnecting the cable and plugging it back in. To my understanding this should not happen, in the first case with the modem, or with the null modem cable (as I disabled software carrier detection). I decided to test out carrier detection on FreeBSD 9.1 on a different machine running within virtual box. I used a usb-serial dongle which shows up as ttyu0 on the BSD machine. Carrier detection appears to work. When I establish a null modem connection I receive a login prompt. If I login, and then unplug and plug back the cable, I get the login prompt again and the old session does not continue. This is the correct behaviour to my understanding however I am curious of the way the getty process behaves, esp. on bootup in FreeBSD. Question: The line in my /etc/ttys file is as follows: ttyu0 "/usr/libexec/getty std.300" dialup on I then issued the command "kill -HUP 1" and restarted the system with *nothing* plugged into the serial port. Reading the documentation it is my understanding that when the system starts up and no carrier is detected, when issuing the ps -ax command, the result I am supposed to see should be something as follows: 114 ?? I 0:00.10 /usr/libexec/getty std.300 ttyu0 However I instead see a similar output to the above but the question marks are replaced by letters. Per the documentation at : ttp://www.freebsd.org/doc/en/books/handbook/dialup.html it indicates that if something like this is displayed it means that "getty has completed its open on the communications port. This could indicate a problem with the cabling or a misconfigured modem, because getty should not be able to open the communications port until carrier detect has been asserted by the modem." I figured that since nothing is connected into the serial port, perhaps the voltage levels may be floating, instead of being held at the negative voltage which would indicate no carrier. I therefore applied a negative voltage to the CD line and restarted the system. Upon restart I issuing the ps -ax command and the result was as before, letters instead of the question marks. I then manually applied a positive voltage to the CD line and then a negative voltage again. I had to do it a couple times however eventually it showed up with question marks. I then was able to toggle back and forth, positive voltage resulted in letters, negative voltage on CD line resulted in question marks (which is the correct behaviour to my understanding). Why is it that when a negative voltage is applied to the CD line, upon system start-up getty indicates via the ps -ax command that it has opened the port? [i.e. letters appear instead of question marks] I would expect that with a negative voltage applied to the CD line, upon restart it would show up with ?? I need to toggle the voltage between negative to positive and then back to negative (sometimes I need to do it a couple times) for it to eventually show up with ?? and then it would toggle back and forth as I switch the voltages thereafter.