On Feb  2 08:40, Franz Fehringer via Cygwin wrote:
> Am 02.02.2023 um 08:33 schrieb Franz Fehringer via Cygwin:
> > Am 31.01.2023 um 10:27 schrieb Corinna Vinschen via Cygwin:
> > > On Jan 29 18:22, Franz Fehringer via Cygwin wrote:
> > > > Hi all,
> > > > 
> > > > Is there any Cygwin package providing the iopl et al. routines?
> > > > Google uncovers an ioperm package but that seems to be nothing current.
> > > > My goal is to compile https://github.com/pciutils/pciutils with Cygwin.
> > > 
> > > Cygwin doesn't have any Linux-like or POSIX-like API (device names,
> > > ioctl's and whatnot) to access PCI directly.
> > > 
> > > 
> > > Corinna
> > > 
> > 
> > On https://github.com/pciutils/pciutils the claim is
> > 
> > In runs on the following systems:
> >      Linux        (via /sys/bus/pci, /proc/bus/pci or i386 ports)
> > 
> > and http://ftp.uni-kl.de/pub/windows/cygwin/release/ioperm/setup.hint says
> > 
> > # $Id: setup.hint,v 1.4 2003/01/31 14:58:56 telka Exp $
> > 
> > sdesc: "support for ioperm()/iopl() functions"
> > ldesc: "This package adds support for ioperm()/iopl() functions to Cygwin.
> > This support includes sys/io.h and sys/perm.h header files together
> > with development and runtime libraries."
> > category: Devel Libs System
> > requires: cygwin libpopt0
> > 
> > So there possibly was once iopl support?

I was just trying to say that Cygwin itself (i. e., the core DLL) does
not provide any such calls or headers.

> Just guessing this was possibly 32bit only.

Very likely.  Looks like we never had an ioperm package for 64 bit, and
that makes sense.  You'd have to build the ioperm package by yourself
for 64 bit, and you'll have a few problems there.

- Checking the package for type safety.  Think LP64 vs. LLP64
  https://cygwin.com/faq.html#faq.programming.64bitporting

- The ioperm package can only provide these calls by installing
  a kernel driver (see the source, driver subdir).

- This driver may or may not work on 64 bit, but if it works,
  you can only install it by switching your machine into
  debug mode:
  
https://learn.microsoft.com/en-us/windows-hardware/drivers/install/installing-an-unsigned-driver-during-development-and-test

- For normal operations you have to sign the driver.  Self-signed
  drivers won't run on any machine with UEFI secure boot enabled.
  Alternatively you can let Microsoft sign it.  Only that version
  would be ok for inclusion into the Cygwin distro.

- Alternatively you can try to convert the ioperm driver into an
  UMDF driver.  Some kernel functionality is not allowed for UMDF
  drivers, but I never looked deeper into this.


Corinna

-- 
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