checking number of parallel ports installed and their port adresses

Alexey Shuvaev shuvaev at physik.uni-wuerzburg.de
Wed Jul 22 16:29:26 UTC 2009


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.


More information about the freebsd-hackers mailing list