I recently created a new header file that I want to include in the Linux kernel. I put the .h file in usr/src/linux/include/linux. I put the .c file in usr/src/linux/lib. I updated the Makefile in the lib directory and recompiled the kernel, without error. However, when I tried to use the functions in the header file, I got an error saying that the functions were not defined. I assumed (wrongly) that the kernel would know which c file the header was for. How do I properly set this up?
Share
Where you try to use the functions?
If tried your function within the kernel (external module). You need to add
EXPORT_SYMBOL(); to the module where your function is defined.
Otherwise (from user-space) it is a different (and more complicated).