Hi all,<br><br>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:<br>
src: <a href="http://tldp.org/LDP/lkmpg/2.6/html/x121.html">http://tldp.org/LDP/lkmpg/2.6/html/x121.html</a><br>/*<br>* hello−1.c − The simplest kernel module.<br>*/<br>#include <linux/module.h><br>/* Needed by all modules */<br>
#include <linux/kernel.h><br>/* Needed for KERN_INFO */<br>int init_module(void)<br>{<br> printk(KERN_INFO "Hello world 1.\n");<br>/*<br>* A non 0 return means init_module failed; module can't be loaded.<br>
*/<br> return 0;<br>}<br>void cleanup_module(void)<br>{<br> printk(KERN_INFO "Goodbye\n");<br>}<br clear="all"><br>as compilation followed this:<br>box@x86:~$ cc kernel_hello.c <br>kernel_hello.c:3: fatal error: linux/module.h: No such file or directory<br>
compilation terminated.<br>--<br>Thanks and Regards,<br>Srinidhi.<br>----<br>All our knowledge has its origins in our perception.<br>-- Leonardo da Vinci.<br>----<br>Tell me and I forget. Teach me and I remember. Involve me and I learn.<br>
-- Benjamin Franklin.
<br><br>