OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Nov 21, 2017 4:01 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Printers and Scanners
PostPosted: Fri Jun 10, 2016 11:11 am 
Offline
Member
Member
User avatar

Joined: Wed Jun 17, 2015 9:40 am
Posts: 426
Location: Athens, Greece
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

_________________
Before implementing any piece of software, make sure you have designed it to be extendable. Backporting new features into old code is not always easy.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Fri Jun 10, 2016 12:45 pm 
Offline
Member
Member

Joined: Fri Jan 30, 2015 4:57 pm
Posts: 215
Location: Germany
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.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Fri Jun 10, 2016 2:51 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 284
Location: USA
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


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Fri Jun 10, 2016 5:37 pm 
Offline
Member
Member

Joined: Fri Jan 30, 2015 4:57 pm
Posts: 215
Location: Germany
BenLunt wrote:
My USB book

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


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Fri Jun 10, 2016 5:52 pm 
Offline
Member
Member

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

_________________
Mike Gonta
look and see - many look but few see

http://mikegonta.com


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sat Jun 11, 2016 2:46 am 
Offline
Member
Member
User avatar

Joined: Wed Jun 17, 2015 9:40 am
Posts: 426
Location: Athens, Greece
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

_________________
Before implementing any piece of software, make sure you have designed it to be extendable. Backporting new features into old code is not always easy.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sat Jun 11, 2016 6:12 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3008
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sat Jun 11, 2016 1:03 pm 
Offline
Member
Member
User avatar

Joined: Wed Jun 17, 2015 9:40 am
Posts: 426
Location: Athens, Greece
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

_________________
Before implementing any piece of software, make sure you have designed it to be extendable. Backporting new features into old code is not always easy.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sat Jun 11, 2016 2:42 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1010
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: C64 Porting OS

"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sat Jun 11, 2016 11:21 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3008
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sun Jun 12, 2016 5:38 am 
Offline
Member
Member
User avatar

Joined: Wed Jun 17, 2015 9:40 am
Posts: 426
Location: Athens, Greece
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

_________________
Before implementing any piece of software, make sure you have designed it to be extendable. Backporting new features into old code is not always easy.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sun Jun 12, 2016 6:38 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3008
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sun Jun 12, 2016 8:55 am 
Offline
Member
Member
User avatar

Joined: Wed Jun 17, 2015 9:40 am
Posts: 426
Location: Athens, Greece
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

_________________
Before implementing any piece of software, make sure you have designed it to be extendable. Backporting new features into old code is not always easy.


Top
 Profile  
 
 Post subject: Re: Printers and Scanners
PostPosted: Sun Jun 12, 2016 9:10 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3008
Location: Chichester, UK
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group