OSDev.org
https://forum.osdev.org/

Printers and Scanners
https://forum.osdev.org/viewtopic.php?f=8&t=30448
Page 1 of 1

Author:  glauxosdever [ Fri Jun 10, 2016 11:11 am ]
Post subject:  Printers and Scanners

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

Author:  Techel [ Fri Jun 10, 2016 12:45 pm ]
Post subject:  Re: Printers and Scanners

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.

Author:  BenLunt [ Fri Jun 10, 2016 2:51 pm ]
Post subject:  Re: Printers and Scanners

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

Author:  Techel [ Fri Jun 10, 2016 5:37 pm ]
Post subject:  Re: Printers and Scanners

BenLunt wrote:
My USB book

Mind if you post link? Such a book would be useful.

Author:  mikegonta [ Fri Jun 10, 2016 5:52 pm ]
Post subject:  Re: Printers and Scanners

Techel wrote:
BenLunt wrote:
My USB book
Mind if you post link? Such a book would be useful.
BenLunt wrote:

Author:  glauxosdever [ Sat Jun 11, 2016 2:46 am ]
Post subject:  Re: Printers and Scanners

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

Author:  iansjack [ Sat Jun 11, 2016 6:12 am ]
Post subject:  Re: Printers and Scanners

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.

Author:  glauxosdever [ Sat Jun 11, 2016 1:03 pm ]
Post subject:  Re: Printers and Scanners

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

Author:  SpyderTL [ Sat Jun 11, 2016 2:42 pm ]
Post subject:  Re: Printers and Scanners

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.

Author:  iansjack [ Sat Jun 11, 2016 11:21 pm ]
Post subject:  Re: Printers and Scanners

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.

Author:  glauxosdever [ Sun Jun 12, 2016 5:38 am ]
Post subject:  Re: Printers and Scanners

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

Author:  iansjack [ Sun Jun 12, 2016 6:38 am ]
Post subject:  Re: Printers and Scanners

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.

Author:  glauxosdever [ Sun Jun 12, 2016 8:55 am ]
Post subject:  Re: Printers and Scanners

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

Author:  iansjack [ Sun Jun 12, 2016 9:10 am ]
Post subject:  Re: Printers and Scanners

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/