This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: Problem about parallel port!
- To: º£¶« <y dot h dot d at 263 dot net>
- Subject: Re: Problem about parallel port!
- From: Peter J Eccles <petere at connexus dot net dot au>
- Date: Fri, 29 Sep 2000 13:45:38 +1100 (EST)
- cc: "cygwin at sourceware dot cygnus dot com" <cygwin at sourceware dot cygnus dot com>
> 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@connexus.net.au
===============================================================================
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com