#740464 qemu-kvm: support for seabios option "screen-and-debug"

#740464#5
Date:
2014-03-01 22:27:35 UTC
From:
To:
I am using seabios with sgabios in kvm (in order to get early BIOS messages
on serial), and during the bootloader stage I am seeing all characters
printed twice. I found this page

http://www.coreboot.org/SeaBIOS#Adding_sgabios_support

which explains the problem and that you can fix it by disabling the
"screen-and-debug" config option. It also references this list of other
config options

http://www.coreboot.org/SeaBIOS#Other_Configuration_items

Looking at the qemu-kvm source, I see that in hw/nvram/fw_cfg.c and
qemu-options.hx there is support for changing a few of these, things like
show-boot-menu, boot-menu-wait, splashfile.

Could you please add support for enabling the "screen-and-debug" option?

Also interesting from that list might be
  boot-menu-message
  boot-menu-key
  boot-fail-wait

i(the others are either obscure or I don't know what they are for, so I
don't know if they would be useful).

Thanks,

#740464#10
Date:
2014-03-02 00:59:41 UTC
From:
To:
Here is some more info on the double character printing problem in #740464

1) seabios default
In the Debian seabios source (version 1.7.4-4), if you look at line 437 of
src/optionroms.c

  ScreenAndDebug = romfile_loadint("etc/screen-and-debug", 1);

it's defaulting to having the debug printing enabled.
Upstream of the same file (but line 435) is the same,

http://review.coreboot.org/gitweb?p=seabios.git;a=blob;f=src/optionroms.c;h=
93d9d2fe6507482b3ba0b6782a13887fb8a0fdf7;hb=HEAD#l435

2) Fedora
I heard a report that using sgabios on Fedora/RHEL does not have this
double priinting problem. I wasn't able to easily determine if they have
patches to change this behavior

The Fedora qemu source doesn't appear change anything related

http://pkgs.fedoraproject.org/cgit/qemu.git

The Fedora seabios doesn't appear to change anything related

http://pkgs.fedoraproject.org/cgit/seabios.git

It's possible they are doing something like setting a debug level
differently that results in differences, or I missed something, or they are
changing it elsewhere. First step would be testing to confirm they don't
have the problem.

3) I don't know if this is relevant, but in the upstream sgabios design
document, line 240

http://code.google.com/p/sgabios/source/browse/trunk/design.txt#240

it says

  "When lilo 22.6 is detected, SGABIOS now knows how to disable
  lilo's serial output in favor of its own. This avoids having
  double character output from both serial and VGABIOS interleaved."

I am seeing the problem with pxelinux 4.06.

4) Potential solutions
I don't know what the purpose of screen-and-debug is, it might be that
it could be disabled with no ill effects. So here are some potential
solutions

* Change seabios screen-and-debug default to 0 in the seabios package
* Have the seabios package produce an alternate bios.rom with
   screen-and-debug disabled, then kvm could use it with "-bios"
* Add a -boot suboption for screen-and-debug to kvm and have it default
   to enabled
* Add a -boot suboption for screen-and-debug to kvm and have it default
   to disabled
* Add hacks to sgabios to have it detect and work around bootloaders
   that have the problem.
* Come up with a more generic sgabios fix.
* Something else

Feel free to reassign this bug to seabios, sgabios, etc or forward
elsewhere depending on what makes sense.

Thanks,

#740464#15
Date:
2014-03-02 05:58:22 UTC
From:
To:
I'm forwarding this to upstream, such enhancements, in my opinion,
should not be done inside a single distribution, and since I don't
use (and don't even know how to use) the mentioned features I can't
further comment on this, and don't really want to become a broken
phone.

Thank you for the good analisys (in initial email and in a folllowup
at http://bugs.debian.org/740464 ).

BTW, this is not qemu-kvm, this is qemu.  Qemu-kvm has been merged
into qemu since version 1.3.

Thanks,

/mjt

Package: qemu-kvm
Version: 1.7.0+dfsg-3
Severity: wishlist

I am using seabios with sgabios in kvm (in order to get early BIOS messages
on serial), and during the bootloader stage I am seeing all characters
printed twice. I found this page

http://www.coreboot.org/SeaBIOS#Adding_sgabios_support

which explains the problem and that you can fix it by disabling the
"screen-and-debug" config option. It also references this list of other
config options

http://www.coreboot.org/SeaBIOS#Other_Configuration_items

Looking at the qemu-kvm source, I see that in hw/nvram/fw_cfg.c and
qemu-options.hx there is support for changing a few of these, things like
show-boot-menu, boot-menu-wait, splashfile.

Could you please add support for enabling the "screen-and-debug" option?

Also interesting from that list might be
  boot-menu-message
  boot-menu-key
  boot-fail-wait

i(the others are either obscure or I don't know what they are for, so I
don't know if they would be useful).

Thanks,