LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-07-2007, 10:48 PM   #1
ravindra1103
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Rep: Reputation: 0
how to compile kernel programs


I am writing kernel programs..
i need to compile those things..

kernel programs are not modules...

i want to use basic level functions.....

How to compile programs is my doubt..

dont say u cant compile programs
we can compile becoz using some options in gcc we can able to recompile kernel

so , what options i have to include to gcc so that i can compile kernel programs

#include <linux/kernel.h>
#include <stdio.h>

int main(){
printk (KERN_INFO ""THIS IS SUBBU");
printk(KERN_DEBUG "how r u??");
return 0;
}

i want to compile and execute this program

how ???

Last edited by ravindra1103; 04-07-2007 at 10:51 PM.
 
Old 04-08-2007, 01:18 PM   #2
charleykadet
Member
 
Registered: Sep 2005
Location: Montreal
Distribution: Fedora Core 5, Gentoo, LFS
Posts: 83

Rep: Reputation: 15
You just need to read tutorials... There are many books about it!
eg. http://www.xml.com/ldd/chapter/book/ --> linux device driver if you didn't want to write any kernel driver, kernel programming isn't for you!
 
Old 04-08-2007, 01:21 PM   #3
charleykadet
Member
 
Registered: Sep 2005
Location: Montreal
Distribution: Fedora Core 5, Gentoo, LFS
Posts: 83

Rep: Reputation: 15
there is a third edition: http://lwn.net/Kernel/LDD3/
 
Old 04-08-2007, 01:32 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
kernel programs are not modules...
There is no such thing as a kernel program. You cannot execute a program in kernelspace. However, you can access kernel modules from userspace. Perhaps this is what you mean.
 
  


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 should i compile c programs?? vbnandu86 Fedora 3 09-01-2006 07:15 AM
cannot compile programs in -current w/ 2.6.x zefo Slackware 7 04-29-2006 03:32 AM
cannot compile c programs umeshpandey007 Linux - Newbie 7 08-29-2005 09:19 PM
Certain programs won't compile thegeekster Linux - Software 2 01-15-2004 06:25 AM
compile programs in c and cpp Manjula.S Linux - Software 2 10-15-2003 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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