From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 15 03:38:32 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04C5716A4CE for ; Tue, 15 Mar 2005 03:38:32 +0000 (GMT) Received: from arginine.spc.org (arginine.spc.org [83.167.185.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4263F43D2D for ; Tue, 15 Mar 2005 03:38:31 +0000 (GMT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 930F66520C; Tue, 15 Mar 2005 03:35:46 +0000 (GMT) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01066-07; Tue, 15 Mar 2005 03:35:46 +0000 (GMT) Received: from empiric.dek.spc.org (dhcp120.icir.org [192.150.187.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 6568F651F4; Tue, 15 Mar 2005 03:35:45 +0000 (GMT) Received: by empiric.dek.spc.org (Postfix, from userid 1001) id 8AF0367B9; Mon, 14 Mar 2005 19:38:47 -0800 (PST) Date: Mon, 14 Mar 2005 19:38:47 -0800 From: Bruce M Simpson To: Matt Kory Message-ID: <20050315033847.GA8085@empiric.icir.org> Mail-Followup-To: Matt Kory , freebsd-hackers@FreeBSD.org References: <5e52cc0005031419056fdf10c6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5e52cc0005031419056fdf10c6@mail.gmail.com> cc: freebsd-hackers@FreeBSD.org Subject: Re: poll or select for ppi? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2005 03:38:32 -0000 On Mon, Mar 14, 2005 at 10:05:34PM -0500, Matt Kory wrote: > Is it possible to use poll or select to detect a change in the status > bits of the parallel port? I tried something like this, and took bits > 5 and 6 of the status register low and nothing seemed to happen. Is > what I am trying to do even possible, or I am supposed to take a > certain bit low to cause a read event? Any help is appreciated. Disclaimer: I'm no expert on the parallel port. The man page for ppi(4) says that all I/O is via ioctl(), which isn't covered by the select() mechanism. You'd either have to poll PPIGSTATUS from userland on a timer, or perhaps hack the driver to use a kevent. Considering there's probably no way to get a hardware interrupt for the status change directly via ppi(4), you might need to consider writing a set of custom ppbus microsequences and a driver for your application. Regards, BMS