LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2011, 05:08 AM   #1
SmithNeo
LQ Newbie
 
Registered: Aug 2011
Posts: 1

Rep: Reputation: Disabled
Question Device driver Programming


I'm new to linux and just started my lessons on device Driver programming. I have few problems and i completely dont get the idea. Can anyone explai how to do this for the following code.

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);
 
Old 08-23-2011, 05:12 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
What exactly is your question? What don't you understand? Are you having problems building or loading the module?

Also, when posting code here, you should put it between [code] tags to preserve indentation and aid readability.

Last edited by Nylex; 08-23-2011 at 05:13 AM.
 
Old 08-24-2011, 01:19 AM   #3
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
These might help
http://tldp.org/LDP/lkmpg/2.6/html/index.html
http://lwn.net/Kernel/LDD3/
 
1 members found this post helpful.
Old 08-24-2011, 01:22 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
It's likely that the OP is already reading LDD3, though, since that example is from there.
 
  


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
How to do device driver programming dwnlds Ubuntu 2 01-15-2011 05:40 AM
Device driver programming shariefbe Programming 6 09-01-2008 02:07 PM
device driver programming rebel_angel Linux - Hardware 5 11-30-2006 05:48 AM
Linux device driver programming iammisc Programming 1 11-26-2005 11:46 AM
linux device driver programming chandansingh Programming 1 03-26-2005 08:30 AM


All times are GMT -5. The time now is 10:27 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration