Printers and Scanners

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Printers and Scanners

Post by glauxosdever »

Hi,


I noticed that the wiki has no pages about interfacing with printers, scanners and fax machines, so I would like this gap to be filled in. Unfortunately, I never implemented drivers for them yet, therefore I am by definition unable to write about this topic. If anyone knows anything about this, please write about it on the wiki, provided he also has the time.

To be fair, I looked into the PCL and PJL specifications, and I tried to make a printing job from within Linux. The printer seemed to receive the bytes through the cat program, but never printed. The PCL and PJL were according to various examples, so it seems there is also another communication layer (possibly handled by lp* programs). This means the job of writing a wiki page about this is, unfortunately, harder.


Regards,
glauxosdever
Techel
Member
Member
Posts: 215
Joined: Fri Jan 30, 2015 4:57 pm
Location: Germany
Contact:

Re: Printers and Scanners

Post by Techel »

I actually never thought of printers when it comes to osdev. Graphics, sound, network, this and that architecture, whatever - but no one ever mentioned printers.
Writing a wiki entry would be awesome.
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Printers and Scanners

Post by BenLunt »

Since most consumer printers are now USB, you would have to have a USB driver first. (smile)

There are two types of printers, those that have a main processor and those that don't.

Have you ever wondered why you can buy a HP inkjet printer for 20 USD? Other than the cost of the ink, which is outrageous, there is no money to be made. However, the printer has no main processor. All of the image processing is done by the host before it is sent to the printer. These are called Host-Based printers. This slows down your computer and could degrade the actual image printed. In fact, the manufacture will even put on the labeling, "not intended for .pfd files".

A good printer, which costs more the 20 USD, has a main processor and does all of the image processing on board. These printers may use the PCL protocol.
Fortunately, the USB specifications gives a class that will allow you to find out what type of printer you have and how to communicate with it.

My USB book, other than explaining how to build a USB stack (smile), shows how to communicate with a USB printer, and takes you step by step on printing an actual image to the printer.

Other printers, including non-consumer printers, are networked based and you will need a network driver along with the protocol to send images to that type of printer.

On a different note, and to bring back the day, remember the dot matrix printers? You sent a command and a bitmap to the printer, which would then push out specified pins to create the image. You could print just about anything, in black ink of course, by only sending bitmaps of pins to fire.

Scanners are a different form of communication, which also use USB (smile). Scanners usually use the TWAIN style interface.

Anyway, to print to a printer, you need to make sure you know what type of printer it is and what protocol it uses. Not to discourage anyone from making a wiki page about it, there are many different aspects one would need to know. My book only discusses USB type printers, using the PCL and IEEE 1284 protocols for uni- and bi-directional transports.

If you wish to start, research the PCL and IEEE 1284 protocols.

Ben
http://www.fysnet.net/the_universal_serial_bus.htm
Techel
Member
Member
Posts: 215
Joined: Fri Jan 30, 2015 4:57 pm
Location: Germany
Contact:

Re: Printers and Scanners

Post by Techel »

BenLunt wrote: My USB book
Mind if you post link? Such a book would be useful.
mikegonta
Member
Member
Posts: 229
Joined: Thu May 19, 2011 5:13 am
Contact:

Re: Printers and Scanners

Post by mikegonta »

Techel wrote:
BenLunt wrote:My USB book
Mind if you post link? Such a book would be useful.
Mike Gonta
look and see - many look but few see

https://mikegonta.com
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Printers and Scanners

Post by glauxosdever »

Hi,

BenLunt wrote:There are two types of printers, those that have a main processor and those that don't.

Have you ever wondered why you can buy a HP inkjet printer for 20 USD? Other than the cost of the ink, which is outrageous, there is no money to be made. However, the printer has no main processor. All of the image processing is done by the host before it is sent to the printer. These are called Host-Based printers. This slows down your computer and could degrade the actual image printed. In fact, the manufacture will even put on the labeling, "not intended for .pfd files".

