All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "xyu.dai" <xyu.dai@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: How to implement a simple driver in Windows with xen?
Date: Mon, 17 Aug 2009 10:52:41 -0400	[thread overview]
Message-ID: <20090817145241.GA4717@phenom.dumpdata.com> (raw)
In-Reply-To: <24874576.post@talk.nabble.com>

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.

      reply	other threads:[~2009-08-17 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-08  2:49 How to implement a simple driver in Windows with xen? xyu.dai
2009-08-17 14:52 ` Konrad Rzeszutek Wilk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090817145241.GA4717@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xyu.dai@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.