X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=ORYG+4hKBxaFT6vo43/ZqGN6XoEP7gCYlTreBx0u48sDet7+5Y12Q
	3mu1T2LJuijNMOfeFDShc3du7NijLTDXfxj62xHUV5fNL9BfKChZZcC80AZH9ZaM
	l1I9WIoI+ICp2TGMlXBHKVOK3vMsHdfBpM6sHJikkAyV0lhWEq+m8U=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=nGDSMOl0iu8gRzwviVPdWxwCrkA=; b=kQADt2qO23EdrlcHowj8KtS7Qs78
	5jhdVPOBO+yVnklwYb8J+OpSW0TbuVEJpBfBFUS/3kjIfNaVXACvGxPrvVAQBfJW
	1HK4AoireyMxYHFig5qDbPMj20YwU8X7R5kYJQLUCF+Ld3/ME7CwTwMBVsoX5Ag7
	SSJyf9GAqO+jQH8=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Wed, 27 May 2015 14:09:08 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: File operations on a Windows Driver (character device)
Message-ID: <20150527120908.GE16927@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <CACs=mWDRGh9KZBT45=8yy4J6h62v0RNYxczV91qRhhb8LcfY4Q@mail.gmail.com> <5559FB9E.3040200@cygwin.com> <CACs=mWCO8ejvsufP3C_HFAiKDrcsanGZ+J_EuQQGOm+u30T_zg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="6Vw0j8UKbyX0bfpA"
Content-Disposition: inline
In-Reply-To: <CACs=mWCO8ejvsufP3C_HFAiKDrcsanGZ+J_EuQQGOm+u30T_zg@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--6Vw0j8UKbyX0bfpA
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On May 18 17:33, Alessio Faina wrote:
> Ok thanks, I've been able to find the character device under
> "/proc/sys/DosDevices/Global/deviceName"; now I'm stuck with the mmap
> implementation; when I do mmap in the userland program it returns me
> errno 19 (#define ENODEV      19  /* No such device */) obviously because
> I haven't set anything in the kernel module; there's a way to make visibl=
e a
> portion of memory to be used by the mmap in the kernel? The memory is Non=
 Paged
> and allocated with a ExAllocatePoolWithTag in 'win terms'.

The problem is that the /proc/sys interface is only implemented for
very basic operations.  There's no ioctl and mmap implemented for
arbitrary devices in Cygwin.

To get your device working, you have to either implement support for it
in Cygwin, or you have to use native W32 or NT calls to access your
device.

Alternatively: Since you can open the device, read/write should be
possible.  If you implement all interaction with your device (send
comands, request map address, etc) in the driver as specially crafted
read/write calls, you should be able to communicate with it from Cygwin
applications without having to implement a Cygwin file handler.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--6Vw0j8UKbyX0bfpA
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVZbPkAAoJEPU2Bp2uRE+gL9kQAJihUafWMLLW2E93dMoJf5Dj
H7t4s6I0XGs/FhttjJ3equJMuZ9qVQpu7U/pNVLxy06WcsEFUIXA3yXHeJbB3QXX
wSY8wrJ5iq9eIJoBHVvllcOej8vefaI0OsetBiIXGP+8iC684a3zm92Xmg2LaLNT
L5Oipo/T4C0KHj/GPL/wcF7MLpeaNEUaJHGEiEqGsGMrEsTxeELbqIg14ha6QKp1
dCeEisDTdtd+Bcvo4jwuTeyRLQB1mqnGOWUHXshk6qHvxfGo7zeVbnp/P+vpttsU
R++tUje/H54us+XDTcjS9opSS8+iBb5sNmzpSl1kYnj1vGoOSjKWF3t6PRxmgXLH
4Uus/adzi6k3kzT2YW5erclMJrpFvLXMQjyGwlJV0dbPkj75qB7IgbKbVQUgbA86
ixiAWthpR6QvgRTLdSEcCN5I+UX9p4T+l9ifDN7z0tGz3MCpsjVsZxwDckNuHE6c
k7objAII63YSyRRgtCEDeoHbsVFKIyVV7+fESDaAZHZuRrpBEACrcDCIZk/GR8PK
+ZWyXirAuoFtyAsvSZnBmgKvTfLH7deLVRDVtGiawOaU/1EaP2dseXnIzh+JHcnr
Eobe7Jymh0H26inyH5W+DSlnptnW7chKRxPDRfQraQk4m1GbViMRRD1B+a4ZnnQd
x3P6xoyNt6o9zcmDoTMw
=9glV
-----END PGP SIGNATURE-----

--6Vw0j8UKbyX0bfpA--
