Kernel & System Headers

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

 




Hi there list,

Therez a doubt am having. I think one needs to be clear with this during the
begining days of any kernel tweaking, per se, driver programming.

My doubt is as follows:

1.
Its given in the FAQ of kernelnewbies that there are 2 types of kernel
headers - System header files (usr/include/linux & usr/include/asm) and
kernel source headers (usr/src). The former for user-space programs and the
latter for kernel-specific modules only. (correct me if I am wrong here).

Now there is one more set of header files present in
/lib/modules/`uname -r`/build/include. This is the one that we include while
compiling our codes rather than /usr/src/linux/include. (FAQ says we should
use kernel sources headers). What is this meant for? I suppose
/lib/modules/`uname -r`/build/include is a copy of as
/usr/src/linux/include. (Please correct me again, if I have not understood
this part clearly).If that is the case than why dont we directly include
/usr/src/linux/include rather than going including
/lib/modules/`uname -r`/build/include

2.

When we include header files in our source files, per se, # include
<linux/module.h>, then, which header files are included (kernel sources
present in /usr/include/ or system headers found in /usr/src)

Regards,
Amit

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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