startingKernelProgramming

Metin KAYA kayameti at gmail.com
Wed Aug 24 03:07:02 EDT 2011


http://tldp.org/LDP/lkmpg/2.6/html/x181.html

On 24 Ağu 2011, at 09:54, Srinidhi Rao <srinidhi.rx at gmail.com> wrote:

> 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. 
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110824/b57daaba/attachment-0001.html 


More information about the Kernelnewbies mailing list