Skip to contentSkip to conversation

2nd serial port by default

RFC In review Hervé Poussineau 3 participants 3 messages Dec 7, 2008 – Dec 12, 2008

lore
Share & tools
lore
#0 lore raw

RFC 1/1 2nd serial port by default

Hi,

Most computers have 0 or 2 serial ports, but Qemu only allocates one by default. Attached patch defines 2 serial ports by default, instead of one. Previous behaviour can be done with "-serial vc:80Cx24C -serial none" argument.

Please comment

Hervé

vl.c +2 -1
Index: vl.c
===================================================================
@@ -4545,7 +4545,8 @@
     monitor_device = "vc";
 
     serial_devices[0] = "vc:80Cx24C";
-    for(i = 1; i < MAX_SERIAL_PORTS; i++)
+    serial_devices[1] = "vc:80Cx24C";
+    for(i = 2; i < MAX_SERIAL_PORTS; i++)
         serial_devices[i] = NULL;
     serial_device_index = 0;
 
#1 lore raw
Quoted 9 lines · Hervé Poussineau

Hi,

Most computers have 0 or 2 serial ports, but Qemu only allocates one by default.
Attached patch defines 2 serial ports by default, instead of one. Previous behaviour can be done with "-serial vc:80Cx24C -serial none" argument.

Please comment

I'm not sure where you're getting "most" from, or your justification for this change.

A quick survey here indicates that most workstation/server class hardware has a single accessible serial port, and embedded boards commonly have 3 or 4.

In practice I'd expect that by far the most common use for serial ports is a serial console, and one is more than sufficient for that. If you want to do anything else then you're probably going to need special -serial options anyway.

Paul

#2 lore raw
Quoted 4 lines · Paul Brook

In practice I'd expect that by far the most common use for serial ports is a serial console, and one is more than sufficient for that. If you want to do anything else then you're probably going to need special -serial options anyway.

The issue here is that the MIPS Magnum has two serial ports, and its firmware checks that both serial ports are functioning and complains if either of them is not. If the user only needs a single serial port, then they currently have to pass '-serial null' for the second port.

IMO, the default number of ports that are emulated should depend on the machine that is being emulated.

Cheers,

Signature · 1 line
Stuart Brady