delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/28/22:40:12

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
Date: Fri, 29 Sep 2000 13:45:38 +1100 (EST)
From: Peter J Eccles <petere AT connexus DOT net DOT au>
To: =?ISO-8859-1?Q?=BA=A3=B6=AB?= <y DOT h DOT d AT 263 DOT net>
cc: "cygwin AT sourceware DOT cygnus DOT com" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: Problem about parallel port!
In-Reply-To: <20000928010859.111D11C2E8E4A@smtp.263.net>
Message-ID: <Pine.LNX.4.21.0009291335430.534-100000@krypton.bogus.federation>
MIME-Version: 1.0

>    How can I access the parallel port in cygwin under win2000 or win98? 

Under win98 (aka DOS), anyone can get unrestricted access the the IO ports of
the board using code such as:

static inline int win9x_inportb( int port )
{
   unsigned char value;
  __asm__ volatile ("inb %1,%0"
                    : "=a" (value)
                    : "d" ((unsigned short)port));
   return value;
}

static inline void win9x_outportb( unsigned short int port, unsigned char val )
{
  __asm__ volatile (
                    "outb %0,%1\n"
                    :
                    : "a" (val), "d" (port)
                    );
}

Under Win2k (aka WinNT), it is more involved, you need to use a device
driver to do the work, and you just use function calls to this device driver
to do the actual port IO.  I have used the MMP library (which gives access to
the entire IO space and memory, and therefore is not really secure).

MMP lives at: http://www.einev.ch/references/mondada/mmp/

There is many others though which are perhaps a bit safer, try:
http://www.lvr.com/
for links to a few other libraries (under the parallel port section)




===============================================================================
Peter Eccles
Computer Systems Engineering (4th year)
RMIT Melbourne Australia 

email: petere AT connexus DOT net DOT au
===============================================================================


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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