I am newbie on Kernel Development techniques. I was wondering if there is a way to establish communication between Kernel and Kernel Modules (LKM), once Kernel Modules are dynamically loaded. What I want to do is to call a function from a specific part of the Kernel to send some data, while the kernel module is waiting for it. If the module isn't loaded yet, I was thinking it would cause some trouble because the function isn't yet defined too. So my question is, there is a way of calling a function defined on kernel module from somewhere on the kernel? I couldn't find any sources for this question, so I also wanted to ask you if what I'm trying to do is a bad practice and if there's another way of doing this.
This is what I am trying to do:
- I have a function on my LKM called "foo (mesg)"
- I wish to call this function "foo" inside "arch/x86/mm/fault.c" code
- The purpose is to store these "mesgs" and then collect them in user-space using /proc. That's why I am building a LKM.