Installing a Parallel Port in Linux (A) OBTAINING RESOURCE ASSIGNMENT OF PARALLEL CARD ISA CARD If you are installing an ISA card the resource assignments are configured by the jumpers. Consult the documentation for that card to obtain the resource assignments associated with the jumper settings. PCI CARD Linux reports the resource assignments of PCI cards. The following instruction will report the resource assignment of all the PCI cards. lspci -v The output lists the PCI devices on the system. The following are examples of our card in that output. Lava Parallel PCI 00:0a.0 Parallel controller: Lava Computer mfg Inc Lava Parallel (prog-if 01 [BiDir]) Flags: slow devsel, IRQ 12 I/O ports at 6100 Lava Dual Parallel PCI port A 00:0b.0 Parallel controller: Lava Computer mfg Inc Lava Dual Parallel port A (prog-if 01 [BiDir]) Flags: slow devsel, IRQ 12 I/O ports at 6400 Lava Dual Parallel PCI port B 00:0b.1 Parallel controller: Lava Computer mfg Inc Lava Dual Parallel port B (prog-if 01 [BiDir]) Flags: slow devsel, IRQ 12 I/O ports at 6500 On this system there is a single Lava parallel PCI at port address 0x6100 and IRQ 12, and a Lava Dual Parallel PCI port A at port address 0x6400 and IRQ 12 and port B at port address 0x6500 and IRQ 12. The 0x signifies that this port address is in hexadecimal. (B) ASSIGNING RESOURCE ASSIGNMENTS OF PARALLEL PORT TO LINUX Linux does hold resource assignments of the parallel ports in the system. These resource assignments are held in the file as well as resource assignments of other cards such as network cards. The file is /etc/conf.modules The following is an example of the parallel port assignments in that file. alias parport_lowlevel parport_pc options parport_pc io=0x378 irq=7 where io=0x378 is the IO assignment of the first (onboard) parallel port. where irq=7 is the IRQ assignments of the first parallel port. Initially, the Lava resource assignments will not be in this file. It is necessary to manually edit this file to add the resource assignments obtained from step (A) above. The following is an example the dual parallel PCI's resource assignments added to this file. alias parport_lowlevel parport_pc options parport_pc io=0x378,0x6400,0x6500 irq=7,auto,auto where io=0x378,0x6400,0x6500 are the IO assignments of the first, second and third parallel port respectively. These IO assignments are obtained from step (A) above. The second and third parallel port being the Port A and B of the dual parallel PCI respectively. where irq=7,auto,auto are the IRQ assignments of the first, second and third parallel port respectively. These IRQ assignments are obtained from step (A) above. The second and third parallel port being the Port A and B of the dual parallel PCI respectively or auto can be used instead. At this point the parallel ports are enabled and are ready to be used. Below are notes for adding the fourth + parallel port in Linux. Linux already has support for lp0 lp1 and lp2 1) Creating the devices in /dev: /mknod -m 666 /dev/lp3 c 6 3 -m= mode; 666 is read write for every one /dev/lp3 = fourth lpt c = character device 6 = Major; I think it stands for what kind of device it is. 3 = Minor; lp #; so if lp3 then this is 3, lp4 then this is 4 etc. 2) Changing it to Daemon chgrp daemon /dev/lp3 This enables this device we added as a daemon. A daemon is a program that runs in the background to perform critical system tasks. In our case parallel port functions. 3) Repeat these steps (1,2) for each parallel that needs to be added incrementing the lp and the Minor as each port is added. 4) Add the IO port assignments and IRQs to Linux as instructed in step (A) above. At this point the parallel ports are enabled and are ready to be used.