From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 22 19:31:57 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 311331065677 for ; Wed, 22 Jul 2009 19:31:57 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-out2.uni-muenster.de (ZIVM-OUT2.UNI-MUENSTER.DE [128.176.192.9]) by mx1.freebsd.org (Postfix) with ESMTP id B7F688FC1B for ; Wed, 22 Jul 2009 19:31:56 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) X-IronPort-AV: E=Sophos;i="4.43,248,1246831200"; d="scan'208";a="219401339" Received: from zivmaildisp2.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.143]) by zivm-relay2.uni-muenster.de with ESMTP; 22 Jul 2009 21:31:55 +0200 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id 231641B0751; Wed, 22 Jul 2009 21:31:55 +0200 (CEST) Date: Wed, 22 Jul 2009 21:31:54 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Alexey Shuvaev Message-ID: In-Reply-To: <20090722162920.GA57243@wep4035.physik.uni-wuerzburg.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org 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: Wed, 22 Jul 2009 19:31:59 -0000 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. plus i want the app to be linux compatible and i don't think ppi exists on linux. 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? cheers. alex Alexey Shuvaev schrieb am 2009-07-22: > On Wed, Jul 22, 2009 at 12:43:20AM +0200, Alexander Best wrote: > > hi there, > > i've written an app in c (and a bit of asm) which needs to do raw > > parallel > > port io using the i386 opcodes in/out. to get the number of > > available parallel > > ports installed and their addresses i open and mmap /dev/mem and > > read the > > address-values from the BIOS area @ 0x408. is there a better way to > > find out > > the number of parallel ports installed and their addresses? > Why not to use /dev/ppi interface? > man 4 ppi > It is in GENERIC kernel. > You don't need assembler then. > You can look at your dmesg to count all ppc parallel ports: > [snip] > ppc0: port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on > acpi0 > ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode > ppc0: FIFO with 16/16/9 bytes threshold > ppc0: [ITHREAD] > ppbus0: on ppc0 > plip0: on ppbus0 > plip0: [ITHREAD] > lpt0: on ppbus0 > lpt0: [ITHREAD] > lpt0: Interrupt-driven port > ppi0: on ppbus0 > [snip] > Alexey.