View Single Post

   
  #5 (permalink)  
Old 03-20-2008, 12:41 PM
msg
 
Posts: n/a
Default Re: Control device using TTL level signals

Dave wrote:

<snip>
> The issue is how do I program the parallel port to give the outputs I
> want? On a PC running DOS it was only necessary to write a byte of data
> at whatever the IO port for LPT1 or LPT2 were. But on a multi-user
> operating system like Solaris, it is certainly not going to be as easy -
> no non-root user is going to be able to do it and it might not be too
> easy for root to do (I have root access, so whether it needs root or not
> is irrelevant to me, but I have no idea how to write the code to do this).
>
> Anyone know what would be involved to write to the parallel port so I
> can set the outputs to some precise values I want and keep them there
> until I want to change them?
>


<snip>

At the risk of stating the obvious, why not browse the sources at
http://cvs.opensolaris.org/source/xr...e/usr/src/uts/

-or-

Get clues from OpenBSD/FreeBSD/NetBSD sources.

This would be useful if you wished to add or modify a kernel driver.
Otherwise, take a look at 'lp' filters in any flavor of SVR4 to see
how folks talk to the parallel port. In most cases, it isn't very
complicated to talk to it. See also 'man -s 7 lp':

> The parallel printer adapters are character devices. The
> minor device number corresponds to the primary or secondary
> parallel printer adapter. Thus, minor device 0 corresponds
> to the primary parallel printer adapter, while minor device
> 1 corresponds to the secondary adapter.
>
> The parallel port behaves as described in termio (7).




Michael
Reply With Quote