From owner-freebsd-questions@FreeBSD.ORG Sun Jul 27 06:08:04 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0D0637B401 for ; Sun, 27 Jul 2003 06:08:04 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A0F443F93 for ; Sun, 27 Jul 2003 06:08:03 -0700 (PDT) (envelope-from admin@asarian-host.net) Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email accounts can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by mail.asarian-host.net (8.12.9/8.12.9) id h6RD82Pe031254 for freebsd-questions@freebsd.org; Sun, 27 Jul 2003 15:08:02 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Message-Id: <200307271307.H6RD7JGZ031242@asarian-host.net> Date: Sun, 27 Jul 2003 13:08:01 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: 0EgQe3eygSUY9oXIsZ1cVdGr5AUwgNt9pE4fVSWZhc/YQx++9NO03bObvprnOmp4MBnydlfyxGPM3OTA7IyQDw== X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we are unable to process your complaint Organization: Asarian-host To: "Malcolm Kay" , "Daan Vreeken [PA4DAN]" References: <200307251722.H6PHMFRS032800@asarian-host.net> <200307251942.54397.Danovitsch@Vitsch.net> <200307261241.54059.malcolm.kay@internode.on.net> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Auth: Asarian-host PGP signature iQEVAwUAPyPOsTFqW1BleBN9AQFs3gf+JsTKKzYxA5wqK9Nqt7yAXwFHIKM8zLkI QdDyNjboqJVrlwaVycyV4ekYN57oX4I6Ho5saHmterW0d72mN89pG4gAtdU+PNLY XECicvdnqMtjwaqgNQ1vGwu7cv0UHsgsr2euS0CWTOhUxs/6TbN1VJZa3uJijqF6 vL7xNnk/eAndj2lzFi05omQkB1wjdUWDaFxEc7Jj5pvFko3IXcpIJ2KDoUYc38Kq XcskPy1JD6NCMNbXlHBBmIpqlsX2Jf21h4vagN40E195e2/eyFLW8r8jjyAKBH7Y ISu2KbLM0IB8GQTRNsTcDyMlkQWRkgviCCwYOz6ZS1uHImKE0p2ZoA== =kEoF cc: FreeBSD-questions@freebsd.org Subject: SOLVED! Re: Writing to parallel port X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2003 13:08:05 -0000 ----- Original Message ----- From: "Malcolm Kay" To: "Daan Vreeken [PA4DAN]" ; "Mark" Cc: Sent: Saturday, July 26, 2003 5:12 AM Subject: Re: Writing to parallel port > > On Friday 25 July 2003 19:22, Mark wrote: > > Hello, > > > > Has anyone an idea how to set/unset a bit on a parallel port in freebsd > > 4.7? I installed Device::ParallelPort from CPAN (Perl 5.8.0), but that > > does nothing (seems made for linux). > > Basically you need to open /dev/io to get io read/write permission, after > that you are free to bang all IO-ports you want. > Generally you still need to be root or have root privilege to do this; > but might vary with different FreeBSD releases. > > An alternative that may or may not suit your needs is ppi device access > to parallel ports eg /dev/ppi0; try: # man ppi Thanks, Malcolm! Using /dev/ppi0 solved it. :) And I am back in securelevel 2 (accessing the raw device directly, via /dev/io, though it worked like a charm, would not go from securelevel 1 and up). Feeling a lot better now. :) - Mark P.S. In case someone wondered, this is what I did: ----------------------------------------------- #include #include #include #include int main (void) { int fd; u_int8_t val; fd = open ("/dev/ppi0", O_RDWR); val = 0x01; ioctl (fd, PPISDATA, &val); ioctl (fd, PPIGCTRL, &val); val |= STROBE; ioctl (fd, PPISCTRL, &val); val &= ~STROBE; ioctl (fd, PPISCTRL, &val); } -----------------------------------------------