vgabios + qemu: issues and plans.
Hi,
Today we have two vgabios versions in qemu: The standard one (vgabios.bin) and the cirrus one (vgabios-cirrus.bin).
The cirrus vgabios is a PCI ROM. We can (and do) load it into the ROM PCI bar. The vgabios checks the pci config space to figure where the linear framebuffer (for vesa graphics) is mapped to. It knows how to program the cirrus.
The standard bios isn't a PCI ROM. We have to load it using the seabios firmware interface. It expects to find the linear framebuffer at the magic address 0xe0000000. It uses the bochs extentions to implement vesa graphics support.
So, what is wrong with this?
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
Second, I want to get rid of the magic address 0xe0000000 (except for isa-vga). This is basically just a matter of updating to vgabios version 0.6c. And this needs one vga bios binary per vga card too as the PCI ID is used to lookup the card (and then the framebuffer address) in PCI config space.
Comments? Especially on the binary patching? Worth it? Or just build a bunch of binaries? They are not *that* big after all ...
cheers,
Gerd
Quoted 11 lines · Gerd Hoffmann
Hi,
Today we have two vgabios versions in qemu: The standard one (vgabios.bin) and the cirrus one (vgabios-cirrus.bin).
The cirrus vgabios is a PCI ROM. We can (and do) load it into the ROM PCI bar. The vgabios checks the pci config space to figure where the linear framebuffer (for vesa graphics) is mapped to. It knows how to program the cirrus.
The standard bios isn't a PCI ROM. We have to load it using the seabios firmware interface. It expects to find the linear framebuffer at the magic address
0xe0000000. It uses the bochs extentions to implement vesa graphics support.So, what is wrong with this?
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
vgabios could be build multiple times with PCIBIOS set and VENDOR_ID and DEVICE_ID supplied from the Makefile like it's already done with VGABIOS_DATE.
Quoted 3 lines
Second, I want to get rid of the magic address
0xe0000000(except for isa-vga). This is basically just a matter of updating to vgabios version 0.6c. And this needs one vga bios binary per vga card too as the PCI ID is used to lookup the card (and then the framebuffer address) in PCI config space.Comments? Especially on the binary patching? Worth it? Or just build a bunch of binaries? They are not *that* big after all ...
Few more bios binaries should do no harm. This is currently used for eepro100 (gpxe-eepro100-80861209.rom and gpxe-eepro100-80861229.rom). So maybe define a similar naming convention for the vgabios.
Sebastian
Quoted 5 lines
cheers,
Gerd
Hi,
Quoted 10 lines
Quoted 6 lines
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
vgabios could be build multiple times with PCIBIOS set and
VENDOR_IDandDEVICE_IDsupplied from theMakefilelike it's already done withVGABIOS_DATE.
Yes, something like this I have in mind.
Works for stdvga and qxl. vmware fails as it has the memory at pci region 1 (region 0 has ioports) and it seems vgabios isn't prepared to handle that ...
Anyone knows what the best place to send patches to is? vgabios-developers list @ savannah looks pretty much dead. It has one (!) message in 2009 which is an unanswered question.
Or is upstream dead anyway and we should just go with http://git.qemu.org/vgabios.git/ ?
cheers,
Gerd
Quoted 15 lines · Gerd Hoffmann
Hi,
Today we have two vgabios versions in qemu: The standard one (vgabios.bin) and the cirrus one (vgabios-cirrus.bin).
The cirrus vgabios is a PCI ROM. We can (and do) load it into the ROM PCI bar. The vgabios checks the pci config space to figure where the linear framebuffer (for vesa graphics) is mapped to. It knows how to program the cirrus.
The standard bios isn't a PCI ROM. We have to load it using the seabios firmware interface. It expects to find the linear framebuffer at the magic address
0xe0000000. It uses the bochs extentions to implement vesa graphics support.
Quoted 8 lines
So, what is wrong with this?
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
Make vga bios aware of all ids?
Then single vga bios image can handle all vga devices. If new device is introduced (qxl), new id will be added to id table I thing that adding a new vga device is rare.
Or do you want to more generic/dynamic solution?
Quoted 5 lines
Second, I want to get rid of the magic address
0xe0000000(except for isa-vga). This is basically just a matter of updating to vgabios version 0.6c. And this needs one vga bios binary per vga card too as the PCI ID is used to lookup the card (and then the framebuffer address) in PCI config space.
I also want to eliminate the magic number.
Boch vga bios is paravirtualized to get VBE address dynamically via a new pci device with special pci device of device id 0x1234.
Are you meaning to follow bochs way?
Or how about to use qemu fw interface to get the address dynamically?
Quoted 8 lines
Comments? Especially on the binary patching? Worth it? Or just build a bunch of binaries? They are not *that* big after all ...
cheers,
Gerd
Signature · 1 line
yamahata
Quoted 8 lines
Quoted 6 lines
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
Make vga bios aware of all ids?
Would work for the code doing the lfb address lookup. But I don't think the PCI option rom header allows multiple entries.
Quoted 3 lines
I also want to eliminate the magic number.
Boch vga bios is paravirtualized to get VBE address dynamically via a new pci device with special pci device of device id0x1234.
0x1234 happens to be the vendor id the qemu stdvga has. Probably the same is true for bochs. So this code actually looks up the emulated vga card ;)
Quoted 1 line
Are you meaning to follow bochs way?
Yes.
cheers,
Gerd
Quoted 9 lines · Gerd Hoffmann
Hi,
Quoted 7 lines
Quoted 6 lines
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
Quoted 7 lines
Quoted 3 lines
vgabios could be build multiple times with PCIBIOS set and
VENDOR_IDandDEVICE_IDsupplied from theMakefilelike it's already done withVGABIOS_DATE.Yes, something like this I have in mind.
Works for stdvga and qxl. vmware fails as it has the memory at pci region 1 (region 0 has ioports) and it seems vgabios isn't prepared to handle that ...
Do you mean vgabios currently doesn't work with qemu and "-vga vmware" ?
Quoted 5 lines
Anyone knows what the best place to send patches to is? vgabios-developers list @ savannah looks pretty much dead. It has one (!) message in 2009 which is an unanswered question.
Or is upstream dead anyway and we should just go with http://git.qemu.org/vgabios.git/ ?
From the "amount" of messages on the mailing list i conclude vgabios
just works good enough for most people. I would not say the developement is dead, but event driven and there is no itch to strach at the moment.
Try sending patches to the mailing list and/or the vgabios home at
http://savannah.nongnu.org/projects/vgabios .
Sebastian
Quoted 2 lines
cheers,
Gerd
Quoted 10 lines · Gerd Hoffmann
Quoted 8 lines
Quoted 6 lines
First, I'd like to be able to load the vgabios via PCI ROM bar on all pci vga cards (stdvga, vmware, soon qxl). The PCI ID in the bios has to match the PCI ID of the card, so we'll need a bunch of vga bios binaries, all identical except for the PCI ID. Or we need some kind of binary patching. Otherwise seabios will not load them from the PCI ROM bar.
Make vga bios aware of all ids?
Would work for the code doing the lfb address lookup. But I don't think the PCI option rom header allows multiple entries.
AFAIK it does not, but you can put multiple PCI option roms (concatenated) on the BAR (see "6.3.1. PCI Expansion ROM Contents").
Quoted 5 lines
Quoted 3 lines
I also want to eliminate the magic number.
Boch vga bios is paravirtualized to get VBE address dynamically via a new pci device with special pci device of device id0x1234.
0x1234happens to be the vendor id the qemu stdvga has. Probably the same is true for bochs. So this code actually looks up the emulated vga card ;)
Bochs and qemu use 0x1234:0x1111.
Sebastian
Quoted 10 lines
Quoted 1 line
Are you meaning to follow bochs way?
Yes.
cheers,
Gerd
Hi,
Quoted 5 lines
Quoted 3 lines
Works for stdvga and qxl. vmware fails as it has the memory at pci region 1 (region 0 has ioports) and it seems vgabios isn't prepared to handle that ...
Do you mean vgabios currently doesn't work with qemu and "-vga vmware" ?
It works, but uses the bochs lfb at the magic address 0xe0000000.
Killing the 0xe000000 alias mapping and switching over to use the pci region instead requires some changes in pci_get_lfb_addr to handle the situation.
Quoted 2 lines
Try sending patches to the mailing list and/or the vgabios home at
http://savannah.nongnu.org/projects/vgabios .
Ok, I'll try to send my patch series down that route.
thanks,
Gerd
Quoted 11 lines · Gerd Hoffmann
Hi,
Quoted 5 lines
Quoted 3 lines
Works for stdvga and qxl. vmware fails as it has the memory at pci region 1 (region 0 has ioports) and it seems vgabios isn't prepared to handle that ...
Do you mean vgabios currently doesn't work with qemu and "-vga vmware" ?
It works, but uses the bochs lfb at the magic address
0xe0000000.Killing the
0xe000000alias mapping and switching over to use the pci region instead requires some changes inpci_get_lfb_addrto handle the situation.
Does this only happen with VBE?
Sebastian
Quoted 9 lines · Sebastian Herbszt
Quoted 8 lines · Gerd Hoffmann
Hi,
Quoted 5 lines
Quoted 3 lines
Works for stdvga and qxl. vmware fails as it has the memory at pci region 1 (region 0 has ioports) and it seems vgabios isn't prepared to handle that ...
Do you mean vgabios currently doesn't work with qemu and "-vga vmware" ?
Quoted 7 lines
Quoted 5 lines
It works, but uses the bochs lfb at the magic address
0xe0000000.Killing the
0xe000000alias mapping and switching over to use the pci region instead requires some changes inpci_get_lfb_addrto handle the situation.Does this only happen with VBE?
Yes.
cheers,
Gerd