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

Pavel Tsekov ptsekov@syntrex.com
Fri Sep 21 00:57:00 GMT 2001


Hey there:)

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

DESCRIPTION
       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
the
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*)
privileged
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:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list