I am a newbie to kernel programming and I want to modify a header file in arch/x86/include/asm/tlbflush.h so that my kernel module can use one of the functions exported by this header file.
I have the source code for 3.2.59 kernel and made changes to tlbflush.h. I included the header file tlbflush.h. When i compile the module i get a warning saying the function that I am using is not found and as a result I am not able to insmod my kernel module.
I went through the following how to export a modified kernel header
and tried the following steps to install the modified kernel header:
- make
- sudo make modules_install
- sudo make headers_install INSTALL_HDR_PATH=/usr/include
- sudo make install
- sudo update-initramfs -c -k 3.2.59
The link mentioned talks about installing kernel headers to /usr/include for access to user space processes
I want to mention that I have so many headers installed due to the upgrades done on my ubuntu machine. Also all of them have extensions like 3.2.0-59, 3.2.0-xx I considered 3.2.0-59 to be same as 3.2.59 though I am not sure. Please correct me in case this is wrong. Thanks !
Edit:
I am sorry, I got confused with the headers in /usr/src/... folder versus the headers in the source code of kernel that is being modified. I made a change in the headers of the kernel source that i downloaded and after that there is no warning now.
But the question still remains that why are the kernel headers in /usr/src/ used?
I am sorry for the waste of time, if you spent on this.