Date: Wed, 22 Jul 2009 18:29:20 +0200 From: Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de> To: Alexander Best <alexbestms@math.uni-muenster.de> Cc: freebsd-hackers@FreeBSD.org Subject: Re: checking number of parallel ports installed and their port adresses Message-ID: <20090722162920.GA57243@wep4035.physik.uni-wuerzburg.de> In-Reply-To: <permail-20090721224320f7e55a9d0000715f-a_best01@message-id.uni-muenster.de> References: <permail-20090721224320f7e55a9d0000715f-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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: <Parallel port> 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: <Parallel port bus> on ppc0 plip0: <PLIP network interface> on ppbus0 plip0: [ITHREAD] lpt0: <Printer> on ppbus0 lpt0: [ITHREAD] lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 [snip] Alexey.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090722162920.GA57243>
