Corinna wrote:
> In theory, the Cygwin DLL has to provide stuff through ioctl's after
> opening the device file.  There are already quite a few ioctl's
> supported, namely
>
> HDIO_GETGEO, BLKGETSIZE, BLKGETSIZE64, BLKRRPART, BLKSSZGET, BLKIOMIN,
> BLKIOOPT, BLKPBSZGET, BLKALIGNOFF, RDIOCDOP subcommand RDSETBLK,
> RDIOCGET.
>
> Whatever is missing *and* is provided by the WinAPI function
> DeviceIoControl (or, actually, any other way) can be added to
> Cygwin's ioctl API as you see fit.
>
>
> Corinna

Thanks Corinna. That gives me a better understanding of how this works.
I'll need to explore the source a bit to see how it fits together but
that helps a lot.

Brian wrote:

    Please maintain threading using Reply to List or Reply/All to keep the
    discussion together in email clients using proper References headers for
    threads, rather than just Subject, and also please retain some quoted 
context
    for your replies.

I have now turned off Digest mode so this will be the last reply from me
that messes this stuff up for people.

>     I'd be happy to attempt implementing this, but I'm not sure where to
>     start. With the information you've given me I should be able to figure
>     something out, but I'm not sure how this is done in Linux/a POSIX
>     compliant way. Would be be through a file and directory structure or
>     through some libraries?

    See what libraries are used by the package, whether and what system 
dependencies
    each has, clone the source repo or download the sources and create a local 
repo,
    so you can follow a similar structure with a Cygwin port.
    Using a (git) repo to track your information, documentation, research, 
proofs of
    concept, and changes will make life easier for all.

>     I know a little bit of C and C++, so if I do have to write a library I
>     should be able to muddle through, and probably learn quite a lot, but
>     I'm not sure quite where to start here, with either the Linux side or
>     the Cygwin side (would this be part of the Cygwin DLL?).

    First you need to research what information you need to deliver to your 
client
    or consumer, based on the system dependencies found above, and how to find 
that
    information under Windows.

    You could make that process into a proof of concept in some interpreted 
script
    running under an elevated admin shell to access /proc/..., 
/proc/registry/...,
    /proc/sys/... etc. and get at the information you require.

    Then you could research how you could implement that process with Windows 
APIs
    by searching online docs, including e.g. SO: pay attention to supported 
versions
    in MS docs.

    If you isolate system interfaces into independent modules, they could be
    reimplemented in the DLL if appropriate.

>     I'm aware this might not be the right mailing list, but would appreciate
>     if anyone knowledgeable in this area could give me a few pointers to
>     help me get started - I'd love to contribute more to Cygwin 

    Check out the newlib-cygwin source repo and read the sources (starting with
    short .cc files under winsup/cygwin/) to see how system interfaces are
    implemented using Windows APIs.

All makes sense,. I'll see what I can do. It might well be that there
are some programs/libs I can just add without having to change anything
then. Thanks both, I'll get back to you when I have something to
report/more questions,

Hamish

Attachment: 0x87B761FE07F548D6.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to