Sponsored Content
Full Discussion: Carrier Detection in FreeBSD
Operating Systems BSD Carrier Detection in FreeBSD Post 302820975 by rstor on Thursday 13th of June 2013 05:54:00 PM
Old 06-13-2013
Carrier Detection in FreeBSD

Regarding carrier detection on FreeBSD 9.1 being run 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:

Code:
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 online, 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:

Code:
  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 online 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.

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.

Last edited by Scott; 06-13-2013 at 07:06 PM.. Reason: Please use code tags for code, data and terminal output
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

no carrier

I'm getting a error le0: No Carrier - transceiver cable problem? Tried looking around to see what is the best way to fix this error. Can anyone help me I can't find anything. (2 Replies)
Discussion started by: merlin
2 Replies

2. UNIX for Dummies Questions & Answers

virus detection

IS there virus software for unix? I worked in a Solaris environment and dont remember having anything. I also ask because the current enviroment i am working on is Microsoft and they argue that they do not use unix because of virus detection. Any input would be greatly appreciated. (1 Reply)
Discussion started by: pbonilla
1 Replies

3. IP Networking

modem detection

How to get information that where is my modem configured in /dev. I have two modems configured in my device .. one is USB and other is PCI modem.. USB is detected as /dev/USB0. but how to see about PCI modem? (0 Replies)
Discussion started by: s123.radha
0 Replies

4. Programming

Application crashes in FreeBSD 7.1 while working ok in FreeBSD 6.3

Hello there, My mulithreaded application (which is too large to represent the source code here) is crashing after installing FreeBSD 7.1-RELEASE/amd64. It worked properly on others machines (Dual Cores with 4GB of RAM - FreeBSD 6.2-RELEASE/i386). The current machine has 2x Core 2 Duo... (1 Reply)
Discussion started by: Seenquev
1 Replies

5. Shell Programming and Scripting

NAT detection

hellou, can anybody help me with nat detection in real time ? i prefer some detection script because i try some nat detection program's for example p0f or i'm using tcpdump, but i would get contain of specific packet. Some ideas? (1 Reply)
Discussion started by: TheTechnic
1 Replies

6. Programming

Parallel Processing Detection and Program Return Value Detection

Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Discussion started by: azar.zorn
4 Replies

7. UNIX for Dummies Questions & Answers

Power Line Carrier (PLC)

hi, i am going to know if i can use n.s for power line simulating? Best Regards, (2 Replies)
Discussion started by: mohsenmahoor
2 Replies

8. Solaris

Carrier Detection in Solaris 8 for Dial in and Null Modem Connections

I am having troubles with carrier detection for dialing in via a modem or direct connection via a null modem connection under Solaris 8 (i.e. login session remains active after the modem disconnects). I tried two different dumb modems (which do not respond to AT commands) on the machine that I am... (6 Replies)
Discussion started by: rstor
6 Replies
GETTY(8)						    BSD System Manager's Manual 						  GETTY(8)

NAME
getty, uugetty -- set terminal modes for system access SYNOPSIS
getty [type [tty]] uugetty [type [tty]] DESCRIPTION
The getty program is called by init(8) to open and initialize the tty line, read a login name, and invoke login(1). The devices on which to run getty are normally determined by ttys(5). The getty program can also recognize a Point to Point Protocol (PPP) negotiation, and, if the pp attribute in gettytab(5) is set, invoke the program given by that string, e.g., pppd(8), instead of login(1). This makes it possible to use a single serial port for either a "shell" account with command line interface, or a PPP network link. The argument tty is the special device file in /dev to open for the terminal (for example, "ttyh0"). If there is no argument or the argument is '-', the tty line is assumed to be open as file descriptor 0. The type argument can be used to make getty treat the terminal line specially. This argument is used as an index into the gettytab(5) data- base, to determine the characteristics of the line. If there is no argument, or there is no such table, the default table is used. If there is no /etc/gettytab a set of system defaults is used. If indicated by the table located, getty will clear the terminal screen, print a ban- ner heading, and prompt for a login name. Usually either the banner or the login prompt will include the system hostname. getty uses the ttyaction(3) facility with an action of "getty" and user "root" to execute site-specific commands when it starts. Most of the default actions of getty can be circumvented, or modified, by a suitable gettytab(5) table. The getty program can be set to timeout after some interval, which will cause dial up lines to hang up if the login name is not entered rea- sonably quickly. The uugetty program is the same, except that it uses pidlock(3) to respect the locks in /var/spool/lock of processes that dial out on that tty. FILES
/etc/gettytab /etc/ttys /var/spool/lock/LCK..ttyXX DIAGNOSTICS
ttyxx: No such device or address. ttyxx: No such file or address. A terminal which is turned on in the ttys(5) file cannot be opened, likely because the requisite lines are either not configured into the system, the associated device was not attached during boot-time system configuration, or the special file in /dev does not exist. SEE ALSO
login(1), ioctl(2), pidlock(3), ttyaction(3), tty(4), gettytab(5), ttys(5), init(8), pppd(8) HISTORY
A getty program appeared in Version 6 AT&T UNIX. BSD
December 12, 1998 BSD
All times are GMT -4. The time now is 05:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy