Date: Mon, 21 Jun 1999 18:50:30 +0200 From: Jean-Michel DRICOT <jdricot@ulb.ac.be> To: FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: Parallel Port File Descriptor problem Message-ID: <376E6D55.A97E41A8@ulb.ac.be>
next in thread | raw e-mail | index | archive | help
Hello, I'm tryng to write bytes directly to my PC's Parallel port. As a first shot i wrote: open("/dev/io",O_RDWR); outb(0x378, 0xFF); That was correct but only the root user could handle it. (due to the ioperm problem)... I've put correct permissions (say 777) on /dev/lpt0 and tried using file descriptor, like in my old LINUX Box :-) with "/dev/lp0" . As non-root user this time I tried executing: int fd=open("/dev/lpt0",O_RDWR); write(fd,...........); But my fd was always <0 (error with IOPerm.) even if executed the program as root.... How can I get a valid FD to a parllel port in order to use write(fd,.......) ? Thanks for your help ! Jim ------------------------------------------------------------------- Configuration: KERNEL: device ppc0 at isa? port? net irq 7 controller ppbus0 device nlpt0 at ppbus? device plip0 at ppbus? device ppi0 at ppbus? NB: I also tried different combinations of these devices... But problem remains the same... ________________________________________________________________________ "Unix IS user friendly. It's just selective about who it's friends are." Dricot Jean-Michel 3rd year study in Computer & MicroElectronic Engineering Polytechnic School Free University of Brussels (ULB) URL: http://student.ulb.ac.be/~jdricot e-mail: jdricot@ulb.ac.be To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?376E6D55.A97E41A8>