From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 24 10:42:38 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36AA51065673; Fri, 24 Jul 2009 10:42:38 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-out3.uni-muenster.de (ZIVM-OUT3.UNI-MUENSTER.DE [128.176.192.18]) by mx1.freebsd.org (Postfix) with ESMTP id 92FFC8FC19; Fri, 24 Jul 2009 10:42:37 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) X-IronPort-AV: E=Sophos;i="4.43,262,1246831200"; d="scan'208";a="9278652" Received: from zivmaildisp2.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.143]) by zivm-relay3.uni-muenster.de with ESMTP; 24 Jul 2009 12:42:34 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 8EDCF1B0765; Fri, 24 Jul 2009 12:42:34 +0200 (CEST) Date: Fri, 24 Jul 2009 12:42:34 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: John Baldwin , Message-ID: In-Reply-To: <200907230833.43021.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Alexey Shuvaev Subject: Re: checking number of parallel ports installed and their port adresses X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 10:42:38 -0000 thanks for the hint. if spent a bit of time and turned the in/out opcodes to ppi ioctls. actually i was very surprised about the results since you said the overhead wouldn't be that big. uploading a 256 kbyte file i got the following results: using ppi: 17.120 seconds using in/out opcodes: 8.001 seconds so i think i'll rather stick to my old inline assembly code even if it can't be considered nice programming style, but the ppi overhead isn't something i can cope with in my app. cheers. alex John Baldwin schrieb am 2009-07-23: > On Wednesday 22 July 2009 3:31:54 pm Alexander Best wrote: > > the ppi manual states that using ioctl with /dev/ppi is extremely > > slow. i need > > the parallel port to be really fast. i need to communicate with a > > device that > > uses asynchronous transfer at a rate of ~ 2 mhz. so i need the full > > ISA bus > > speed to be able to push/pull data to/from the parallel port > > without any > > delays. timing is really critical. if there's a lot of work to do > > for the > > scheduler and the io calls get queued too long the transfer will > > fail. > The overhead of ppi is probably in the noise on a modern CPU. I > think you > should be fine with just using ppi(4). > > actually i meant: how can i check the available parallel ports from > > within my > > app? is there a syscall i can use or something like that? > You can look for ppcX devices perhaps. The easiest way might be to > enable > ppi and look for /dev/ppiX devices in /dev.