startingKernelProgramming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux