This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

asm/io.h where can I find this ??


Hello and Thanks you for openning this message.


I'm working on a chip-card reader running on parrallel port this program
works under linux red hat, using the command line :
-> gcc myprog.c -omyprog -O2
and
->/myrep/myprog


but when I try to compile it under cygwin )))-: it doesn't works


BASH.EXE-2.02$ pwd
/cygnus/cygwin-b20/bruno


---#include <asm/io.h>--------------------------------------------
using ORIGINAL LINE : #include <asm/io.h>

BASH.EXE-2.02$ gcc carte.c -ocarte.exe -O2
carte.c:3: asm/io.h: No such file or directory

---#include <io.h>------------------------------------------------
using : #include <io.h>


BASH.EXE-2.02$ gcc carte.c -ocarte.exe -O2
C:\WINDOWS\TEMP\cch8fVba.o(.text+0x2a):carte.c: undefined reference to
`ioperm'
C:\WINDOWS\TEMP\cch8fVba.o(.text+0x4e):carte.c: undefined reference to
`outb'
C:\WINDOWS\TEMP\cch8fVba.o(.text+0x64):carte.c: undefined reference to
`outb'
C:\WINDOWS\TEMP\cch8fVba.o(.text+0x76):carte.c: undefined reference to `inb'
C:\WINDOWS\TEMP\cch8fVba.o(.text+0xb8):carte.c: undefined reference to
`outb'
C:\WINDOWS\TEMP\cch8fVba.o(.text+0xd0):carte.c: undefined reference to
`outb'
C:\WINDOWS\TEMP\cch8fVba.o(.text+0xe7):carte.c: undefined reference to
`outb'
collect2: ld returned 1 exit status



---include <mingw32/io.h>------------------------------------------------
using : #include <mingw32/io.h>


BASH.EXE-2.02$ gcc carte.c -ocarte.exe -O2
In file included from carte.c:5:
C:\CYGNUS\CYGWIN~1\H-I586~1\BIN\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..
\..\
..\..\i586-cygwin32\include\mingw32/io.h:38: dir.h: No such file or
directory
C:\CYGNUS\CYGWIN~1\H-I586~1\BIN\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..
\..\
..\..\i586-cygwin32\include\mingw32/io.h:51: warning: `X_OK' redefined
C:\CYGNUS\CYGWIN~1\H-I586~1\BIN\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..
\..\
..\..\i586-cygwin32\include\sys/unistd.h:95: warning: this is the location
of th
e previous definition

-------------------------------------------------------------------------

this is the lib I need

ORIGINAL LINE     : #include <asm/io.h>
have tried to use : #include </io.h>
or                : #include <mingw32/io.h>

where can I find the the equivalent of red hat "asm/io.h"
and where sould I copy it under cygwin ?

The following is myprog.c (fastly commented) source it will be usefull to
understand what I say.

Tank you

Regards Bruno

+-------------+-----------------------------------------------------+
|...B-N...... | reply to Bruno-71@ifrance.com will be apprecaited   |
|..(\"/)...<- | Vlad my hamster, eating something while I try to    |
|.( :O: ).... | write english and learn something                   |
|..o---o..... | Only in french   http://perso.wanadoo.fr/bruno-n3   |
+-------------+-----------------------------------------------------+


/*----Start of myprog source -------*/
#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>
/* adresse du base port parallele */
#define BASEPORT 0x378 // base adress port printer port
int main()
{
unsigned int lu; // variable lu sur 0x379 read on
int i=1;
int j=1;
/* demande d'autorisation d'utiliser le port ou arret avec erreur */
/* ask for auhorisation to use the port or stop *:
if (ioperm(BASEPORT,3,1)) {perror("ioperm"); exit(1);}
outb(11,BASEPORT); /* init de la puce-chip */
usleep(10000);

outb(9,BASEPORT); /* keep "on" chip */
while(i<=256)
{
lu=inb(BASEPORT+1);
lu=lu & 128; /* read pin 11 (connected to the chip data out) on port */
if (lu==128) lu=1;
printf("%d", lu);
if (j==65) {j=0; printf("\n");}
i++;
j++;
outb(13,BASEPORT); /* go to next bit on chip */
usleep(10000);
outb(9,BASEPORT); /* keep "on" chip */
}
outb(0,BASEPORT); /* trun "off" chip */
printf("\n");
exit(0);
}
/*----End of myprog source -------*/


 
______________________________________________________________________________
Si votre email etait sur iFrance vous pourriez ecouter ce message au tel !
http://www.ifrance.com : ne laissez plus vos emails loins de vous ...
gratuit sur iFrance :  emails (20 MO, POP, FAX), Agenda, Site perso 


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]