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/
Home Products Support Community News


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

To: "xyu.dai" <xyu.dai@xxxxxxxxx>
Subject: Re: [Xen-devel] How to implement a simple driver in Windows with xen?
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Mon, 17 Aug 2009 10:52:41 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 17 Aug 2009 07:53:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <24874576.post@xxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <24874576.post@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.19 (2009-01-05)
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

<Prev in Thread] Current Thread [Next in Thread>