Received: from eggs.gnu.org ([2001:4830:134:3::10]:57784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkXZI-0000Qb-No for qemu-devel@nongnu.org; Wed, 14 May 2014 07:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkXZD-0005ql-7o for qemu-devel@nongnu.org; Wed, 14 May 2014 07:41:52 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:45092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkXZC-0005oP-NC for qemu-devel@nongnu.org; Wed, 14 May 2014 07:41:47 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5K00J8YB5J9HD0@mailout3.samsung.com> for qemu-devel@nongnu.org; Wed, 14 May 2014 20:41:43 +0900 (KST) From: Jaeyong Yoo References: <98.08.11443.AD612735@epcpsbgx3.samsung.com> <5372241E.8090309@redhat.com> <007f01cf6f29$1eebdcf0$5cc396d0$%yoo@samsung.com> <53734BA7.3060008@redhat.com> In-reply-to: <53734BA7.3060008@redhat.com> Date: Wed, 14 May 2014 20:41:46 +0900 Message-id: <00f601cf6f69$7c131bb0$74395310$%yoo@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable Content-language: ko Subject: Re: [Qemu-devel] Where is vga-rom mapped in guest system memory? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Laszlo Ersek' , qemu-devel@nongnu.org > -----Original Message----- > From: qemu-devel-bounces+jaeyong.yoo=3Dsamsung.com@nongnu.org = [mailto:qemu- > devel-bounces+jaeyong.yoo=3Dsamsung.com@nongnu.org] On Behalf Of = Laszlo > Ersek > Sent: Wednesday, May 14, 2014 7:56 PM > To: Jaeyong Yoo; qemu-devel@nongnu.org > Subject: Re: [Qemu-devel] Where is vga-rom mapped in guest system = memory? >=20 > On 05/14/14 06:01, Jaeyong Yoo wrote: > >> -----Original Message----- > >> From: qemu-devel-bounces+jaeyong.yoo=3Dsamsung.com@nongnu.org > >> [mailto:qemu- > >> devel-bounces+jaeyong.yoo=3Dsamsung.com@nongnu.org] On Behalf Of = Laszlo > >> Ersek > >> Sent: Tuesday, May 13, 2014 10:55 PM > >> To: jaeyong.yoo@samsung.com; qemu-devel@nongnu.org > >> Subject: Re: [Qemu-devel] Where is vga-rom mapped in guest system > memory? > >> > >> On 05/13/14 14:58, Jaeyong Yoo wrote: > >>> Hello qemu! > >>> > >>> > >>> > >>> I am currently writing a vga device emulator and need to debug = vga- > bios. > >>> > >>> What I want is to set break-point on the entry of vga-bios and for > >>> this, > >>> > >>> I'm reading qemu source around pci device and rom-related memory > >>> regions > >>> > >>> to find out where should I set break point. And, sadly, got stuck. > >>> > >>> > >>> > >>> Could you give me any advice about the memory-mapped address of > >>> vga-rom or > >>> > >>> any pointers? > >> > >> Some. > >> > >> The vgabios binary is loaded from the file identified by the = "romfile" > >> property of the VGA card that you select. For example, > >> > >> -device qxl-vga,romfile=3D... > >> > >> or > >> > >> -vga qxl \ > >> -global qxl-vga.romfile=3D... > >> > >> Of course the property has a default value for each VGA card. See = the > >> > >> k->romfile =3D ... > >> > >> assignments in: > >> - cirrus_vga_class_init() -- vgabios-cirrus.bin > >> - qxl_primary_class_init() -- vgabios-qxl.bin > >> - vga_class_init() -- vgabios-stdvga.bin > >> > >> I think the oprom is loaded in > >> > >> pci_qdev_init() [hw/pci/pci.c] > >> pci_add_option_rom() > >> > >> The vgabios oprom is shadowed from ROM (pci address space) to RAM = by > >> the SeaBIOS initialization code, and then POSTed: > >> > >> handle_post() [src/post.c] > >> make_bios_writable() [src/fw/shadow.c] > >> make_bios_writable_intel() > >> __make_bios_writable_intel() -- shadows vgabios in C segment = too > >> dopost() [src/post.c] > >> maininit() > >> vgarom_setup() [src/optionroms.c] > >> init_pcirom() > >> init_optionrom() > >> callrom() > >> __callrom() > >> _rom_header_entry [vgasrc/vgaentry.S] > >> vga_post() [vgasrc/vgainit.c] > >> > >> You can instrument vga_post() in the SeaBIOS source > >> [vgasrc/vgainit.c], rebuild the vgabios binary, and load this = binary > >> with the video card's romfile=3D... property on the qemu command = line. > > > > Thanks for the answer. It is the exact code-path that I was looking > > for :-) > > > > I have one follow-up question. > > It looks like seabios (bios.bin) includes the vgabios (such as > > vga_post functions). And this bios.bin is not loaded as > > vgabios-stdvga.bin (the one that you mentioned in vga_class_init). = I'm > > not clearly understanding the difference between vgabios inside = bios.bin > and vgabios-stdvga.bin. > > Could you tell me the difference? >=20 > bios.bin and vgabios.bin are separate build outputs of SeaBIOS. If you = run > "make menuconfig" in the seabios directory and browse the options, it > should become clearer. (The build system should be discussed on the > seabios list, the maintainers can help you more than I can.) >=20 > I recommend to study the following SRPM: >=20 > https://www.kraxel.org/repos/jenkins/seabios/seabios.git-1.7.4- > 93.b113.g6ad7b5b.src.rpm >=20 > the SPEC file should help (see the do_build() function and the various > build config files). Thanks for the answer, Laszlo. I built the seabios in qemu and try to see the debug message of seabios. So, I checked the "Serial port debugging" option in Debugging section = with the=20 serial port base address 0x3f8. (Is this the correct value?) And, launch qemu with option "-serial stdio" but I don=E2=80=99t see any = messages from seabios. If I want to see the debug message of seabios to the output = console, what am I missing? My full command for launching qemu is the following: $ sudo x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 1024 -vga vmware = -serial stdio ~/data/qemu-images/ubuntu-13.04-desktop.img Thanks, Jaeyong