From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37250 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7pGe-0007h6-DB for qemu-devel@nongnu.org; Thu, 07 Apr 2011 09:29:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7pGc-00061z-1m for qemu-devel@nongnu.org; Thu, 07 Apr 2011 09:29:00 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:62758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7pGb-00061l-VW for qemu-devel@nongnu.org; Thu, 07 Apr 2011 09:28:58 -0400 Received: by gxk26 with SMTP id 26so1230974gxk.4 for ; Thu, 07 Apr 2011 06:28:57 -0700 (PDT) Message-ID: <4D9DBC05.8010400@codemonkey.ws> Date: Thu, 07 Apr 2011 08:28:37 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] How does the QEMU load the binary files bios.bin and vgabios-cirrus.bin? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bei Guan Cc: QEMU Developers On 04/07/2011 03:22 AM, Bei Guan wrote: > Hi, > > I have some questions about the qemu's bios. How does the QEMU load > the binary files bios.bin and vgabios-cirrus.bin? Which function or > code file need I to pay more attention to? > > For the loading of vgabios-cirrus.bin and bios.bin, I just trace them > into the same funciton rom_add_file() in hw/loader.c. Is it the > right function, which loads the bioses? > > And then another question, how qemu give the control to bios when the > bios file is loaded? Maybe this question is not in the scope of qemu, > however, can you give me some cue point. I had some stuff written up locally so I posted it to the wiki at http://wiki.qemu.org/Documentation/Platforms/PC The x86 architecture defines the initial state of the chip to have the CS register have a base of 0xF000 and an IP of 0xFFF0. The result is that the actual memory address of the first instruction falls at the end of the BIOS ROM segment. This is the entry point to the BIOS. The VGABIOS is treated like any other option ROM and is initialized during option ROM scanning. Regards, Anthony Liguori > Any reply are appreciated. Thanks. > > Gavin > > > >