startingKernelProgramming

Srinidhi Rao srinidhi.rx at gmail.com
Wed Aug 24 02:54:46 EDT 2011


Hi all,

I am in the initial hard steps of learning the nuances of kernel
programming, as to begin what are all the modules (header files) to use its
data-structures be included to go about, as I tried this source:
src: http://tldp.org/LDP/lkmpg/2.6/html/x121.html
/*
* hello-1.c - The simplest kernel module.
*/
#include <linux/module.h>
/* Needed by all modules */
#include <linux/kernel.h>
/* Needed for KERN_INFO */
int init_module(void)
{
    printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
    return 0;
}
void cleanup_module(void)
{
    printk(KERN_INFO "Goodbye\n");
}

as compilation followed this:
box at x86:~$ cc kernel_hello.c
kernel_hello.c:3: fatal error: linux/module.h: No such file or directory
compilation terminated.
--
Thanks and Regards,
Srinidhi.
----
All our knowledge has its origins in our perception.
-- Leonardo da Vinci.
----
Tell me and I forget. Teach me and I remember. Involve me and I learn.
-- Benjamin Franklin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110824/7e5f2d90/attachment.html 


More information about the Kernelnewbies mailing list