From owner-freebsd-current@FreeBSD.ORG Tue Feb 10 23:53:53 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94645106566B for ; Tue, 10 Feb 2009 23:53:53 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 540428FC22 for ; Tue, 10 Feb 2009 23:53:53 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 8BF3F1E00287; Wed, 11 Feb 2009 00:24:26 +0100 (CET) Received: from saturn.kn-bremen.de (noident@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id n1ANLjog014509; Wed, 11 Feb 2009 00:21:45 +0100 (CET) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id n1ANLjG2014508; Wed, 11 Feb 2009 00:21:45 +0100 (CET) (envelope-from nox) Date: Wed, 11 Feb 2009 00:21:45 +0100 (CET) From: Juergen Lock Message-Id: <200902102321.n1ANLjG2014508@saturn.kn-bremen.de> To: bms@incunabulum.net X-Newsgroups: local.list.freebsd.current In-Reply-To: <49910C3D.90709@incunabulum.net> Organization: home X-Mailman-Approved-At: Wed, 11 Feb 2009 00:05:08 +0000 Cc: freebsd-current@freebsd.org Subject: Re: uart(4) not working in QEMU X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:53:53 -0000 In article <49910C3D.90709@incunabulum.net> you write: >Hi, > >I have been trying to test my kernel code in QEMU as it saves a lot of >time and effort. >However, I have noticed since returning to my current project, that >sio(4) was deprecated in favour of uart(4). > >Whilst I updated my kernel configs to reflect this, I've noticed a lot >of problems with I/O and QEMU -- in particular, the kernel will log >messages over uart(4) just fine, but when the kernel runs init, I can't >get any I/O out of the uart(4) at all, apart from a single 'c' or 'F' >character. > >The kernel continues to log messages OK to the uart0/ttyu0 device >regardless of what's going on in userland. > >If I configure ttyv0 in the QEMU virtual machine up via /etc/ttys to run >a getty there, I can get in, and see that the getty for ttyu0 is >running. However, echo'ing or cat'ing data to /dev/ttyu0 won't work, >even if I kill the getty process first. I just don't see anything >appearing in my QEMU serial console. > >I've tried a lot of combinations of 3wire.115200 vs std.9600, >boot.config options, loader.conf options, none of which have solved the >problem (mostly working from the threads on this list from when the >changes were made). > >I have also tried other bindings for the QEMU serial device -- e.g. tcp >ports, nmdm(4), and always see the same effects. I do have INVARIANTS >enabled -- could this be an issue? I dunno if INVARIANTS changes the behaviour of the uart driver (my guess is it doesn't), but I see there have been commits to qemu's hw/serial.c since the versions in ports so you could try a more recent svn snapshot like the one posted here: http://lists.freebsd.org/pipermail/freebsd-emulation/2009-February/005650.html If that doesn't help and you feel like debugging this maybe uncommenting the DEBUG_SERIAL #define in hw/serial.c helps... Good luck, Juergen