Skip to contentSkip to conversation

Standard vga breakage

Qemu-devel New malc 5 participants 12 messages Nov 15, 2009 – Nov 16, 2009

lore
Share & tools
lore

malc

author
#0 lore raw

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just shows black screen (after bios' setup screen)

Same issue was also present with cirrus vga until it was "fixed" by 91011d4f3b7c311a42b842f6682ac64a2372d2b7

I was unsuccessful in trying to bisect it.

Signature · 1 line
mailto:[email protected]
#1 lore raw
Quoted 3 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just shows black screen (after bios' setup screen)

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

author
#2 lore raw
Quoted 8 lines · Blue Swirl
Quoted 3 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just shows black screen (after bios' setup screen)

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

Yes i forgot to mention that -bios works, also worth noting is that before the commit that fixed cirrus -bios hack also made it work.

Signature · 1 line
mailto:[email protected]
#3 lore raw
Quoted 7 lines · malc
Quoted 5 lines · Blue Swirl
Quoted 3 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just shows black screen (after bios' setup screen)

Quoted 7 lines
Quoted 3 lines

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

Yes i forgot to mention that -bios works, also worth noting is that before the commit that fixed cirrus -bios hack also made it work.

What commit is this?

--
Gleb.

author
#4 lore raw
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · malc
Quoted 5 lines · Blue Swirl
Quoted 3 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just shows black screen (after bios' setup screen)

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

Yes i forgot to mention that -bios works, also worth noting is that before the commit that fixed cirrus -bios hack also made it work.

What commit is this?

It was in original posting - 91011d4f3b7c311a42b842f6682ac64a2372d2b7

Signature · 1 line
mailto:[email protected]
#5 lore raw
Quoted 9 lines · malc
Quoted 7 lines · Gleb Natapov
Quoted 6 lines · malc
Quoted 4 lines · Blue Swirl
Quoted 3 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just
shows black screen (after bios' setup screen)

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

Yes i forgot to mention that -bios works, also worth noting is that before
the commit that fixed cirrus -bios hack also made it work.

Here is a summary of my analysis of this problem:

Graphics mode memory (ram 0xe0000000 ...) is not mapped in QEMU address space (which results in unassigned memory writes) for standard pci vga (-vga std), so users don't get vga display output with grub (in graphical mode), debian installer (in graphical mode) or similar boot software.

This happens for PC system emulation using SeaBIOS. It won't happen when using Bochs BIOS.

Other system emulations which can run standard pci vga seem to suffer from the same problem: when I run mips malta using -vga std, it won't display anything on the vga screen (it works with cirrus pci vga).

Malta has no vga bios, so the error might be in QEMU's vga code (hw/vga-pci.c). Maybe wrong initial PCI mappings? Maybe this has always be wrong (which would explain why git bisect does not work).

pci_vga_init() is called by sun4u, ppc_prep, ppc_oldworld, ppc_newworld, pc and mips, so all these emulations share the same potential problem.

Bochs BIOS and PC Linux obviously fix the problem.

Regards,
Stefan

#6 lore raw
Quoted 36 lines · Stefan Weil
Quoted 9 lines · malc
Quoted 7 lines · Gleb Natapov
Quoted 6 lines · malc
Quoted 4 lines · Blue Swirl
Quoted 3 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just
shows black screen (after bios' setup screen)

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

Yes i forgot to mention that -bios works, also worth noting is that before
the commit that fixed cirrus -bios hack also made it work.

Here is a summary of my analysis of this problem:

Graphics mode memory (ram 0xe0000000 ...) is not mapped in QEMU address space (which results in unassigned memory writes) for standard pci vga (-vga std), so users don't get vga display output with grub (in graphical mode), debian installer (in graphical mode) or similar boot software.

This happens for PC system emulation using SeaBIOS. It won't happen when using Bochs BIOS.

Other system emulations which can run standard pci vga seem to suffer from the same problem: when I run mips malta using -vga std, it won't display anything on the vga screen (it works with cirrus pci vga).

Quoted 8 lines

Malta has no vga bios, so the error might be in QEMU's vga code (hw/vga-pci.c). Maybe wrong initial PCI mappings? Maybe this has always be wrong (which would explain why git bisect does not work).

pci_vga_init() is called by sun4u, ppc_prep, ppc_oldworld, ppc_newworld, pc and mips, so all these emulations share the same potential problem.

At least sun4u, ppc_oldworld and ppc_newworld are fine with -vga std. There is no VGA BIOS.

author
#7 lore raw
In reply to Stefan Weil
Quoted 2 lines · Stefan Weil
Quoted 1 line · malc

On Sun, 15 Nov 2009, Gleb Natapov wrote:

[..snip..]

Quoted 17 lines

Here is a summary of my analysis of this problem:

Graphics mode memory (ram 0xe0000000 ...) is not mapped in QEMU address space (which results in unassigned memory writes) for standard pci vga (-vga std), so users don't get vga display output with grub (in graphical mode), debian installer (in graphical mode) or similar boot software.

This happens for PC system emulation using SeaBIOS. It won't happen when using Bochs BIOS.

Other system emulations which can run standard pci vga seem to suffer from the same problem: when I run mips malta using -vga std, it won't display anything on the vga screen (it works with cirrus pci vga).

Quoted 4 lines

Malta has no vga bios, so the error might be in QEMU's vga code (hw/vga-pci.c). Maybe wrong initial PCI mappings? Maybe this has always be wrong (which would explain why git bisect does not work).

git bisect doesn't work because most of the time:

a. Compilation fails
b. Compilation succeeds but qemu segfaults before even trying to
execute any guest code

Quoted 10 lines

pci_vga_init() is called by sun4u, ppc_prep, ppc_oldworld, ppc_newworld, pc and mips, so all these emulations share the same potential problem.

Bochs BIOS and PC Linux obviously fix the problem.

Regards,
Stefan

Signature · 1 line
mailto:[email protected]
#8 lore raw
Quoted 29 lines · malc
Quoted 2 lines · Stefan Weil
Quoted 1 line · malc

On Sun, 15 Nov 2009, Gleb Natapov wrote:

[..snip..]

Quoted 17 lines

Here is a summary of my analysis of this problem:

Graphics mode memory (ram 0xe0000000 ...) is not mapped in QEMU address space (which results in unassigned memory writes) for standard pci vga (-vga std), so users don't get vga display output with grub (in graphical mode), debian installer (in graphical mode) or similar boot software.

This happens for PC system emulation using SeaBIOS. It won't happen when using Bochs BIOS.

Other system emulations which can run standard pci vga seem to suffer from the same problem: when I run mips malta using -vga std, it won't display anything on the vga screen (it works with cirrus pci vga).

Quoted 4 lines

Malta has no vga bios, so the error might be in QEMU's vga code (hw/vga-pci.c). Maybe wrong initial PCI mappings? Maybe this has always be wrong (which would explain why git bisect does not work).

Quoted 5 lines

git bisect doesn't work because most of the time:

a. Compilation fails
b. Compilation succeeds but qemu segfaults before even trying to execute any guest code

With infinite time and resources, we could construct a fully bisectable tree with the following properties:
- buggy commits (especially commits that break build or require manual reconfiguration) are replaced with corrected commits by changing the history
- no merges, linear history
- compound commits are broken down to simple, atomic versions
- documentation is added by the first commit to reduce the number of commits
- spelling fixes applied by changing history, not as a separate commit
- each commit should still have some relation to some real tree commit

#9 lore raw
In reply to malc
Quoted 33 lines · malc
Quoted 4 lines · Stefan Weil
Quoted 2 lines · malc

On Sun, 15 Nov 2009, Gleb Natapov wrote:

[..snip..]

Quoted 16 lines

Here is a summary of my analysis of this problem:

Graphics mode memory (ram 0xe0000000 ...) is not mapped in QEMU address space (which results in unassigned memory writes) for standard pci vga (-vga std), so users don't get vga display output with grub (in graphical mode), debian installer (in graphical mode) or similar boot software.

This happens for PC system emulation using SeaBIOS. It won't happen when using Bochs BIOS.

Other system emulations which can run standard pci vga seem to suffer from the same problem: when I run mips malta using -vga std, it won't display anything on the vga screen (it works with cirrus pci vga).

Quoted 5 lines

Malta has no vga bios, so the error might be in QEMU's vga code (hw/vga-pci.c). Maybe wrong initial PCI mappings? Maybe this has always be wrong (which would explain why git bisect does not work).

Quoted 6 lines

git bisect doesn't work because most of the time:

a. Compilation fails
b. Compilation succeeds but qemu segfaults before even trying to
execute any guest code

I did git bisect: even very early versions (from 2006) of std vga had the same kind of problem (no access to frame buffer at 0xe0000000) when booted with SeaBIOS). It was not really a bisection, because I never reached status "good".

#10 lore raw
In reply to Stefan Weil
Quoted 28 lines · Stefan Weil
Quoted 20 lines · malc
Quoted 17 lines · Gleb Natapov
Quoted 15 lines · malc
Quoted 12 lines · Blue Swirl
Quoted 4 lines · malc

debian-503-i386-netinst.iso when booted on a machine with `-vga std' just
shows black screen (after bios' setup screen)

Just some observations:
- if you press enter, installer starts and Linux is able to fix the display
- the screen is fine with -bios pcbios.bin, so the issue is related to SeaBIOS

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Yes i forgot to mention that -bios works, also worth noting is that before
the commit that fixed cirrus -bios hack also made it work.

Quoted 8 lines

Here is a summary of my analysis of this problem:

Graphics mode memory (ram 0xe0000000 ...) is not mapped in QEMU address space (which results in unassigned memory writes) for standard pci vga (-vga std), so users don't get vga display output with grub (in graphical mode), debian installer (in graphical mode) or similar boot software.

0xe00... is the VBE mapping. The VGABIOS assumes this mapping exists when using VBE. Cirrus doesn't support VBE so it wouldn't be exposed there.

Does the following help:

hw/vga-pci.c +6 -0
index 479ffb1..e273b8b 100644
@@ -107,6 +107,12 @@ static int pci_vga_initfn(PCIDevice *dev)
                         PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
     }
 
+#ifdef CONFIG_BOCHS_VBE
+    /* XXX: use optimized standard vga accesses */
+    cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
+                                 vga_ram_size, s->vga.vram_offset);
+#endif
+
     /* ROM BIOS */
     rom_add_vga(VGABIOS_FILENAME);
     return 0;

Regards,

Anthony Liguori

#11 lore raw

PATCH 1/1 vga-pci: Fix access to linear framebuffer

Anthony Liguori's patch fixes the problems with
vga display in graphical mode and SeaBIOS.

I only adapted some values for vga-pci.

---
 hw/vga-pci.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
hw/vga-pci.c +6 -0
index 234d581..a6ad46b 100644
@@ -107,6 +107,12 @@ static int pci_vga_initfn(PCIDevice *dev)
                          PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
      }
 
+#ifdef CONFIG_BOCHS_VBE
+    /* XXX: use optimized standard vga accesses */
+    cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
+                                 VGA_RAM_SIZE, s->vram_offset);
+#endif
+
      /* ROM BIOS */
      rom_add_vga(VGABIOS_FILENAME);
      return 0;
Signature · 1 line
1.5.6.5