Simple Printer Support

Ron Hudson <[email protected]> Sun, 12 Oct 2003 08:40:49 -0500
Newsgroups gmane.linux.tomsrtbt
Message-ID <[email protected]>
Hi,

I'm Ron Hudson, and I am using TOMSRTBT to run a small floppy only 
laptop with 8mb memory!
I'm going to be making it a more general linux.

----

I wanted printer support for a text printer (I read paper better than I 
read screens)
so I copied lp_o from the add-ons (add-ons/Kernel/misc/lp_o.bz) then 
added the following
lines to rc.custom.bz

cp /fl/lp_o /lib/modules/lp_o
insmod /lib/modules/lp_o


I also wrote my own lp in Lua

#! /usr/bin/lua
line = 3
page = 1
pagezize = 60
outs = writeto("/dev/lp0")
write("Page ",page," date:",date("%A B D Y %H:%M"),"\n")
write("============================================================\n")
repeat
	if line == pagezize then
	    
write("============================================================\n")
		write("Page ",page," date:",date("%A %B %D %Y %H:%M "),"\f")
	  	line = 3
		write("Page ",page," date:",date("%A %B %D %Y %H:%M "),"\n")
	    
write("============================================================\n")
		page = page + 1
	end
	line = line + 1
	thisline = read("*line")
	if thisline ~= nil then
		write(thisline,"\n")
	end		
until thisline == nil
repeat
     write("\n")
     line = line + 1
until line == pagezize
write("============================================================\n")
write("Page  ",page," date:",date("%A %B %d  %Y %H:%M "),"\f");


I put that in the root of the floppy with lp_o and settings.s. Perhaps 
it could have
been added as a here-document in rc.custom (it could be compressed that 
way).