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

Re: [Xen-devel] How to implement a simple driver in Windows with xen?



On Fri, Aug 07, 2009 at 07:49:51PM -0700, xyu.dai wrote:
> 
> Hi. I'm trying to implement dual-way communication between processes in
> domain0 and GuestOS.
> I'm trying to setup a model like diagram below.
> 
>      Domain0                                     GuestOS(windows)
>   backend-driver <--> evtchn/share page <-->  frontend-driver
>          ^                                                       ^
>          |  r/w                                                  | r/w
>          v                                                        v
>    process A                                              process B
> 
> Now, I'm wondering how to write a simple driver in windows with xen. What
> the frontend-driver do is just accept several userspace IRPs (read/write...)
> and send message to backend-driver, I don't know how to code detaily. 
> I've read part of the win-pv drivers, but most of them are constructed in
> model like miniport or sth else, which is bind to some device like
> network,disk.

It sounds to me like you are thinking to write an IOCTL driver that will
push the data along and then at some point return the result of the IOCTL call?

An rather "easy" (that is if you know what you are doing) is to extract from 
the win-pv
drivers the XenStore (XS) components and make your Windows driver marshall the 
IRPs in
the XS. On the Dom0, your process can just read the keys from the userspace 
(using xenstore-ls
for example). The "write" mechanism can be done by the xenstore-write.

Later on you can work on using Xen hypercalls to request a shared page and use 
that to
write your IRPs (and get the responses back).

> 
> Could anyone give me some advice or sample code? 

Hope this helps a bit. Keep in mind that if you use the Win PV-GPL driver (or a 
derivative of it)
your code will also be under the GPL license. And if you use some of the 
Windows sample code, do
check their license to make sure you are allowed to use it with GPL code.

_______________________________________________
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®.