[Top][All Lists]

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

Re: serial console, no graphic card

From: Peter Maydell
Subject: Re: serial console, no graphic card
Date: Mon, 16 Dec 2019 16:39:47 +0000

On Mon, 16 Dec 2019 at 16:24, Pierre Dupond <address@hidden> wrote:
> Thanks this seems to be the solution. But A problem remains, what is the 
> speed of
> the serial interface in the guest?

Except in the special case where you tell QEMU to map a
guest serial port directly through to a physical host serial
port, it doesn't matter, because QEMU doesn't emulate
serial ports at a level of detail where stuff like baud
rates matters. (We don't speed up or slow down sending
and receiving of data to match whatever baud rate the
guest programmed the UART at.)

In real hardware, the guest programs the UART to specify
a baud rate and so on, and whatever serial terminal you
connect to it either (a) is configurable for baud rate or
(b) has a fixed rate, if it's something like a real
hardware serial terminal. So the baud rate is set in two
places, at each end of the connection, and it has to match.

In QEMU, almost none of the 'chardevs' that you can connect
as the backend of an emulated guest UART care about speed.
('chardevs' here are things like "connect this to the
host stdin/stdout", "connect this to a host TCP/IP port",
or "connect this to the host's actual serial port", which
you can specify with variants of the -serial command line
option). So you don't need to specify the speed at that end
and there is no way to. On the guest end, the guest may still
expect you to specify a baud rate, but it doesn't really
matter much what you pick, as long as it's one that's
permitted by the emulated UART (otherwise the guest won't
be able to program it in at all). If in doubt, 115200/8/N/1
is a choice that should work for most kinds of UART.

(As an aside, handling the "pass the baud rate etc through
if you're doing passthrough to a real host serial port"
requires extra code to do this in the emulated UART,
and many of our UART models don't have this code.)

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]