I'm developing an application (user space) which send notifications of value changes via network.
I want to develop a kernel module (A) in order to notify my application (user space) in case of value change in a parameter in other kernel module (B).
Define a header in module B like a normal C header that includes the variables/functions that A wants to use, and of course #include
it in A.
In one of the source files of B, write:
EXPORT_SYMBOL(your_symbol);
for each of the variables/functions.
In the Makefile of module A, make sure you add the path to Module.symvers of B in the KBUILD_EXTRA_SYMBOLS
to get rid of dependency warnings and be able to load the module if your kernel has been configured with CONFIG_MODVERSIONS
Honestly, this one I don't know much. I personally code with a real-time extension of Linux (RTAI) for my work and I have facilities that I don't think exist in plain Linux. These facilities are shared memory (between kernel and user), and shared semaphores (again between kernel and user) and the like. If you could find such a thing in Linux, then you can use it.
If those are not available (which I believe they are not), you can always simply write a /sys or /proc file that outputs a simple 0/1 showing whether the user-space application needs to be signalled or not. Then the user-space application can poll this file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With