Interacting with NetBSD serial console boot blocks no longer works

Bug #1743191 reported by Andreas Gustafsson on 2018-01-14
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
QEMU
Undecided
Unassigned

Bug Description

The NetBSD boot blocks display a menu allowing the user to make a
selection using the keyboard. For example, when booting a NetBSD
installation CD-ROM, the menu looks like this:

         1. Install NetBSD
         2. Install NetBSD (no ACPI)
         3. Install NetBSD (no ACPI, no SMP)
         4. Drop to boot prompt

    Choose an option; RETURN for default; SPACE to stop countdown.
    Option 1 will be chosen in 30 seconds.

When booting NetBSD in a recent qemu using an emulated serial console,
making this menu selection no longer works: when you type the selected
number, the keyboard input is ignored, and the 30-second countdown
continues. In older versions of qemu, it works.

To reproduce the problem, run:

   wget http://ftp.netbsd.org/pub/NetBSD/NetBSD-7.1.1/amd64/installation/cdrom/boot-com.iso
   qemu-system-x86_64 -nographic -cdrom boot-com.iso

During the 30-second countdown, press 4

Expected behavior: The countdown stops and you get a ">" prompt

Incorrect behavior: The countdown continues

There may also be some corruption of the terminal output; for example,
"Option 1 will be chosen in 30 seconds" may be displayed as "Option 1
will be chosen in p0 seconds".

Using bisection, I have determined that the problem appeared with qemu
commit 083fab0290f2c40d3d04f7f22eed9c8f2d5b6787, in which seabios was
updated to 1.11 prerelease, and the problem is still there as of
commit 7398166ddf7c6dbbc9cae6ac69bb2feda14b40ac. The host operating
system used for the tests was Debian 9 x86_64.

Credit for discovering this bug goes to Paul Goyette.

Ottavio Caruso (ottaviocr) wrote :

Reverting to Seabios 1.10 (version rel-1.10.3.0-gb76661dd) fixes this problem.

Steps:

$ cd && mkdir seabios-test && cd seabios-test
$ git clone -b 1.10-stable https://github.com/coreboot/seabios.git
$ cd seabios
$ make
$ qemu-system-x86_64 \
-drive if=virtio,file=/home/oc/VM/img/netbsd.image,index=0,media=disk \
-M q35,accel=kvm -m 350M -cpu host -smp $(nproc) \
-nic user,model=virtio-net-pci,ipv6=off \
-nographic -bios /home/oc/seabios-test/seabios/out/bios.bin

Result:
I can interact with NetBSD boot menu and select one of the available options.

Host:
Linux e130 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64 GNU/Linux

QEMU emulator version 4.2.0

no longer affects: seabios

Possibly related thread:
"Do we need a cpu with TSC support to run SeaBIOS?"
https://<email address hidden>/msg11726.html

Gerd Hoffmann (kraxel-redhat) wrote :

Workaround: add "-vga none" to the qemu command line.

Ottavio Caruso (ottaviocr) wrote :

@kraxel-redhat,

I guess "-vga none" is implicit when using -nographic?

However, for the sake of trying, I've added "-vga none" and it won't solve it for me (when using default bios).

Andreas Gustafsson (gson) wrote :

Gerd Hommann wrote:
> Workaround: add "-vga none" to the qemu command line.

This supposed workaround does not work for me.

Stefan Hajnoczi (stefanha) wrote :

@kraxel-redhat: This issue bisects to commit d6728f301d7e6e31ba0ee2fa51ed4a24feab8860 ("add serial console support"). seabios.git/master + "[PATCH] sercon: vbe modeset is int 10h function 4f02 not 4f00" still has the issue.

I'm using the following command-line:

  qemu-system-x86_64 -M accel=kvm -m 1G -cpu host -cdrom ~/Downloads/boot-com.iso -nographic

Gerd Hoffmann (kraxel-redhat) wrote :

Ah, it's a special serial console boot iso. I was trying the normal NetBSD-<version>-amd64.iso.

So, it seems seabios sercon and bootloader are fighting over the serial line.

seabios enables sercon for no-graphical guests ("-machine graphics=off", "-nographics" enables this too).

So one option is to turn off seabios sercon: "qemu -nographic -machine graphics=on".

The other option is to turn on seabios sercon and use the normal boot.iso (this needs the "-vga none" workaround from comment 3, or the sercon patch).

On Fri, 6 Mar 2020 at 13:24, Gerd Hoffmann <email address hidden> wrote:
> So one option is to turn off seabios sercon: "qemu -nographic -machine
> graphics=on".

This works for me, but only if I turn off "q35", therefore changing
from a sata disk to a plain ide:

qemu-system-x86_64 \
-drive if=virtio,file=/home/oc/VM/img/netbsd.image,index=0,media=disk \
-drive if=virtio,file=/home/oc/VM/img/newdisk2.img,index=1,media=disk \
-m 300M -cpu host -smp $(nproc) \
-nic user,hostfwd=tcp::6665-:22,model=virtio-net-pci,ipv6=off \
-nographic -machine accel=kvm,graphics=on

Ottavio Caruso (ottaviocr) wrote :

Just to clarify my last comment, and in absence of updates, if I launch the VM as:

qemu-system-x86_64 \
-drive if=virtio,file=/home/oc/VM/img/openbsd.image,index=0,media=disk \
-drive if=virtio,file=/home/oc/VM/img/openbsd.image.old,index=1,media=disk \
-M q35,accel=kvm,graphics=on -m 250M -cpu host -smp $(nproc) \
-nic user,hostfwd=tcp::6666-:22,model=virtio-net-pci -nographic

(note the -M q35,accel=kvm,graphics=on), the problem still persists.

I'm still on version 4.2 and I haven't updated to 5.0 yet.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers