LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-23-2005, 04:01 AM   #1
happy_maoron
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Rep: Reputation: 0
Where should I start if want to learn writing drivers under linux??


I want some sample code about simple drivers under linux. Not the "Hello world" or "Scull" sample code, it doesn't tell me how to conmunicate with typical peripheral devices. I think a driver visits its device by writing or reading a number of bytes via the physical adddress, ant it's pretty easy by using assembler language. I don't know how to deal with this under linux by using the kernel functions.

And I know I should have some knoledge about linux kernel and finish reading the book "Linux Device Drivers". But it is a thick book and I want to have a quick start to understanding some basic features during writing a linux driver. Where can I find these kind of information?

Thanks for your help!
 
Old 10-23-2005, 06:35 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Most drivers are just loadable kernel modules, so you should start with Linux Loadable Kernel Module HOWTO
 
Old 10-23-2005, 10:16 PM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Linux Device Drivers Vol 2 (2.4 kernel)
Linux Device Drivers Vol 3 (2.6 kernel)

The above links are free books that cover pretty much everything about how to make device drivers and kernel modules.
 
Old 10-24-2005, 01:24 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
I think a driver visits its device by writing or reading a number of bytes via the physical adddress, and it's pretty easy by using assembler language.
This statement is quite optimistic ...
 
Old 10-24-2005, 01:21 PM   #5
dhirsolo
Member
 
Registered: Apr 2005
Location: India
Distribution: RHEL, Fedora Core , SUSE, Ubuntu, etc
Posts: 54

Rep: Reputation: 15
Hi

Thanks for the valuable links.

Regards
 
Old 10-24-2005, 03:39 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
The best possible resource, however, is the source-code itself. Look through the existing drivers to find one that is remotely similar to the one that you want.
 
  


Reply



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
Writing Linux Device Drivers pr@vn_t Programming 3 08-22-2005 08:52 PM
online courses: I want to learn everything - where should I start sunowww General 6 03-17-2004 09:55 AM
want to learn programming but not sure where to start SurferRoxyChiq Programming 6 01-14-2004 12:08 PM
Gotta learn to crawl...DHCP is writing no leases for my Win ME laptop?! yurlittlepony Linux - Networking 2 05-31-2003 08:20 PM
Writing NVIDIA drivers to CD on Windows, then running on Linux? tmadhavan Linux - Software 10 09-26-2002 01:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration