WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] back/frontend drivers HelloWorld

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] back/frontend drivers HelloWorld
From: NAHieu <nahieu@xxxxxxxxx>
Date: Mon, 26 Sep 2005 01:24:02 +0900
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sun, 25 Sep 2005 16:21:45 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LA2EFlAP12UMDTRKUNdf7kcV9qmP3uWI468wkk7HPxhy+bRu16rvo/WebD3Ielrfl4vLkNEIZmi1TLr7/b4U20AUVqdsE/iyyZmQM9xRbfKiYTmmvQ8CeBe7QOXu7SknSIlyHbj7UllQ6+IbCoXfRqzG9WbbnDHSU3ibH6E5+nA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1d35e5803140b27e1535e7c1c146d5c4@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200509221746.32758.tiger@xxxxxxxxxxxxxx> <fca75d25983158236837abcbeb5c6af7@xxxxxxxxxxxx> <5d7aca9505092302532b4e88eb@xxxxxxxxxxxxxx> <766473d1a313531c949034405df37ec5@xxxxxxxxxxxx> <5d7aca9505092410405b07022@xxxxxxxxxxxxxx> <1d35e5803140b27e1535e7c1c146d5c4@xxxxxxxxxxxx>
Reply-to: NAHieu <nahieu@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 9/25/05, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> wrote:
>
> On 24 Sep 2005, at 18:40, NAHieu wrote:
>
> > Could you tell me which code in Xen uses the above 1->4 setup
> > procedure? I searched for some examples, but couldnt find any.
>
> There are several examples in the kernel: grep for uses of
> 'alloc_unbound' in every frontend driver and 'bind_interdomain' in
> every backend driver. Unfortunately I think we currently have no
> example of doing this from user space, but the principles are the same!

I am writing a small "virtual" device driver for Xen (virtual means
not "real" device). After looking at those code, I think the steps we
must do to exchange data between dom0 and domU - using backend and
frontend method:

1. domU get the event channel, and write to  xenstore

2. dom0 watches the xenstore (xs_watch) for the event channel of domU,
to detect when domU writes channel value to xenstore. dom0 then bind
to domU's channel (using  bind_evtchn_to_irqhandler())

3. whenever dom0 and domU want to exchange data, they update the
corresponding share-ring/grant-table and then inform the other using
notify_via_evtchn()


- Is that correct? ( I have some doubts about (2), as I see that the
drivers available in xen uses xenbus_driver.probe to detect domU's
driver?)


- Another question: I found it is difficult to understand
xenbus_driver/xenbus_device architecture. They must be rooted from
Linux architecture? Any good documentation to understand those things,
in order to understand xenbus_device?

Many thanks,
Hieu

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel