Page 1 of 1
Printer
Posted: Wed Oct 29, 2003 12:00 am
by kolls
How can I send some chars to the printer?
RE:Printer
Posted: Wed Oct 29, 2003 12:00 am
by Brill
Printer as in, that thing that prints out onto paper?
Urm, well i think its a little more complicated than your making out to be. Its not like puting chars in video memory with vga.
Lets see, device drivers. Your printer will use a format. Something like postscript i think, im not that fluent in how printers work exactly.
You'll need drivers to support communication. i.e. it must be connected somehow right, usb, parallel etc.
This all needs a lot of your kernel to be complete like memory management, driver management.
If you could come up with some form of device driver management, and a standard printer spooler system, you could probably make all printers in your os sort of 'dynamic' so 'chars' are converted to postscript (if necessary), which are sent to the print spooler, which is directed to the printer driver, which is sent to the printer.
Dangamoose.
RE:Printer
Posted: Wed Oct 29, 2003 12:00 am
by carbonBased
Actually... it really _is_ just as simple as putting characters into video memory... at least if you're only looking to output text.
Assuming you have a parallel port driver, you can just write characters to it. Not unlike:
cat "This will be printed on my printer" > /dev/lp0
Each printer will have its own language for special characters, etc. If it's an Epson, I used to have a copy of the Esc/P2 language that most epson's use (esentially, you just send an escape character (char)27, and then a code (0xB for bold, for example (that's not right... just an example
)
If you're gettin' more advanced, graphics wise, then you'll have to write everything in the specific printer's language. There is no standard printer language, although most support/emulate HP or Epson's languages (and most/all of the expensive printers will print postscript directly).
Cheers,
Jeff
RE:Printer
Posted: Thu Oct 30, 2003 12:00 am
by kolls
but, where can i find the printers' languages?
RE:Printer
Posted: Thu Oct 30, 2003 12:00 am
by carbonBased
You can find a few of the more popular languages here:
http://www.wotsit.org/search.asp?s=printer
Or if you mean, which printer supports which language... you'd have to ask the manufacturer
It should say in the manual as well.
I remember, back in the old days, all the printer manuals used to contain an appendix which described the language, and usually gave some BASIC source code for controlling it.... those days are long gone
Cheers,
Jeff