How to send a signal / interrupt from kernel built in module to a loadable kernel module?
Also for an efficient solution, you can make use of function pointers from kernel source code.
But the problem here is you have to modify Linux source code. Be very careful when you do such modifications.
- Implement a NULL function pointer from you Linux source code - Call to this function pointer from the kernel routine (check for NULL and do)
- Export the symbol
- Provide a local function address to this symbol from your loadable module.
That's it...!!! You will get a function call from the kernel routine. Also make sure that when you exit the module, put the symbol back to NULL, otherwise kernel will crash.
Executing a user-space function from the kernel space
You are out of luck with invoking user-space functions from the kernel since the kernel doesn't and isn't supposed to know about individual user-space application functions and logic, not to mention that each user-space application has its own memory layout, that no other process nor the kernel is allowed to invade in that way (shared objects are the exception here, but still you can't tap into that from the kernel space). What about the security model, you aren't supposed to run user-space code (which is automatically considered unsafe code in the kernel context) in the kernel context in the first place since that will break the security model of a kernel right there in that instant. Now considering all of the above mentioned, plus many other motives you might want to reconsider your approach and focus on Kernel <-> User-space IPC and Interfaces, the file system or the user-mode helper API(read bellow).
You can invoke user space apps from the kernel though, that using the usermode-helper API. The following IBM DeveloperWorks article should get you started on using the usermode-helper Linux kernel API:
Kernel APIs, Part 1: Invoking user-space applications from the kernel
Related Topics
Redirecting Output of a C Program to Another C Program with a Bash Script Under Linux
How to Programmatically Know If I Am in a Vm
How Is The Linux Calculating Memfree
"Sudo" Fails with "Sudo Requires a Tty" When Executed from Putty Command Line
Linking with 32Bit Libraries Under Linux 64Bit
How to Ensure Data Reaches Storage, Bypassing Memory/Cache/Buffered-Io
Setting an Acpi Field in Linux
Is There Some Cases in Which Sigkill Will Not Work
Shell Script Linux Substract Parameter Grep
How to Two Mmap on Same /Dev File
How to Open Include File 'Io.Mac' Assembly
Tcp Keepalive - Protocol Not Available
How to Simulate a Usb Printer to Lpt on Linux
Using Ebpf to Measure CPU Mode Switch Overhead Incured by Making System Call
How to Print Multiple Variables Using Printf
Floating Point Rounding in Shell
How to Make Webdriver Testsuite Created in Windows Machine to Run in a Linux Box