Re: ISSUE: lp0/lp1 incompatibility

Philip Blundell (pb@nexus.co.uk)
Thu, 04 Dec 1997 09:29:03 +0000


In message <87oh2x9ang.fsf@garfield.complete.org>, John Goerzen writes:
>It seems to me that there is an "off by one" error somewhere in the
>kernel. Or was it intentional to make this change? And if so, why?
>I understand that most devices start at 0 but we already have
>considerable precedent with this one. If we want to start at 0 with
>it, perhaps create a new name like /dev/lpt0? This way, compatibility
>can be maintained.

It's not an error. The problem is that the 2.0 lp driver assigns devices to
fixed addresses, so lp1 is the port at 0x378 (which is the only one on most
PCs), lp0 is at 0x3bc and lp2 is at 0x278. The 2.1 driver, though, sits on
top of the `parport' parallel access layer, and assigns lp devices
sequentially to the ports it finds - so lp0 will, by default, be your first
printer port regardless of where it is. This happened because preserving the
old behaviour by default was going to be hard, and not necessarily too
desirable either.

It was certainly the intention that you be able to bind lp devices (and PLIP
devices, ppa devices, ...) to parallel ports explicitly, if you wanted to, so
that you could force lp1 to connect to parport0. I think the syntax for doing
this was going to be something like:

boot: linux lp=none,parport0,parport1

or
# insmod lp.o parport=-1,0,1

both of which would give you no lp0, lp1 bound to the first printer port and
lp2 bound to the second printer port. However, I'm not sure if this ever got
implemented fully, and even if it did it may have been broken since. If
somebody would like to try it out and send patches, then feel free.

(If this isn't mentioned in Documentation/parport.txt, it probably should be.)

p.