From mboxrd@z Thu Jan 1 00:00:00 1970 From: NAHieu Subject: Re: back/frontend drivers HelloWorld Date: Mon, 26 Sep 2005 01:24:02 +0900 Message-ID: <5d7aca95050925092427b30189@mail.gmail.com> References: <200509221746.32758.tiger@swsoft.mipt.ru> <5d7aca9505092302532b4e88eb@mail.gmail.com> <766473d1a313531c949034405df37ec5@cl.cam.ac.uk> <5d7aca9505092410405b07022@mail.gmail.com> <1d35e5803140b27e1535e7c1c146d5c4@cl.cam.ac.uk> Reply-To: NAHieu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1d35e5803140b27e1535e7c1c146d5c4@cl.cam.ac.uk> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 9/25/05, Keir Fraser 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