I want to write a kernel space function that invoked by a user space function in Linux, like below:
// kernel space function.
void hello_kernel()
{
printk(KERN_INFO "Hello kernel space.");
printk(KERN_INFO "I can do any thing!");
}
// user space function
void hello_kernel();
int main()
{
printf("Invoking a kernel space function.");
hello_kernel();
return 0;
}
I don't have any idea that this sample code is possible or not.
How to write a kernel space function that invoked by a user space function?