Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 2015 14:52:20 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Neel Natu <neel@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r285217 - head/usr.sbin/bhyve
Message-ID:  <20150706215220.GP8523@funkthat.com>
In-Reply-To: <1436213492.1334.64.camel@freebsd.org>
References:  <201507061933.t66JXTtJ050058@repo.freebsd.org> <1436213492.1334.64.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Ian Lepore wrote this message on Mon, Jul 06, 2015 at 14:11 -0600:
> On Mon, 2015-07-06 at 19:33 +0000, Neel Natu wrote:
> > Author: neel
> > Date: Mon Jul  6 19:33:29 2015
> > New Revision: 285217
> > URL: https://svnweb.freebsd.org/changeset/base/285217
> > 
> > Log:
> >   Always assert DCD and DSR in bhyve's uart emulation.
> >   
> >   The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
> >   ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
> >   
> >   The initial terminal type passed to getty(8) is "3wire" which sets the
> >   CLOCAL flag. However reset(1) clears this flag and any programs that try
> >   to open the terminal will hang waiting for DCD to be asserted.
> >   
> >   Fix this by always asserting DCD and DSR in the emulated uart.
> >   
> >   The following discussion on virtualization@ has more details:
> >   https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html
> >   
> >   Reported by: jmg
> >   Discussed with: grehan
> 
> This seems like a wrong fix.  A real 3-wire serial console doesn't have
> DCD and DSR wired on.  Why isn't the right fix here having the user with
> this problem to do "stty -f /dev/ttyu0.lock clocal", maybe in rc.local? 
> 
> Hmmm, or maybe it would be right for getty to do the equivelent when it
> sees a 3wire type?

This seems more sane to me...

Ok, so I just tested on real hardware, and something is wrong w/
FreeBSD's behavior...  Could this be a change between 10 and HEAD?

One a real machine (I manually added 3wire from HEAD so /etc/ttys is
exactly the same between the two):
# uname -a
FreeBSD  10.1-STABLE FreeBSD 10.1-STABLE #102: Mon Jun 22 18:28:28 PDT 2015     jmg@carbon.funkthat.com:/a/home/jmg/consulting/netflix/new_sys/amd64/compile/bhgdb  amd64
# echo $TERM
vt100
# stty -a | grep clocal
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -dsrflow
# reset
Erase is backspace.
# stty -a | grep clocal
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -dsrflow

and under bhyve:
# uname -a
FreeBSD  11.0-CURRENT FreeBSD 11.0-CURRENT #11 r284880M: Fri Jul  3 14:14:49 PDT 2015     jmg@carbon.funkthat.com:/a/obj/a/home/jmg/FreeBSD.svn/HEAD/sys/IPSEC  amd64
# echo $TERM
vt100
# stty -a | grep clocal
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
# reset
<screen clears here, unlike real hardware>
# stty -a | grep clocal                                                 
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow

I check and both .init and .lock have the same settings...  reset -S
both return the same termcap entry...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150706215220.GP8523>