qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Questions regarding how QEMU initializes virtual periph


From: Ramy Sameh
Subject: Re: [Qemu-devel] Questions regarding how QEMU initializes virtual peripherals
Date: Fri, 9 Feb 2018 14:56:14 +0200

Many thanks Igor for this valuable info.

On Thu, Feb 8, 2018 at 12:59 PM, Igor Mammedov <address@hidden> wrote:

> On Thu, 8 Feb 2018 12:06:44 +0200
> Ramy Sameh <address@hidden> wrote:
>
> > Hello all,
> >
> > I am working with QEMU to simulate VersatilePB board.
> >
> > I am trying to understand how QEMU initialize the virtual peripherals
> (e.g.
> > UART, vectored Interrupt controller .. etc).
> >
> > When I traced the code, I found a function called "object_init_with_type"
> > in object.c, in which the function pointer "ti->instance_init(obj)" seems
> > to call the peripherals initialization functions.
> >
> > *I have couple of questions here:*
> > 1.) Some peripheral initialization functions are called multiple times
> such
> > as pl011_init, why is that ?
> function is called once for each instance of pl011 object.
>
> QEMU uses custom OOM framework (dubbed QOM), good point to start with it
> is probably to read doc comment in the beginning of include/qom/object.h
>
> Device objects are typically inherited from TYPE_DEVICE or its derivatives.
> Device init sequence typically looks like:
>    foo = object_new(TYPE_FOO);
>    // set_properties on foo, see object_property_set_...
>
>    // and set special property 'realize' which would call 'realize' method
>    object_property_set_bool(foo, true, "realized");
>
> See qdev_device_add() for details
>
> > 2.) Where is the entry point for the whole initialization functionalities
> > (that will eventually call "object_init_with_type")
>
> object_new() & co + object_initialize_with_type()
>
> > Thank you.
> >
>
>


-- 
Best Regards,
Ramy Sameh
Embedded Software Engineer
+2-010-172-777-14


reply via email to

[Prev in Thread] Current Thread [Next in Thread]