*BSD News Article 73488


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!sgigate.sgi.com!news-res.gsl.net!news.gsl.net!news.mathworks.com!newsfeed.internetmci.com!uwm.edu!math.ohio-state.edu!jussieu.fr!uvsq.fr!Newsmaster
From: Nicolas Souchu <son@angrand.prism.uvsq.fr>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Need Info on Parallel port programming
Date: 12 Jul 1996 11:32:53 +0200
Organization: Universite de Versailles/St Quentin en Yvelines - France
Lines: 45
Message-ID: <s60u3vdn7ei.fsf@angrand.prism.uvsq.fr>
References: <4s2vq6$6lr@news.abq.bdm.com>
NNTP-Posting-Host: angrand.prism.uvsq.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
CC: rhughes2@bdm.com
X-Newsreader: Gnus v5.2.25/XEmacs 19.14

Hi,

The best solution, I think is :

	- open /dev/io to allow out/in port reads and writes from a
	  user process.
	- do your stuff in a user process with things like this:



__inline__ static void port_out( char value, unsigned short port )
{
  __asm__ volatile ("outb %0,%1"
		    ::"a" ((char) value), "d"((unsigned short) port));
}

__inline__ static char port_in( unsigned short port )
{
  char _v;
  __asm__ volatile ("inb %1,%0"
		    :"=a" (_v):"d"((unsigned short) port));

  return _v;
}


You may have some info about parallel port programming at

--- cut ---

http://www.fapo.com/ieee1284.htm 	The start
		
ftp.lexmark.com/pub/ieee		Digging deeper

http://www.nsc.com 			Make it work on your hardware
http://www.smc.com			Make it work on your hardware

--- paste ---

nicolas

-- 
Nicolas.Souchu@prism.uvsq.fr
Laboratoire PRiSM - Versailles, FRANCE