delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/21/03:57:55

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BAAF2EB.29D9D317@syntrex.com>
Date: Fri, 21 Sep 2001 09:57:31 +0200
From: Pavel Tsekov <ptsekov AT syntrex DOT com>
Organization: Syntrex Inc.
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: abhishek gupta <abhi_iit AT rediffmail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: asm/io.h where can I find this ??
References: <20010921054725 DOT 8957 DOT qmail AT mailweb25 DOT rediffmail DOT com>

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019