LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 05-24-2001, 02:35 PM   #1
prowzen
Member
 
Registered: Apr 2001
Location: Canada
Distribution: RH 7.0,
Posts: 89

Rep: Reputation: 15

Iam interested in driver programming. Most of the resources on the internet talks in depth about them. Iam looking for very general information on writing device drivers, like, what can be accomplished and what cannot be.
I have a certain hardware, like a Multifunction printer unit that wud run only on windows. Is there a way by which I can write my own device driver so that I can make it work with Linux? Can I write a driver for a device that I invent, so that I can control that hardware from my computer directly? What I need to know to accomplish these tasks?
Questions like these, basically....Iam an application programmer with very little knowledge on hardware and systems programming. Any suggestions on userful/good books/sites would also be helpful.
Any information that can point me to the correct direction is most appreciated.
 
Old 05-24-2001, 04:48 PM   #2
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Rep: Reputation: 45
Hmmm, I don't really know where I would start with that. I guess an understanding of the Kernel would be useful to start off with, so any books dealing with kernel hacking would be good.

Another place to look could be http://www.linuxdocs.org but not sure how useful they would be.

One piece of advice would be to practice on a computer that you don't mind messing up. Although I don't talk from experience I have read some of the early notes about Linus Torvalds work with the kernel, and it got messy!
 
Old 05-25-2001, 11:23 AM   #3
prowzen
Member
 
Registered: Apr 2001
Location: Canada
Distribution: RH 7.0,
Posts: 89

Original Poster
Rep: Reputation: 15
Thanks, Cragstar. Iam looking at the kernel basics right now from a document at the linuxdocs site. It looks a good place to begin with. I wanted to find out what one can do with driver programming...I mean what is feasible and what is not, you know, really general stuff on driver programming before I plunge into the topic. Is it theroetically possible for me to get my printer working on a linux box by writing my own driver or do I need any specific, undocumented information from the manufacturers to do so? do let me know your thoughts.
 
Old 05-25-2001, 02:01 PM   #4
jrockey
LQ Newbie
 
Registered: May 2001
Posts: 17

Rep: Reputation: 0
I don't know a lot about drivers on Linux either, but like you I'd like to investigate.

In principle, controlling hardware devices is generally quite easy. Devices I used (on other systems) tended to be "memory mapped". This means that control "ports" on the hardware device would be mapped so that they look like standard memory in a particular address range. As long as you know the specs of the device, then it's quite easy to construct a program to read and write to this pretend-memory to make the device do what you want. Most devices also generate interrupts when they need the computer to react to something quickly.

Linux drivers provide an interface between a device (which looks like a file) and the hardware. So for example the driver may be called when a character is written to your device (e.g. /dev/mydevice). It is then up to the driver to do something with this character - maybe write it so a particular memory-mapped location, or buffer it up, or write something to a control location on the device.

Of course this is just the broad principle - it can get more complicated than this. I am considering purchase a book which I have heard only superb reviews of called "Linux
Device Drivers" by Alessandro Rubini, published by
O'Reilly, ISBN 1-56592-292-1 (http://www.oreilly.com/catalog/linuxdrive/)

Also check out the

http://www.linuxdoc.org/LDP/tlk/tlk.html
(chapter 8)

and the outdated http://people.redhat.com/johnsonm/devices.html

 
Old 05-25-2001, 02:38 PM   #5
prowzen
Member
 
Registered: Apr 2001
Location: Canada
Distribution: RH 7.0,
Posts: 89

Original Poster
Rep: Reputation: 15
Perfect! Just the kind of information that Iam looking for. Thanks, Julian.
 
Old 06-04-2001, 04:48 PM   #6
prowzen
Member
 
Registered: Apr 2001
Location: Canada
Distribution: RH 7.0,
Posts: 89

Original Poster
Rep: Reputation: 15
A very good book

Came across this wonderful book and bought it at once. It's called 'Linux White Papers". Most of the chapters in the book are available online documents. It looks like a very good resource esp for someone who wants to learn the basics of kernel and driver programming.
 
Old 06-05-2001, 02:44 AM   #7
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Quote:
Originally posted by prowzen
Iam interested in driver programming. Most of the resources on the internet talks in depth about them. Iam looking for very general information on writing device drivers, like, what can be accomplished and what cannot be.
I have a certain hardware, like a Multifunction printer unit that wud run only on windows. Is there a way by which I can write my own device driver so that I can make it work with Linux? Can I write a driver for a device that I invent, so that I can control that hardware from my computer directly? What I need to know to accomplish these tasks?
Questions like these, basically....Iam an application programmer with very little knowledge on hardware and systems programming. Any suggestions on userful/good books/sites would also be helpful.
Any information that can point me to the correct direction is most appreciated.
This is of course assuming that you can successfuly monitor/probe/poke at/hack the windows-only device you want to make the driver for as a lot (most?) of the manufacturers don't publish specific interoperation info. The *&@#! Connectix Quickcam Home USB was a nice example. Nokia 51xx/61xx handsets (virtual modem drivers) is another. OTOH 3Com<--USRobotics did assist/do some open source drivers for WinModems and and NICs(I think). OR..

You could just get a lot of satisfaction by doing what a buddy of mine did to his talking LexBark inkjet. After shutting down his Winamp player he started doing some work stuff. It was time to print so did what most mortals do - he pushed the print button in the Excel toolbar. The job started spooling and as he walked away a VERY loud "PRINTING STARTED" boomed throughout the house. On his way back to silence the machine the printer ran out of paper (it lives across the room) and the computer now proudly announces "PRINTING ERROR" reapeating every 5 seconds. You can still see the mark on the oppsiste wall where the printer impacted and there are still pieces of ABS plastic embedded in the driveway. As he later stated - "You just can't buy any therapy that rewarding for $79. Anywhere." No loss as it was almost out of ink and refills are still $34.99 at Office Depot. The unfortunate part was that since the printer was no longer online, Excel died ungracefully.

The moral of the story? Sometimes rage is good, but always save before you print when using Windows.

We now return you to our regulary scheduled topic.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux device driver programming iammisc Programming 1 11-26-2005 10:46 AM
New Forum for Linux-Gurus[Programming/Administration] or Linux-Advanced Users [ Progr raees LQ Suggestions & Feedback 5 04-12-2005 07:35 PM
linux device driver programming chandansingh Programming 1 03-26-2005 07:30 AM
need some usb driver programming help glo Programming 3 10-27-2003 09:41 AM
Graphics Driver Programming XoSkely10 Programming 1 07-31-2002 02:26 PM


All times are GMT -5. The time now is 09:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration