public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Alessio Faina <alessiofaina@gmail.com>
To: cygwin@cygwin.com
Subject: Re: File operations on a Windows Driver (character device)
Date: Mon, 18 May 2015 16:19:00 -0000	[thread overview]
Message-ID: <CACs=mWCO8ejvsufP3C_HFAiKDrcsanGZ+J_EuQQGOm+u30T_zg@mail.gmail.com> (raw)
In-Reply-To: <5559FB9E.3040200@cygwin.com>

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 visible 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'.

2015-05-18 16:47 GMT+02:00 Larry Hall (Cygwin)
<reply-to-list-only-lh@cygwin.com>:
> On 05/18/2015 05:42 AM, Alessio Faina wrote:
>>
>> Hello everyone,
>>
>> I'm developing a port of a FreeBSD/Linux application that consists of
>> two parts: a kernel and a user land part.
>> The kernel part is build as a WDM driver and is compiled with VS2013
>> and WDK 8.1: the userspace is going to
>> be compiled under Cygwin for compatibility with user land programs
>> already written for other OSs.
>>
>> My problem is that the user space program invokes Open(), ioctl(),
>> mmap/munmap(), select() and poll().
>>
>> I've build a test Win32 app to open with CreateFile the DosDevice with
>> the "\\\\.\\uniioctl" name and everything goes fine,
>> but I've tried to do the same thing with Open(...) with a lot of
>> variants (\\DosDevice\\uniioctl, \dev\uniioctl....) but I'm
>> unable to open the character device. There is some way to do this?
>
>
> Sorry I can't help with allot of specifics on your questions but I can
> say that when using Cygwin, you are best off if you stick to POSIX syntax
> and semantics and don't mix in Windows code and Windowisms.  That includes
> path separators (i.e. use '/', not '\').  See this page in the User's Guide
> for information on how Cygwin handles device emulation too:
>
> <https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices>
>
>
>
> --
> Larry
>
> _____________________________________________________________________
>
> A: Yes.
>> Q: Are you sure?
>>> A: Because it reverses the logical flow of conversation.
>>>> Q: Why is top posting annoying in email?
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2015-05-18 15:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 12:34 Alessio Faina
2015-05-18 15:30 ` Larry Hall (Cygwin)
2015-05-18 16:19   ` Alessio Faina [this message]
2015-05-19  8:52     ` Mark Geisert
2015-05-19 15:37       ` Alessio Faina
2015-05-20  5:18         ` Mark Geisert
2015-05-21 11:14           ` Alessio Faina
2015-05-21 18:20             ` Mark Geisert
2015-05-27 12:23     ` Corinna Vinschen
2015-05-27 15:59       ` Alessio Faina
2015-05-27 17:22         ` Eric Blake
2015-05-28 10:55         ` Corinna Vinschen

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='CACs=mWCO8ejvsufP3C_HFAiKDrcsanGZ+J_EuQQGOm+u30T_zg@mail.gmail.com' \
    --to=alessiofaina@gmail.com \
    --cc=cygwin@cygwin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).