Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <3BAAFB9C.12816CCB@syntrex.com>
Date: Fri, 21 Sep 2001 10:34:36 +0200
From: Pavel Tsekov <ptsekov@syntrex.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@rediffmail.com>, cygwin@cygwin.com
Subject: Re: asm/io.h where can I find this ??
References: <20010921083445.26638.qmail@mailweb26.rediffmail.com>
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit

abhishek gupta wrote:
> 
> Hi,
> thanks for replying to our query.
> if we cant run the piece of code on cygwin, than what should do to write to port and read from the port ( low level i/o operations on port ) under windows environment using this gnu compiler (cygwin).
> are there any other API's availble.

I think you should operate the specified parallel device using /dev/lp*
if cygwin supports this. I dont know actually if it does, although
serial devices are supported. Perhaps someone on the list knows and you
should try searching the archives <g> :)

For a Windows specific why to handle the situation check this link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/filesio_7wmd.asp
or the description
of CreateFile in the MSDN library if you have it. In this topic look for
"Communication Resources".

> 
> thanks
> 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 (0x378,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/

