Tiny Core Base > Micro Core

[Solved] How to add lp (parport printing) module?

(1/2) > >>

bonbob:
Hi all!
I have an HP LaserJet 1000 printer. It's connected via USB locally on PC with Debian 12 and works fine.
Resently i decided to make this printer as network printing device.
As far as my router is just thin client with tinycore x86 OS i made next steps:
Connect printer via USB on thin client. New device /dev/usb/lp0 has appeared
Load printer firmware (printer store it in RAM and need to load it each time as it powered on)

--- Code: --- cat hp1000.fw > /dev/usb/lp0

--- End code ---
Printer initialized sucserssfully. LED indicators start flashing and all mecanisms come into motion

HP LaserJet 1000 prints in raw zenographics format, so i saved test document in this format and send it to printer

--- Code: --- cat test.zjs > /dev/usb/lp0

--- End code ---
Printer does not react on it. No printing, no errors or warnings.
I do the same on Debian and printer do it's job perfectly.
Next step was to compare tinycore and debian and found differences. And i found it.
On tinycore:

--- Code: ---lsmod | grep parport
parport_pc            0
parport                 2 ppdev,parport_pc

--- End code ---

On Debian:

--- Code: ---lsmod | grep parport
parport_pc             0
parport                  2 ppdev,parport_pc,lp

--- End code ---

lp adding printer support or something in this case? Сorrect me if i wrong. How can i solve this problem?

Rich:
Hi bonbob
lp.ko.gz  is part of the base.

--- Code: ---tc@box:~$ modinfo lp
filename:       /lib/modules/6.1.2-tinycore64/kernel/drivers/char/lp.ko.gz
license:        GPL
alias:          char-major-6-*
depends:        parport
intree:         Y
vermagic:       6.1.2-tinycore64 SMP mod_unload
--- End code ---
Is it loaded?

If not, add this to  /opt/bootlocal.sh:

--- Code: ---modprobe lp
--- End code ---

Also,  parport_pc  can accept several parameters (parm:):

--- Code: ---tc@box:~$ modinfo parport_pc
filename:       /lib/modules/6.1.2-tinycore64/kernel/drivers/parport/parport_pc.ko.gz
author:         Phil Blundell, Tim Waugh, others
description:    PC-style parallel port driver
license:        GPL
parm:           init_mode:Initialise mode for VIA VT8231 port (spp, ps2, epp, ecp or ecpepp)
parm:           verbose_probing:Log chit-chat during initialisation
parm:           dma:DMA channel
parm:           irq:IRQ line
parm:           io_hi:Base I/O address (ECR)
parm:           io:Base I/O address (SPP regs)
alias:          pci:v00001C00d00003050sv00001C00sd00003050bc*sc*i*
alias:          pci:v0000135Cd00000278sv*sd*bc*sc*i*
 ----- Snip -----
alias:          acpi*:PNP0401:*
alias:          pnp:dPNP0401*
alias:          acpi*:PNP0400:*
alias:          pnp:dPNP0400*
depends:        parport
intree:         Y
vermagic:       6.1.2-tinycore64 SMP mod_unload
--- End code ---
See if debian is setting any of them.

Rich:
Hi bonbob
I decided to conduct a quick experiment on one of my systems.

First I loaded parport_pc:

--- Code: ---tc@box:~$ sudo modprobe parport_pc
tc@box:~$ lsmod | grep parport
parport_pc             24576  0
parport                32768  2 ppdev,parport_pc
--- End code ---

Then I loaded lp:

--- Code: ---tc@box:~$ sudo modprobe lp
tc@box:~$ lsmod | grep parport
parport_pc             24576  0
parport                32768  3 lp,ppdev,parport_pc
--- End code ---

If they are loaded in the opposite order you get this:

--- Code: ---tc@box:~$ sudo modprobe lp
tc@box:~$ lsmod | grep parport
parport                32768  1 lp
tc@box:~$ sudo modprobe parport_pc
tc@box:~$ lsmod | grep parport
parport_pc             24576  0
parport                32768  3 ppdev,parport_pc,lp
--- End code ---
Though I don't think that matters.

bonbob:
Problem was in incorrect udev rule. There was two actions 'add' (and 'bind') each time as USB cable was plugged in.
udev triggered them and loads printer firmware twice at one time. First load sucsessfuly initialize printer, but second try caued deep glitch of the device.
Printer not responsed anymore, till it powered down and swiched on again.

Anyway, thank you for help. Your post was useful for me to understand and practice module mechanism in linux more deeper.  :)

Rich:
Hi bonbob

--- Quote from: bonbob on March 30, 2025, 03:21:37 AM ---Problem was in incorrect udev rule. ...
--- End quote ---
Was this a rule you created, or is this a rule from an extension?


--- Quote --- ... Your post was useful for me to understand and practice module mechanism in linux more deeper.  :)
--- End quote ---
Glad I could help.

I will mark your thread as solved.

Navigation

[0] Message Index

[#] Next page

Go to full version