[SeaBIOS] [PATCH] Support more than one vga card

Glauber Costa glommer at redhat.com
Wed May 4 18:10:15 CEST 2011

On Wed, 2011-05-04 at 10:04 +0200, Gerd Hoffmann wrote:
> On 05/03/11 23:44, Anthony Liguori wrote:
> > On 05/03/2011 03:23 PM, Sebastian Herbszt wrote:
> >> Glauber Costa wrote:
> >>> It is theorectically possible for a system to have more than
> >>> one pci vga card. In particular, I am interested in the use of SGAbios
> >>> as a pci device, alongside of a normal vga bios in QEMU.
> You are talking about https://code.google.com/p/sgabios/?
> /me wonders what pci device you are talking about?
A dummy one, to represent it as a device in QEMU. As I stated before, I
do know it is not strictly necessary. But after discussions in qemu
mailing list, there was belief this could be the best way to model it,
so whenever you want the functionality, you plug it in.

> This looks to be most useful for a headless system, i.e.
> 'qemu -nographic -vga none -optionrom sgabios.bin', then get the bios 
> output (seaboot menu, pxe rom output, ...) on the serial line.
unfortunately this does not work, because -optionrom puts everything
under genroms. We need this at vgaroms/. The alternative to this, would
be to simply patch qemu to do that (which I did already).

> Note that seabios has serial line support already, although for debug 
> purposes.  Might be easy to extend that without too much trouble to a 
> full-blown serial console support, which would have the advantage that 
> seabios could show stuff on both serial line and vga.

I don't fully dislike this idea. Honestly, I kind of like it. Most of
the work would be to add keyboard support for it. Just showing stuff in
the serial console even when not debugging is quite easy.

> >> Can't SGAbios be loaded as an option rom without this change?
> >
> > But then you're loading it as a legacy ROM which is fairly ugly and
> > requires additional SeaBIOS hackery.
> I fail to see why this requires seabios hackery.  And legacy rom is the 
> only way when using a isa-serial line.

it requires hackery somewhere. Be it qemu, seabios, etc. Question is
where is the best place to achieve that.

> We could add a pci-serial emulation[1] and load sgabios using the pci 
> rom bar of that device.

It would be basically the same of using -optiorom. With the same
drawback: There are things the bios do between loading vga option roms
and the other roms. And if sgabios is not loaded with the first team,
this intermediate steps are lost.

> > But supporting multiple VGA cards is something we want anyway since I
> > think Spice uses this to have multiple heads. Gerd?
> The secondary qxl devices are a bit different.  They are not vga 
> compatible.  They register as generic display class device.  They have 
> no vga bios.  You need qxl guest drivers to drive them.

As a curiosity, do you then need a normal vga device to see boot
messages? How does it work before you load the drivers?

> cheers,
>    Gerd
> [1] something like this ...
> xeni kraxel ~/mockify# lspci -vs3.3
> 00:03.3 Serial controller: Intel Corporation 82G33/G31/P35/P31 Express 
> Serial KT Controller (rev 02) (prog-if 02 [16550])
>          Subsystem: Intel Corporation 82G33/G31/P35/P31 Express Serial 
> KT Controller
>          Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 17
>          I/O ports at e000 [size=8]
>          Memory at ffa79000 (32-bit, non-prefetchable) [size=4K]
>          Capabilities: <access denied>
>          Kernel driver in use: serial
> xeni kraxel ~/mockify# grep 03.3 /var/log/dmesg
> pci 0000:00:03.3: reg 10 io port: [0xe000-0xe007]
> pci 0000:00:03.3: reg 14 32bit mmio: [0xffa79000-0xffa79fff]
> serial 0000:00:03.3: PCI INT B -> GSI 17 (level, low) -> IRQ 17
> 0000:00:03.3: ttyS2 at I/O 0xe000 (irq = 17) is a 16550A
> ... should be doable with a just bit of pci plumbing for the existing 
> serial emulation code.

More information about the SeaBIOS mailing list