LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-05-2011, 02:29 AM   #16
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 207Reputation: 207Reputation: 207

There are actually a lot more than two files generated, but never mind that for now.

The situation is analogous to compiling any user space code. First, a .c file is transformed into object code, in a .o. Next, the .o code is linked together to produce a library or executable.

The situation is no different with Linux, except that the linker links against a custom linker script, and names its file .ko instead.
 
1 members found this post helpful.
Old 12-09-2011, 09:02 AM   #17
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Rep: Reputation: 51
What exactly does "links against a custom linker script" mean?
 
Old 09-24-2012, 07:54 AM   #18
sccott
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Thumbs up Thank you

I am new to kernel programming and I was trying to manually specify /usr/src header files using gcc and it just wouldnt work! I did not know these basics. Thank you so much!
 
1 members found this post helpful.
Old 02-21-2013, 03:14 PM   #19
shivareddy
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
I m not able to see message in dmesg log

Hello Experts... Can somebody help me what would be the problem that "Hello World" is not logged in dmesg.

Below is my module it compiled with out errors.... after inserting the module with command insmod hello.ko, and run dmesg to check the message "Hello world".. i am not able to see the message....

i have checked the command lsmod, i can see hello module in the list of modules.....


#include<linux/init.h>
#include<linux/module.h>
MODULE_LICENSE("GPL");

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

static void hello_exit(void)
{
printk(KERN_ALERT "Hello World, bye\n");
}

moudle_init(hello_init);
moudle_exit(hello_exit

With Regards
Shiva
 
  


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
[SOLVED] partport module is seing my parallel port but lp module doesn´t found any device... fcintron Linux - Hardware 3 03-07-2011 09:45 AM
Compile and load kernel module automatically after boot? (Intel NIC module) touser Linux - Newbie 3 08-29-2009 08:45 PM
error: -1 Invalid module format when using insmod with module cross-compiled for arm AndrewShanks Linux - Embedded & Single-board computer 4 10-15-2007 03:50 AM
kcmshell module, Background&Screensaver Module can't be launch (but works @LookNFeeL) bobbyjoe Linux - Software 0 01-08-2005 04:48 AM
'Invalid module format' loading simple module on Suse Linux Professional 9.1 rocketdude Linux - Distributions 3 07-27-2004 11:40 PM


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