Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am not able to compile c code
gcc is not getting path of module.h and kernel.h
#include <module.h> /* Needed by all modules */
#include <kernel.h> /* Needed for KERN_INFO */
printk(KERN_INFO "Hello world 1.\n");
* A non 0 return means init_module failed; module can't be loaded.
printk(KERN_INFO "Goodbye world 1.\n");
[email@example.com][ /usr/src ]gcc -o hello-1.0 hello-1.c
hello-1.c:1:54: error: module.h: No such file or directory
hello-1.c:2:53: error: kernel.h: No such file or directory
hello-1.c: In function ‘init_module’:
hello-1.c:6: error: ‘KERN_INFO’ undeclared (first use in this function)
hello-1.c:6: error: (Each undeclared identifier is reported only once
hello-1.c:6: error: for each function it appears in.)
hello-1.c:6: error: expected ‘)’ before string constant
hello-1.c: In function ‘cleanup_module’:
hello-1.c:14: error: ‘KERN_INFO’ undeclared (first use in this function)
hello-1.c:14: error: expected ‘)’ before string constant
[firstname.lastname@example.org][ /usr/src ]vi hello-1.c
plz compile @ ur end and let me know ?
yes I have installed look at the below
[email@example.com][ /root ]cd /usr/src/kernels/188.8.131.52-42.fc8-i686/
arch/ crypto/ hello-1.c ipc/ Makefile net/ sound/
block/ drivers/ include/ kernel/ mm/ scripts/ System.map
.config fs/ init/ lib/ Module.symvers security/ usr/
Even I tried by copying hello-1.c in same location and then tried
gcc -o hello-1.0 hello-1.c
but its not working?