From: "braham othmen" Subject: Re: Mini-OS and Xenstore Date: Tue, 5 Aug 2008 17:20:33 +0200 Message-ID: References: <20080805095141.GC4478@implementation.uk.xensource.com> <20080805103752.GK4478@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1480434502==" Return-path: In-Reply-To: <20080805103752.GK4478@implementation.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault , braham othmen , Julian Munster , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1480434502== Content-Type: multipart/alternative; boundary="----=_Part_4459_140824.1217949633560" ------=_Part_4459_140824.1217949633560 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thank you, I now understand why it wouldn't work because of the order of initialization action in start_kernel() function. I make some permitting and like it used to do, it compiles correctly but the virtual machine don't start at all. I think that the order must respect some chronologies, did an= y one know some document explaining more about that? /* Set up events. */ init_events(); /* ENABLE EVENT DELIVERY. This is disabled at start of day. */ __sti(); arch_print_info(); setup_xen_features(); /* Init memory management. */ init_mm(); /* Init time and timers. */ init_time(); /* Init grant tables */ init_gnttab(); /* Init scheduler. */ init_sched(); /* Init XenBus */ init_xenbus(); /* Init the console driver. */ init_console(); /* Call (possibly overridden) app_main() */ I write this example for those who want to write to xenstore from Mini-OS, = I included in periodic_thread of the kernel.c. the value are updated peridicaly. It depends also on the activity of virtual machine. But I want if there a possibility to write to any part of xenstore like the third case ??: xenbus_write(XBT_NIL,"/local/count_example3",buf); after loading the virtual machine, i did not found what i wrote. thanks a lot, static void periodic_thread(void *p) { struct timeval tv; unsigned int count =3D 0; char * buf; printk("Periodic thread started.\n"); for(;;) { //########### counter ########### count++; sprintf(buf, "%u", count); /* write to /local/domain/number_of_domain */ xenbus_write(XBT_NIL,"count_example1",buf); /* write to /local/domain/number_of_domain/domain */ xenbus_write(XBT_NIL,"domain/count_example2",buf); /* do not write any thing !! and do not invoke error !!!!! */ xenbus_write(XBT_NIL,"/local/count_example3",buf); //######### end counter ########## gettimeofday(&tv); printk("T(s=3D%ld us=3D%ld)\n", tv.tv_sec, tv.tv_usec); sleep(1000); } } best regards Braham Othmen 2008/8/5 Samuel Thibault > braham othmen, le Tue 05 Aug 2008 12:29:17 +0200, a =E9crit : > > this code > > xenbus_write(XBT_NIL,"/local/example","val_example"); > > which is included in events.c > > Where did you add that code in events.c? Take care that the xenbus > stuff may not be initialized at that point... See the initialization > steps in kernel.c's start_kernel. > > Samuel > ------=_Part_4459_140824.1217949633560 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=09 =09 =09 =09

Thank you,

 I now understand why it wouldn't work because of the order of  initialization action in start_kernel() function. I make some permitting  and like it used to do, it compiles correctly but the virtual machine don't start at all. I think that the order must respect some chronologies, did any one know some document explaining more about that?

    /* Set up events. */
 &n= bsp;  init_events();
   
    /* ENABLE EVENT DELIVERY. This is disabled at start of day. */
    __sti();

    arch_print_info();

  &n= bsp; setup_xen_features();

    /* Init memory management. */
    init_mm();

    /* Init time and timers. */
    init_time();

 = ;   /* Init grant tables */
    init_gnttab();
  = ; 
    /* Init scheduler. */
    init_sched();
 
    /* Init XenBus */
 &n= bsp;  init_xenbus();

    /* Init the console driver. */
   init_console();
    /* Call (possibly overridden) app_main() */

I write this example for those who want to write to xenstore from Mini-OS, I included in periodic_thread of the kernel.c. the value are updated peridicaly. It depends also on the activity of virtual machine. But I want if there a possibility to write
to any part of xenstore like the third case ??:        xenbus_write(XBT_NIL,"/local/count_example3",buf);
after loading the virtual machine, i did not found what i wrote.

thanks a lot,

static void periodic_thread(void *p)
{
  &nbs= p; struct timeval tv;
    unsigned int count =3D 0;
 = ;   char * buf;
    printk("Periodic thread started.\n");
    for(;;)
    {
       //########### counter ###########
       count++;
  = ;     sprintf(buf, "%u", count);
     &nbs= p; /*  write to /local/domain/number_of_domain  */
  &n= bsp;    xenbus_write(XBT_NIL,"count_example1",buf);
   =     /*  write to /local/domain/number_of_domain/domain  */
       xenbus_write(XBT_NIL,"domain/count_example2",buf);
  = ;     /* do not write any thing !! and do not invoke error !!!!! */
 &nbs= p;     xenbus_write(XBT_NIL,"/local/count_example3",buf);
  = ;     //######### end counter ##########
       gettimeofday(&tv);
        printk("T(s=3D%ld us=3D%ld)\n", tv.tv_sec, tv.tv_usec);
 =        sleep(1000);
    }
}

best regards
Braham Othmen



2008/8/5 Samuel Thibault <samuel.thibault@eu.= citrix.com>
braham othmen, le Tue 05 Aug 2008 12:29:17 +0200, a =E9crit :
> this code
>     xenbus_write(XBT_NIL,"/local/example","va= l_example");
> which is included in events.c

Where did you add that code in events.c?  Take care that the xen= bus
stuff may not be initialized at that point...  See the initialization<= br> steps in kernel.c's start_kernel.

Samuel

------=_Part_4459_140824.1217949633560-- --===============1480434502== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1480434502==--