qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu sources and makefile system
@ 2015-01-06  9:21 Vasile Catalin-B50542
  0 siblings, 0 replies; 7+ messages in thread
From: Vasile Catalin-B50542 @ 2015-01-06  9:21 UTC (permalink / raw)
  To: qemu-devel

Hi,

I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
To be more specific, I'm trying to add a file into <qemu src>/hw/virtio/.
I've added "common-obj-y += virtio-src.o" to the Makefile.objs in that 
folder
and when I'm compiling qemu it seems to compile the sources, but I don't 
know
if they are added to the qemu binary.
Is there anything else left to do in order for qemu build system to include
my source file?

Cata

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

* [Qemu-devel] qemu sources and makefile system
@ 2015-01-06  9:41 Catalin Vasile
  0 siblings, 0 replies; 7+ messages in thread
From: Catalin Vasile @ 2015-01-06  9:41 UTC (permalink / raw)


Hi,

I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
To be more specific, I'm trying to add a file into <qemu src>/hw/virtio/.
I've added "common-obj-y += virtio-src.o" to the Makefile.objs in that folder
and when I'm compiling qemu it seems to compile the sources, but I don't know
if they are added to the qemu binary.
Is there anything else left to do in order for qemu build system to include
my source file?

Cata 

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

* [Qemu-devel] qemu sources and makefile system
@ 2015-01-06  9:44 Catalin Vasile
  2015-01-07 13:02 ` Stefan Hajnoczi
  0 siblings, 1 reply; 7+ messages in thread
From: Catalin Vasile @ 2015-01-06  9:44 UTC (permalink / raw)
  To: qemu-devel

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

Hi,

I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
To be more specific, I'm trying to add a file into <qemu src>/hw/virtio/.
I've added "common-obj-y += virtio-src.o" to the Makefile.objs in that
folder
and when I'm compiling qemu it seems to compile the sources, but I don't
know
if they are added to the qemu binary.
Is there anything else left to do in order for qemu build system to include
my source file?

Cata

[-- Attachment #2: Type: text/html, Size: 549 bytes --]

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

* [Qemu-devel] qemu sources and makefile system
@ 2015-01-06 12:25 Vasile Catalin-B50542
  2015-01-06 19:45 ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Vasile Catalin-B50542 @ 2015-01-06 12:25 UTC (permalink / raw)
  To: qemu-devel

Hi,

I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
To be more specific, I'm trying to add a file into <qemu
src>/hw/virtio/. I've added "common-obj-y += virtio-src.o" to the
src>Makefile.objs in that folder
and when I'm compiling qemu it seems to compile the sources, but I
don't know if they are added to the qemu binary.
Is there anything else left to do in order for qemu build system to
include my source file?

Cata

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

* Re: [Qemu-devel] qemu sources and makefile system
  2015-01-06 12:25 [Qemu-devel] qemu sources and makefile system Vasile Catalin-B50542
@ 2015-01-06 19:45 ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-01-06 19:45 UTC (permalink / raw)
  To: Vasile Catalin-B50542, qemu-devel



On 06/01/2015 13:25, Vasile Catalin-B50542 wrote:
> I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
> To be more specific, I'm trying to add a file into <qemu
> src>/hw/virtio/. I've added "common-obj-y += virtio-src.o" to the
> src>Makefile.objs in that folder
> and when I'm compiling qemu it seems to compile the sources, but I
> don't know if they are added to the qemu binary.
> Is there anything else left to do in order for qemu build system to
> include my source file?

No, that should be enough.  You can use "make V=1" to see the linker
command line, or "nm" to check if your functions are found in the final
executable.

Paolo

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

* Re: [Qemu-devel] qemu sources and makefile system
  2015-01-06  9:44 Catalin Vasile
@ 2015-01-07 13:02 ` Stefan Hajnoczi
  2015-01-09  8:02   ` Vasile Catalin-B50542
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2015-01-07 13:02 UTC (permalink / raw)
  To: Catalin Vasile; +Cc: qemu-devel

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

On Tue, Jan 06, 2015 at 11:44:34AM +0200, Catalin Vasile wrote:
> I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
> To be more specific, I'm trying to add a file into <qemu src>/hw/virtio/.
> I've added "common-obj-y += virtio-src.o" to the Makefile.objs in that
> folder
> and when I'm compiling qemu it seems to compile the sources, but I don't
> know
> if they are added to the qemu binary.
> Is there anything else left to do in order for qemu build system to include
> my source file?

You could look at the link map to see which object files are included by the linker:

1. Run make V=1 to see the final gcc command-line.
2. Copy the command-line and append -Xlinker -Map=output.map
3. Now look at the output.map file

Or look at the symbol table in the binary:

$ readelf -s x86_64-softmmu/qemu-system-x86_64 | grep virtio-
   740: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-blk.c
   791: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-blk.c
   799: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-serial-bus.c
  1158: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-net.c
  1262: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-scsi.c
  1329: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-scsi-dataplane.c
  1554: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-balloon.c
  4884: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-console.c
  9308: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-rng.c
  9333: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-pci.c
  9453: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-bus.c
  9476: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-mmio.c

If you need help, please post a git URL so we can see your code.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Qemu-devel] qemu sources and makefile system
  2015-01-07 13:02 ` Stefan Hajnoczi
