From owner-freebsd-questions Mon Jun 21 10:19:53 1999 Delivered-To: freebsd-questions@freebsd.org Received: from rc1.vub.ac.be (rc1.vub.ac.be [134.184.129.1]) by hub.freebsd.org (Postfix) with ESMTP id F26E614FB4 for ; Mon, 21 Jun 1999 10:19:35 -0700 (PDT) (envelope-from jdricot@ulb.ac.be) Received: from mach.vub.ac.be (mach.vub.ac.be [134.184.129.3]) by rc1.vub.ac.be (8.8.8/%I%.0.ap (rc1)) id TAA12445; Mon, 21 Jun 1999 19:19:09 +0200 (MET DST) for Received: from ulb.ac.be (ppp-dial131.ulb.ac.be [164.15.246.131]) by mach.vub.ac.be (8.8.8+Sun/%I%.1.ap (mach.test)) id TAA14816; Mon, 21 Jun 1999 19:19:31 +0200 (MET DST) for Message-ID: <376E6D55.A97E41A8@ulb.ac.be> Date: Mon, 21 Jun 1999 18:50:30 +0200 From: Jean-Michel DRICOT Organization: ULB - Ecole Polytechnique X-Mailer: Mozilla 4.07 [en] (X11; I; FreeBSD 3.1-RELEASE i386) MIME-Version: 1.0 To: FreeBSD Questions Subject: Parallel Port File Descriptor problem Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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