A good printer, which costs more the 20 USD, has a main processor and does all of the image processing on board. These printers may use the PCL protocol.
Fortunately, the USB specifications gives a class that will allow you to find out what type of printer you have and how to communicate with it.
BenLunt wrote:Other printers, including non-consumer printers, are networked based and you will need a network driver along with the protocol to send images to that type of printer.

On a different note, and to bring back the day, remember the dot matrix printers? You sent a command and a bitmap to the printer, which would then push out specified pins to create the image. You could print just about anything, in black ink of course, by only sending bitmaps of pins to fire.
BenLunt wrote:Anyway, to print to a printer, you need to make sure you know what type of printer it is and what protocol it uses. Not to discourage anyone from making a wiki page about it, there are many different aspects one would need to know.
All of this is indeed interesting text to put in the page, though analyzing USB printers more than other printers is not what I intended for this page.
BenLunt wrote:If you wish to start, research the PCL and IEEE 1284 protocols.
To start implementing it in my OS, you mean. Just reading some protocols is never enough to write a wiki page about it, right? :)


Regards,
glauxosdever
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Printers and Scanners

Post by iansjack »

The fact is that most printers nowadays are USB connected (or network connected, which is just as complicated). It's also a very wide topic as there are big differences between printers from different manufacturers, or even within their own product line. If you just want to support a printer then probably the best solution is Postscript, which is simply a programming language and is well documented. Or you could look at PCL, again well documented. Really, this is client program stuff rather than core OS.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Printers and Scanners

Post by glauxosdever »

Hi,

iansjack wrote:The fact is that most printers nowadays are USB connected (or network connected, which is just as complicated). It's also a very wide topic as there are big differences between printers from different manufacturers, or even within their own product line. If you just want to support a printer then probably the best solution is Postscript, which is simply a programming language and is well documented. Or you could look at PCL, again well documented. Really, this is client program stuff rather than core OS.
Either way, I think it should be described on the wiki.

Another question, is PCL/Postscript raw, or should there be some printer specific command headers or something? I tried sending PCL to printer, but it didn't respond as expected. So I don't know.


Regards,
glauxosdever
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Printers and Scanners

Post by SpyderTL »

If there is a wiki page on floppy controllers, there should be one on LPT ports and printing to legacy printers. Not sure how you'd test it, though. :)

Actually, there's already a page on parallel port that includes information about printing text to the printer.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Printers and Scanners

Post by iansjack »

I'm not sure that if you were starting the Wiki now you would include a page on floppy controllers. I haven't seen one for years. What about tape drives, Zip drives, Z80 processors, other obsolete hardware. If people really want to contribute pages on these topics go ahead, but I'm not sure that requests for others to do so are going to get very far.

If you think a page is needed then write one. If it means doing some research first then do it.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Printers and Scanners

Post by glauxosdever »

Hi,

iansjack wrote:If you think a page is needed then write one. If it means doing some research first then do it.
I agree with this one, except you missed out experience. You can't write a wiki page if you don't have experience with the topic you write about. If no one has the experience, well, I think I will have to wait until I get the experience. :)


Regards,
glauxosdever
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Printers and Scanners

Post by iansjack »

glauxosdever wrote:If no one has the experience, well, I think I will have to wait until I get the experience.
If no-one with the experience thinks it worth spending their time writing such a Wiki page.

I agree with your conclusion. Use this as a challenge and an opportunity to do the research, gain the experience, and finally write the Wiki page. That's the whole point of this hobby, isn't it - to learn.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Printers and Scanners

Post by glauxosdever »

Hi,

iansjack wrote:If no-one with the experience thinks it worth spending their time writing such a Wiki page.
I don't parse it, though I think I get what you mean. Could you please clarify what do you mean exactly?


Regards,
glauxosdever
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Printers and Scanners

Post by iansjack »

I mean it may be that there are people who have the requisite experience but don't think it is a topic that they want to spend time writing a Wiki page about.
Post Reply