NetBSD-Users archive

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

Re: Getty on USB serial port



Finally got a chance to go back to this and... excellent! Some progress and some more questions.

First the progress:
* I was able to get a getty by swapping out my USB-to-serial device with another Prolific device: https://www.adafruit.com/product/70. Notice no flow control signals. I'll investigate the other device later.

* I was able to switch the speed to std.115200 (and use the "vt100") entry successfully.

Now the questions:
* While debugging, I disabled ttyU0 (FTDI cable connected) from the gettytab, rebooted, and attempted to echo characters down the serial line to be received by minicom on the other end; I got a `-sh: cannot create /dev/ttyU0: interrupted` each time. What could possibly cause this?

* `getty` is in fact spawning the `NetBSD (hostname) (tty?) login:` message and prompt, correct? Then `getty` will execve `login [user]` to ask for the password? One thing that confuses me is that the "user" prompt from both login and getty are identical. So I thought `getty` somehow execve's `login` to immediately show a prompt once certain conditions (RTS/CTS control?) of the serial line are met.

* I wanted to use the serial port that defaults to the console on my rpi as the ppp connection for various logistical reasons. Can I redirect kernel messages (and init messages) to another tty without recompiling? I don't see a kernel option in `man boot`.

* Possibly related, I'm trying to test an ekermit xfer over /dev/plcom0, but to no avail. When I execute `ekermit -r < /dev/plcom0` as root, nothing happens; there's no output on remote end. When I execute `ekermit -r < /dev/plcom0` as a normal user, I get "Permission denied". Here are the permissions of each:

```
rpi-ptrain$ ls -l /dev/plcom0
crw-------  1 uucp  wheel  93, 0 Jun 25 12:49 /dev/plcom0
rpi-ptrain$ ls -l /dev/ttyU0
crw-------  1 wjones  tty  74, 0 Jun 25 17:42 /dev/ttyU0
```

Why are they different, and why do I own `ttyU0` (I don't think NetBSD dynamically creates/alters device nodes)?

* While I don't think I'll need this, is `/etc/rc.local` a good place for serial parameters I need to change with `stty`?

I'm on the right track now, so thank you for your help :)!

-----Original Message----- From: Michael van Elst
Sent: Thursday, September 07, 2017 5:34 PM 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:

There's no getty process! What happened? Is getty supposed to disappear
after invoking login?

Yes. getty initializes the tty, waits for input and then executes login.
It doesn't fork a subprocess, it just calles execve().

login will also just execute your login shell (after you successfully
entered user+password). When your login shell exits, the whole session
is gone and init spawns another getty process.

When you fail to login several times, the login process will exit itself.
And again the session ends and init spawns another getty process.


Greetings,
--
--
                               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