NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Getty on USB serial port



Okay, something's completely not right here. Before rebooting, I ran `ps ax` just to see what interfaces getty was running on, and saw a getty for ttyU0 as expected, but no getty for the console.

Curious, I edited `/etc/ttys` and commented out the ttyU0 line, disconnected my USB serial port and rebooted. When I logged in, my `ps ax` looked like the following (plcom0 is indeed the console, according to dmesg):

```
PID TTY    STAT    TIME COMMAND
 0 ?      DKl  0:01.22 [system]
 1 ?      Is   0:00.05 init
181 ?      Is   0:00.09 /usr/sbin/syslogd -s
368 ?      Is   0:00.00 /sbin/devpubd
468 ?      I    0:00.12 qmgr -l -t unix -u
506 ?      Is   0:00.10 /usr/libexec/postfix/master -w
554 ?      I    0:00.11 pickup -l -t unix -u
568 ?      Ss   0:00.02 /usr/sbin/cron
72 plcom0 O+   0:00.01 ps -ax
594 plcom0 S    0:00.16 -sh
606 plcom0 Is   0:00.85 login
```

There's no getty process! What happened? Is getty supposed to disappear after invoking login? If so, why in your example,
I see the following?:
After a reboot, there are two getty processes. One for console and one
for ttyU0.

| root 821 0.0 0.2 4920 1464 ttyE0 Is+ 7:09AM 0:00.01 /usr/libexec/getty default console | root 493 0.0 0.2 4976 1520 ttyU0 Is+ 7:09AM 0:00.01 /usr/libexec/getty default ttyU0

-----Original Message----- From: Michael van Elst
Sent: Thursday, September 07, 2017 3:24 AM Newsgroups: lists.netbsd.users
To: netbsd-users%netbsd.org@localhost
Subject: Re: Getty on USB serial port

thor0505%comcast.net@localhost ("William D. Jones") writes:

ttyU0   "/usr/libexec/getty default"    vt100   on secure
However, this change had no effect and I didn't see any output on the system
attached at the other end of the USB serial port upon rebooting.

Here this just works. Setup:

RPI3 running NetBSD with a dual USB/Serial adapter:

| uplcom0 at uhub2 port 1
| uplcom0: Prolific Technology Inc. (0x67b) USB-Serial Controller D (0x2303), rev 1.10/4.00, addr 5
| ucom0 at uplcom0
| uplcom1 at uhub2 port 2
| uplcom1: Prolific Technology Inc. (0x67b) USB-Serial Controller D (0x2303), rev 1.10/4.00, addr 6
| ucom1 at uplcom1

In /etc/ttys:
ttyU0   "/usr/libexec/getty default"    unknown on secure
ttyU1   "/usr/libexec/getty default"    unknown off secure

After a reboot, there are two getty processes. One for console and one
for ttyU0.

| root 821 0.0 0.2 4920 1464 ttyE0 Is+ 7:09AM 0:00.01 /usr/libexec/getty default console | root 493 0.0 0.2 4976 1520 ttyU0 Is+ 7:09AM 0:00.01 /usr/libexec/getty default ttyU0


A laptop running NetBSD with a single USB/Serial adapter. The default
baudrate for both sides is 9600. Both are connected through a null-modem
cable. Running 'cu -l /dev/ttyU3' shows the getty login:

| NetBSD/evbarm (egghed) (ttyU0)
|
| login: root
| Password:
| Last login: Thu Sep  7 07:10:34 2017 from 10.28.5.17 on pts/0
| Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
|     The NetBSD Foundation, Inc.  All rights reserved.
| Copyright (c) 1982, 1986, 1989, 1991, 1993
|     The Regents of the University of California.  All rights reserved.
|
| NetBSD 8.99.2 (EGGHED) #62: Mon Sep 4 23:11:25 CEST 2017
...


A critical part is the null-modem cable, as it also has to connect
the handshake and flow control signals. If those signals are not
used correctly, you can try to disable the functionality in /etc/ttys
with the 'softcar' and/or 'local' flags. You may also tell cu (or
whatever terminal program you use) to ignore modem handshake and
flow control.


--
--
                               Michael van Elst
Internet: mlelstv%serpens.de@localhost
                               "A potential Snark may lurk in every tree."

--
William D. Jones
thor0505%comcast.net@localhost

Home | Main Index | Thread Index | Old Index