@ 2015-01-09  8:02   ` Vasile Catalin-B50542
  0 siblings, 0 replies; 7+ messages in thread
From: Vasile Catalin-B50542 @ 2015-01-09  8:02 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Catalin Vasile

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

Thanks. It will be helpful in the future.
I managed to make it work. The code was included, but I forgot to 
register the device type on the virtio-pci bus.

static void virtio_pci_register_types(void)
{
     /* ... */
     type_register_static(&virtio_src_pci_info);
     /* ... */
}

On 07.01.2015 15:02, Stefan Hajnoczi wrote:
> On Tue, Jan 06, 2015 at 11:44:34AM +0200, Catalin Vasile wrote:
>> I'm new to qemu-devel and I'm trying to add a ".c" source to qemu.
>> To be more specific, I'm trying to add a file into <qemu src>/hw/virtio/.
>> I've added "common-obj-y += virtio-src.o" to the Makefile.objs in that
>> folder
>> and when I'm compiling qemu it seems to compile the sources, but I don't
>> know
>> if they are added to the qemu binary.
>> Is there anything else left to do in order for qemu build system to include
>> my source file?
> You could look at the link map to see which object files are included by the linker:
>
> 1. Run make V=1 to see the final gcc command-line.
> 2. Copy the command-line and append -Xlinker -Map=output.map
> 3. Now look at the output.map file
>
> Or look at the symbol table in the binary:
>
> $ readelf -s x86_64-softmmu/qemu-system-x86_64 | grep virtio-
>     740: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-blk.c
>     791: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-blk.c
>     799: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-serial-bus.c
>    1158: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-net.c
>    1262: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-scsi.c
>    1329: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-scsi-dataplane.c
>    1554: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-balloon.c
>    4884: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-console.c
>    9308: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-rng.c
>    9333: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-pci.c
>    9453: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-bus.c
>    9476: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS virtio-mmio.c
>
> If you need help, please post a git URL so we can see your code.
>
> Stefan

-- 

CatalinVasile

Intern, DN-Software

FreescaleSemiconductor, Inc.

www.freescale.com

phone: 073-021-1938

e-mail: catalin.vasile@freescale.com <mailto:your.name@freescale.com>

*Freescale_Logo-nosemi_Lh_4c***

This e-mail, and any associated attachments have been classified as:

[ ] Public

[ ] Freescale Semiconductor Internal Use Only

[ ] Freescale Semiconductor Confidential Proprietary


[-- Attachment #2.1: Type: text/html, Size: 30804 bytes --]

[-- Attachment #2.2: image002.gif --]
[-- Type: image/gif, Size: 1979 bytes --]

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

end of thread, other threads:[~2015-01-09  8:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-06 12:25 [Qemu-devel] qemu sources and makefile system Vasile Catalin-B50542
2015-01-06 19:45 ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2015-01-06  9:44 Catalin Vasile
2015-01-07 13:02 ` Stefan Hajnoczi
2015-01-09  8:02   ` Vasile Catalin-B50542
2015-01-06  9:41 Catalin Vasile
2015-01-06  9:21 Vasile Catalin-B50542

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).