Discussion:
1.5.18 ( 0.132/4/2 ) - ioperm - OpenSCManager failed
pppd
2005-08-25 20:15:15 UTC
Permalink
Hello guys,

I'd like to use ioperm functions under Cygwin 1.5.18 ( 0.132/4/2 ).

First I have tried to compile my C code ( below ) on Cygwin.

P.S: It works on Linux.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/io.h>

int main( void ) {

unsigned char Value;

ioperm(0x378, 3, 1);
Value = inb(0x378+1);
ioperm(0x378, 3, 0);

printf("Status Parallel Port -> 0x%x\n", Value );

return 0;

}

Trying compile...
$ gcc -o io io.c -Wall
/cygdrive/c/DOCUME~1/t00707/CONFIG~1/Temp/ccKOfTff.o:io.c:(.text+0x42): undefined reference to `_ioperm'
/cygdrive/c/DOCUME~1/t00707/CONFIG~1/Temp/ccKOfTff.o:io.c:(.text+0x6d): undefined reference to `_ioperm'
collect2: ld returned 1 exit status

Maybe I need install ioperm package? I have tried it too.

$ ioperm -i
OpenSCManager function call failed.
Error: ioperm.sys installation failed.

and then..

$ ioperm.sys
bash: /usr/bin/ioperm.sys: Permission denied

Does anybody can help me ?

Best Regards,
Douglas Schilling Landgraf
Gerrit P. Haase
2005-08-25 20:42:21 UTC
Permalink
Post by pppd
$ ioperm -i
OpenSCManager function call failed.
Error: ioperm.sys installation failed.
and then..
$ ioperm.sys
bash: /usr/bin/ioperm.sys: Permission denied
Does anybody can help me ?
From the website:
Install (activate) ioperm.sys driver using ioperm -i. This is required
only for Windows NT/2000/XP.

This works for me. Maybe Administator rights are needed to install
driver?

Would be nice if this information could be included in the README.


Gerrit
Marcel Telka
2005-08-25 22:09:41 UTC
Permalink
Post by Gerrit P. Haase
Post by pppd
$ ioperm -i
OpenSCManager function call failed.
Error: ioperm.sys installation failed.
and then..
$ ioperm.sys
bash: /usr/bin/ioperm.sys: Permission denied
Does anybody can help me ?
Install (activate) ioperm.sys driver using ioperm -i. This is required
only for Windows NT/2000/XP.
This works for me. Maybe Administator rights are needed to install
driver?
Would be nice if this information could be included in the README.
Added to the README. I've also updated the ioperm website at
<http://openwince.sourceforge.net/ioperm/>.
--
+-------------------------------------------+
| Marcel Telka e-mail: ***@telka.sk |
| homepage: http://telka.sk/ |
| jabber: ***@jabber.sk |
+-------------------------------------------+
Douglas Schilling Landgraf
2005-08-25 20:59:16 UTC
Permalink
Thanks Gerrit, I got how to compile my program reading "README" file ;o).
It needs use -lioperm flag ( On Linux it's -O2 for ioperm functions ) .

$ gcc -o io io.c -lioperm
$./io
Illegal instruction ( code dumped )

I don't know why it happens on Cygwin. On Linux the same code works fine ( below ).

Maybe permission ( I'm using Windows XP SP2 )? I'm looking for it.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/io.h>

int main( void ) {

unsigned char Value;

ioperm(0x378, 3, 1);
Value = inb(0x378+1);
ioperm(0x378, 3, 0);

printf("Status Parallel Port -> 0x%x\n", Value );

return 0;

}


Best Regards,
Douglas Schilling Landgraf
Post by Gerrit P. Haase
Post by pppd
$ ioperm -i
OpenSCManager function call failed.
Error: ioperm.sys installation failed.
and then..
$ ioperm.sys
bash: /usr/bin/ioperm.sys: Permission denied
Does anybody can help me ?
Install (activate) ioperm.sys driver using ioperm -i. This is required
only for Windows NT/2000/XP.
This works for me. Maybe Administator rights are needed to install
driver?
Would be nice if this information could be included in the README.
Gerrit
Marcel Telka
2005-08-25 21:37:35 UTC
Permalink
Hi Douglas.
Post by Douglas Schilling Landgraf
Thanks Gerrit, I got how to compile my program reading "README" file ;o).
It needs use -lioperm flag ( On Linux it's -O2 for ioperm functions ) .
$ gcc -o io io.c -lioperm
$./io
Illegal instruction ( code dumped )
I don't know why it happens on Cygwin. On Linux the same code works fine ( below ).
Maybe permission ( I'm using Windows XP SP2 )? I'm looking for it.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/io.h>
int main( void ) {
unsigned char Value;
ioperm(0x378, 3, 1);
You should test return value from the ioperm() call.
Post by Douglas Schilling Landgraf
Value = inb(0x378+1);
ioperm(0x378, 3, 0);
printf("Status Parallel Port -> 0x%x\n", Value );
return 0;
}
Regards.
--
+-------------------------------------------+
| Marcel Telka e-mail: ***@telka.sk |
| homepage: http://telka.sk/ |
| jabber: ***@jabber.sk |
+-------------------------------------------+
Marcel Telka
2005-08-25 22:14:49 UTC
Permalink
Post by pppd
$ ioperm.sys
bash: /usr/bin/ioperm.sys: Permission denied
ioperm.sys is not a standalone executable.


[snip]
Post by pppd
Cygwin Package Information
Last downloaded files to: c:\cyg_packages
Last downloaded files from: http://planetmirror.com/pub/sourceware/cygwin
Package Version
...
Post by pppd
ioperm 0.3-1
You should update the ioperm package to latest version.


Regards.
--
+-------------------------------------------+
| Marcel Telka e-mail: ***@telka.sk |
| homepage: http://telka.sk/ |
| jabber: ***@jabber.sk |
+-------------------------------------------+
Loading...