From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 22 16:29:26 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 931DE106566C for ; Wed, 22 Jul 2009 16:29:26 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 1CE9F8FC13 for ; Wed, 22 Jul 2009 16:29:26 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id CF86E19927D; Wed, 22 Jul 2009 18:29:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id C097F199256; Wed, 22 Jul 2009 18:29:21 +0200 (CEST) Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id AB6B8199250; Wed, 22 Jul 2009 18:29:21 +0200 (CEST) Received: from wep4035 ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.0.2FP1HF244) with ESMTP id 2009072218292019-110895 ; Wed, 22 Jul 2009 18:29:20 +0200 Received: by wep4035 (sSMTP sendmail emulation); Wed, 22 Jul 2009 18:29:20 +0200 Date: Wed, 22 Jul 2009 18:29:20 +0200 From: Alexey Shuvaev To: Alexander Best Message-ID: <20090722162920.GA57243@wep4035.physik.uni-wuerzburg.de> Mail-Followup-To: Alexander Best , freebsd-hackers@FreeBSD.org References: Mime-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.4.2.3i Organization: Universitaet Wuerzburg X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.0.2FP1HF244 | April 7, 2009) at 07/22/2009 06:29:20 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.0.2FP1HF244 | April 7, 2009) at 07/22/2009 06:29:20 PM, Serialize complete at 07/22/2009 06:29:20 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de 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 16:29:26 -0000 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.