[lkml]   [2003]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Direct access to parport

On Tue, 4 Mar 2003, Uwe Reimann wrote:
> I'd like to connect some self made hardware to the parallel port and
> read the values of the dataline using linux. Can this be done in
> userspace or do I have to write kernel code to do so? I'm currently
> thinking of writing a device like lp, which in turn uses the parport
> device. Does this sound like a good idea?

From userspace it's quite simple:

#include <stdio.h>
#include <sys/io.h>

int main(int argc, char **argv)
int addr = 0x378;

if(ioperm(addr, 3, 1) == -1) {
printf("0x%02x\n", inb(addr + 1));

The ioperm() only works if you're root.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:33    [W:0.067 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site