Mail Archives: cygwin/2001/09/21/04:35:07
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/
- Raw text -