From owner-freebsd-stable@freebsd.org Mon Aug 13 19:36:46 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41579107B4A1 for ; Mon, 13 Aug 2018 19:36:46 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BDA178904E for ; Mon, 13 Aug 2018 19:36:45 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w7DJabSu049412 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Aug 2018 21:36:38 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: alexander.lochmann@tu-dortmund.de Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w7DJaXx4046769 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 14 Aug 2018 02:36:33 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: FreeBSD blocks on BOCHS serial port To: Alexander Lochmann , freebsd-stable@freebsd.org References: From: Eugene Grosbein Message-ID: Date: Tue, 14 Aug 2018 02:36:27 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2018 19:36:46 -0000 13.08.2018 20:52, Alexander Lochmann wrote: > Hi folks! > > We are doing some automatic experiments using FreeBSD running in a > virtual machine. > To control the experiment from the outside, we use serial ports to > communicate with an userspace program. > The communication via serial does work with QEMU. However, it does not > work with BOCHS which is our desired emulator. > Even simple operations like 'echo FOO | tee /dev/ttyu1' or 'cat > /dev/ttyu1' do not work. Both commands block 'forever'. > It does not matter whether we use ttyu0 (file backend) or ttyu1 (tcp > socket). > I put some debug output in sys/dev/uart/uart_dev_ns8250.c. The output > suggests that the driver more or less reads and writes to the serial > ports. At least it does something... > > Do you have any hints how we can further analyze this problem? > Did anyone came across a similar problem? This could be modem control line "Carrier Detection" (CD) or flow control problem: emulators can have distinct default settings for serial ports. You should not rely on defaults and make sure you disable modem control/CD either explicitly (using stty(1) etc.) or implicitly by switching to /dev/cuau0 instead of /dev/ttyu0. Flow control settings should match too, for both sides of virtual port.