Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DzCWT-0000tY-4N for qemu-devel@nongnu.org; Sun, 31 Jul 2005 08:02:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DzCWM-0000qG-IE for qemu-devel@nongnu.org; Sun, 31 Jul 2005 08:02:22 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DzCWM-0000eY-8c for qemu-devel@nongnu.org; Sun, 31 Jul 2005 08:02:22 -0400 Received: from [195.3.96.102] (helo=email.aon.at) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DzCYz-0000F9-7H for qemu-devel@nongnu.org; Sun, 31 Jul 2005 08:05:05 -0400 Received: from m956p021.adsl.highway.telekom.at (HELO s37.loc) ([62.47.151.117]) (envelope-sender ) by smarthub71.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 31 Jul 2005 11:52:45 -0000 Received: from cow by s37.loc with local (Exim 4.52) id 1DzCNc-0004qi-4s for qemu-devel@nongnu.org; Sun, 31 Jul 2005 13:53:20 +0200 Date: Sun, 31 Jul 2005 13:53:20 +0200 From: Bernhard Fischer Message-ID: <20050731115320.GI15261@aon.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3Pql8miugIZX0722" Content-Disposition: inline Subject: [Qemu-devel] [RFC] check VGA BIOS size Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --3Pql8miugIZX0722 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --3Pql8miugIZX0722 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu.hw_pc.c-check-vga-bios-size.diff" 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); --3Pql8miugIZX0722--