0

(Updated question after marking it as duplicate)

Operating System: Fedora 26 Alpha

Linux Kernel : 4.13.0-rc5 #1 SMP Tue Aug 15 19:53:44 IST 2017 x86_64 x86_64 x86_64 GNU/Linux

Is it possible to share data between two kernel modules , like via Netink socket we are able to communicate kernel module from user-space program?(Please, I request everyone to read question carefully before mark it as duplicate question.)

I also searched on google, but i got results like about using symbols EXPORT_SYMBOL() and extern in kernel modules.But, I don't want to use them.

I simply, want to share data between two kernel modules just like a client and server chat application in c in user-space.

For this, Lets take a scenario:

There are two kernel modules, A and B. Now, after insertion of module , suppose A module increment i from i=1 to i++ then pass or transfer this value to module B, then module B calculate multiplication table of that incremented value (i) from module A.

Community
  • 1
  • 1
bsdboy
  • 111
  • 10
  • Possible duplicate of [Is it possible to communicate between two linux kernel module via netlink?](https://stackoverflow.com/questions/11015186/is-it-possible-to-communicate-between-two-linux-kernel-module-via-netlink) – Gaurav Pathak Aug 24 '17 at 10:45
  • Please read this [link](https://groups.google.com/forum/#!topic/linux.kernel/hT5nN5w1jCI) as well. – Gaurav Pathak Aug 24 '17 at 10:47
  • @Gaurav, I already guessed that someone will definitely post this link, just because of little bit same line.Now, duplicate question was, is it possible via Netlink, and my question is, is it possible via Netlink or anything same as Netlink for kernel to kernel module because Netlink is for User to kernel or vice versa. And I already mentioned that, I don't want to use `EXPORT_SYMBOL() ` because it can do as statically but i want somewhat Dynamically Buffer, that's why don't want to use symbols. – bsdboy Aug 24 '17 at 11:23
  • you can `EXPORT_SYMBOL()` of a pointer to a dynamic buffer – myaut Aug 24 '17 at 12:21
  • @myaut So , this will solve my scenario like increment and calculate multi. table ? and what about client server type userspace chat application but in Kernel space ? I mean , one module waiting for input and another one is giving output , i mean just like **pipe** in kernel space? – bsdboy Aug 24 '17 at 12:27
  • and also , without `EXPORT_SYMBOL()` and `kernel threads` , is there any other mechanisms of achieving this ? – bsdboy Aug 24 '17 at 12:29

0 Answers0