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: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] back/frontend drivers HelloWorld
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Thu, 22 Sep 2005 17:04:00 +0100
Cc: Anton Korenyushkin <tiger@xxxxxxxxxxxxxx>
Delivery-date: Thu, 22 Sep 2005 16:00:34 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200509221746.32758.tiger@xxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8
> I'm trying to write 2 simple xen0/xenU modules, which only transfer string
> "Hello world" by grant tables interface. But in docs/misc/grant-tables.txt
> there is no explanation of how to transmit grant table reference to another
> domain:
> .. gref is then somehow transmitted to domB for use.
>
> I'm reading blkback/front driver's code, but it is too complicated. I've
> understood that i should use message rings for my task (i've read
> docs/misc/blkif-drivers-explained.txt too). But how to get such ring?

You share it using grant tables ;-)  I'll assume that since you're using 
grant-tables you're developing on 3.0-unstable (the control plane was very 
different on Xen 2.0).

> May be a simple example of solution such problem exists, so could you point
> me on this example?

To share the initial grant reference you using "xenstore".  This is a 
hierarchical directory structure, holding names "keys" which contain 
arbitrailty structured data.  Think "registry" ;-)

The kernel interface to Xenstore is the Xenbus - you use Xenbus API functions 
in the kernel to write and read the keys in the store.  By writing the grant 
reference into a key at a standard location, you can communicate it from the 
frontend to the backend.  This is what the block and network devices do.

For a very simple driver, you might want to bypass the complexity of using 
Xenstore at all...  How about passing the grant reference on the command 
line?  Add a printk to the frontend, outputting the reference ID to the dmesg 
log, then pass this as an argument when you load the module for the backend 
driver.  Just a thought...  (side note: I'm not sure if we currently export 
all the symbols required for an unloadable backend - if not, we probably 
should).

> Sorry for bad English.

Way better than my Russian ever was.  For that matter, probably better than my 
English too ;-)

Poka!
Mark

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