LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 04: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, 04: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 04:13 AM.
 
Old 08-24-2011, 12: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, 12: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



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 04:40 AM
Device driver programming shariefbe Programming 6 09-01-2008 01:07 PM
device driver programming rebel_angel Linux - Hardware 5 11-30-2006 04:48 AM
Linux device driver programming iammisc Programming 1 11-26-2005 10:46 AM
linux device driver programming chandansingh Programming 1 03-26-2005 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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