[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/43683: puc(4) could be more useful
>Synopsis: puc(4)-based parallel ports' addresses are not printed
>Arrival-Date: Thu Jul 29 13:00:01 +0000 2010
>Originator: Pierre Pronchery
>Release: NetBSD 5.1_RC2
System: NetBSD kwarx.defora.lan 5.1_RC2 NetBSD 5.1_RC2 (GENERIC) #2: Fri Jun 11
21:15:51 CEST 2010
puc(4) is a driver for PCI extension cards, providing extra serial and
parallel ports to the computer. Many existing programs interacting with
the parallel port, do so by means of the ioperm() or iopl() calls, and
then perform inb()/outb() requests.
However, these programs require an address to open the desired hardware
port; unfortunately, there is currently no way of knowing this address:
it is not printed at any time by the kernel.
Connect a puc(4)-based PCI card to the computer. Boot and look for a way
to access it through the ioperm/iopl/inb/outb interfaces.
The patch below simply enables a call to printf(), already found in the
code, that does print the proper address (held in paa.a). It could
probably be modified to look more obvious to the user.
RCS file: /cvsroot/src/sys/dev/pci/puc.c,v
retrieving revision 1.31
diff -p -u -r1.31 puc.c
--- sys/dev/pci/puc.c 9 Jul 2008 14:46:15 -0000 1.31
+++ sys/dev/pci/puc.c 29 Jul 2010 12:50:22 -0000
@@ -288,7 +288,7 @@ puc_attach(device_t parent, device_t sel
paa.h = subregion_handle;
printf("%s: port %d: %s @ (index %d) 0x%x (0x%lx, 0x%lx)\n",
puc_port_type_name(paa.type), barindex, (int)paa.a,
Main Index |
Thread Index |