LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-03-2007, 06:10 AM   #1
drimades
Member
 
Registered: Jun 2006
Posts: 60

Rep: Reputation: 15
Preparing Linux drivers


To prepare a Linux driver for a device, do I have to program in assembler too or just in C?
 
Old 05-03-2007, 07:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
most drivers are written in c, but you've really not given much information here...
 
Old 05-03-2007, 07:45 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,670
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
"Use the Source, Luke!"

If you download the kernel-source for your distribution, in the /usr/src/linux/drivers directory (and also perhaps in arch), you will find a cornucopia of existing driver source-code.

You will notice that most of it is written in ordinary "C," because a compiler produces very good code. Some of that "C" source-code contains embedded assembler-level statements and so-called "inline" calls, but you'll find that mostly in the older code.

Be very mindful that it is extremely likely that you can find an existing driver that either does what you want it to do, or that will act as a specific example which you can modify.

Quote:
Dictum Ne Agas: do not do a thing already done.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Preparing your Linux systems for the new DST LXer Syndicated Linux News 1 03-08-2007 03:35 PM
install ubuntu linux when come to preparing restricted drivers, buffer i/o error on h mikeleong Ubuntu 1 12-05-2006 01:54 PM
Preparing to be Slacked - Replace old Linux lel800 Slackware 10 10-21-2004 03:45 PM
Preparing for adding Linux to a windows p.c. mike975 Linux - General 8 04-21-2003 01:49 PM
Preparing for Linux install dbr1066 Linux - Newbie 7 12-18-2002 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:20 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