This is the mail archive of the 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]

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

Hey there:)

>From the linux manpage for the lowlevel ioport access routines.

       This  family  of  functions  is  used to do low level port
       input and output.  They are primarily designed for  inter­
       nal kernel use, but can be used from user space, given the
       following information in addition to that given in outb(9)

Including asm/io.h is rather specific to linux systems. /usr/include/asm 
contains header files from the linux kernel source which are specific to
underlying hardware platform. So you cant expect this to work on cygwin.

Also the code behind this io routines includes (*at least i think so*)
asm instructions which cant be executed in user mode on win32(RING3),
they can
be executed only in kernel mode (RING0) i.e. by device drivers.

abhishek gupta wrote:
> Hello and Thanks you for openning this message.
> I'm working on a program which write to a serial port and reads from it.
> works under linux red hat, using the command line :
> -> gcc myprog.c -o myprog -O2
> and
> ->/myrep/myprog
> but when I try to compile it under cygwin )))-: it doesn't works and shows:-
> asm/io.h: No such file or directory
> this is the lib I need
> ORIGINAL LINE     : #include <asm/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.
> Thank you
> Regards
> Abhishek
> /*----Start of myprog source -------*/
> #include <stdio.h>
> #include <unistd.h>
> #include <asm/io.h>
> #define BASEPORT 0x378
> int main()
> {
>     int i=0;
>     char c='A';
>     ioperm (0x378,1,1);
>     for (i;i<10;i++) {
>        outb(c,0x378);
>        printf("%c\n",inb(0x378));
>        printf("%c\n",c);
>        c++;
>     }
>     ioperm (i,1,0);
> }
> /*----End of myprog source -------*/
> --
> Unsubscribe info:
> Bug reporting:
> Documentation:
> FAQ:         

Unsubscribe info:
Bug reporting:

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