qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] check VGA BIOS size
@ 2005-07-31 11:53 Bernhard Fischer
  2005-08-27 12:38 ` Bernhard Fischer
  0 siblings, 1 reply; 2+ messages in thread
From: Bernhard Fischer @ 2005-07-31 11:53 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Hi,

What do you think about checking if a VGA bios was found (and if so, if
it has a valid size)?

Reasoning is that on pristine machines (i.e. without a VGA bios ROM
available) starting qemu fails without giving any helpful error message.

I'm attaching a simple patch which adds such a check.

Comments?

Thank you,
Bernhard

[-- Attachment #2: qemu.hw_pc.c-check-vga-bios-size.diff --]
[-- Type: text/plain, Size: 983 bytes --]

diff -X excl -rduNp qemu.oorig/hw/pc.c qemu/hw/pc.c
--- qemu.oorig/hw/pc.c	2005-07-28 17:54:38.000000000 +0200
+++ qemu/hw/pc.c	2005-07-31 13:38:23.000000000 +0200
@@ -414,7 +414,7 @@ static void pc_init1(int ram_size, int v
     char buf[1024];
     int ret, linux_boot, initrd_size, i, nb_nics1;
     unsigned long bios_offset, vga_bios_offset;
-    int bios_size, isa_bios_size;
+    int bios_size, isa_bios_size, vga_bios_size;
     PCIBus *pci_bus;
 
     linux_boot = (kernel_filename != NULL);
@@ -446,8 +446,12 @@ static void pc_init1(int ram_size, int v
     } else {
         snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME);
     }
+    vga_bios_size = get_image_size(buf);
+    if (vga_bios_size != 32768)
+	    goto bios_error;
+
     ret = load_image(buf, phys_ram_base + vga_bios_offset);
-    
+
     /* setup basic memory access */
     cpu_register_physical_memory(0xc0000, 0x10000, 
                                  vga_bios_offset | IO_MEM_ROM);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-27 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-31 11:53 [Qemu-devel] [RFC] check VGA BIOS size Bernhard Fischer
2005-08-27 12:38 ` Bernhard Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).