From: Peter Wu <lekensteyn@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] chardev: add baud parameter for serial host device
Date: Mon, 10 Jun 2013 15:51:54 +0200 [thread overview]
Message-ID: <5853599.ayUtGtoVHK@al> (raw)
In-Reply-To: <4881344.H8WkShJ958@al>
On Monday 10 June 2013 15:28:32 Peter Wu wrote:
> On Monday 10 June 2013 14:58:07 Gerd Hoffmann wrote:
> > On 06/10/13 10:42, Peter Wu wrote:
> > > On Monday 10 June 2013 07:56:01 Gerd Hoffmann wrote:
> > >> On 06/08/13 23:49, Peter Wu wrote:
> > >>> When QEMU starts, it always changes the serial port parameters
> > >>> including
> > >>> baud rate. This confused my guest which thought it was outputting at
> > >>> 9600
> > >>> baud while it was in fact changed to 115200.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> After this patch, I can use `-serial /dev/ttyS0,baud=9600` to override
> > >>> the
> > >>> default baud rate of 115200.
> > >>
> > >>
> > >>
> > >> I think we should just flip the default to 9600. IIRC this is the
> > >> power-on default baud rate of the 8250 uart family, so this should be
> > >> the qemu default too. If a guest wants to use a higher baudrate it has
> > >> to reprogram the uart anyway (and qemu will apply the guest changes to
> > >> the host uart).
> > >
> > >
> > >
> > > FWIW, when I tried MODE.COM in ms-dos to change the baud rate, `stty -F
> > > /dev/ttyS0 -a` still reported 115200 baud. This is on Linux 3.9 if that
> > > matters.
> >
> >
> >
> > Hmm, with a linux guest changing the baudrate works just fine. Any
> > chance mode.com takes a shortcut in case it thinks the rate didn't
> > change? Does setting the speed first to 4800, then to 9600 work?
>
> I can confirm that a Linux guest can correctly control the speed. At home I
> only have a USB serial, but that shouldn't matter.
> 1. stty -F /dev/ttyUSB0 reports 9600
> 2. Start QEMU using:
> qemu-system-x86_64 -enable-kvm -m 1G -serial /dev/ttyUSB0 \
> -cdrom ubuntu-12.04.1-desktop-amd64.iso
> 3. stty -F /dev/ttyUSB0 reports 115200 before booting the live CD
> 4. After boot, both the guest and host report 9600 again
> 5. Changing it using stty -F /dev/ttyS0 from the guest is also visible on
> both sides.
>
> On ms-dos I observe with 1.4.1 and 1.5.0 that the baud rate *is* changed
> correctly with my USB serial converter. I will have to check with the
> serial printer again whether I made a mistake before. I did actually have
> to use `stty -F /dev/ttyS0 raw 9600` to avoid characters being eaten which
> caused the serial printer to spit out empty lines or hang.
Aha, I just checked that machine again and realised something. The serial
cable has only four pins connected to a printer (DB9-DB25), namely RX, TX, DTR
and RTS. The remaining cables are cut (originally it was a null modem cable,
but that did not work with the printer).
So, what is the likely issue here? Having a printer instead of a serial
console or the hardware (cables) missing some lines? FYI, when I set the speed
and options manually after starting QEMU, the printer(s) work(s) as expected,
otherwise I get garbage out.
Regards,
Peter
next prev parent reply other threads:[~2013-06-10 13:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-08 21:49 [Qemu-devel] [PATCH] chardev: add baud parameter for serial host device Peter Wu
2013-06-10 5:56 ` Gerd Hoffmann
2013-06-10 8:42 ` Peter Wu
2013-06-10 12:58 ` Gerd Hoffmann
2013-06-10 13:23 ` Andreas Färber
2013-06-10 13:28 ` Peter Wu
2013-06-10 13:51 ` Peter Wu [this message]
2013-06-15 15:14 ` Eric Blake
2013-06-15 15:25 ` Peter Wu
2013-06-15 15:38 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5853599.ayUtGtoVHK@al \
--to=lekensteyn@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.