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

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



> 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.