Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I want to call some functions of a user space program from a kernel module. I cannot obviously put the code of the user space program in the kernel ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2004
    Posts
    26

    Call User-space Program function from Kernel Module


    Hi,
    I want to call some functions of a user space program from a kernel module. I cannot obviously put the code of the user space program in the kernel module as I dont have the libraries for that in the kernel space. So can anyone tell me how to be able to call user space programs, or link to them through kernel modules?

    Thanks a lot
    Shivanu

  2. #2
    Just Joined!
    Join Date
    Jan 2005
    Location
    Toronto, ON, Canada
    Posts
    79
    You can write a small plication in user space that call the function and retun to the kernel module.

    http://www.faqs.org/docs/kernel/x848.html

    afrolinux

  3. #3
    Just Joined!
    Join Date
    Mar 2005
    Posts
    6
    Hi
    You can write a function in user space which will call the function in kernal by passing the address of the function(using function pointer) provided that the function in kernal has one of its arguments as a function pointer.

    Thanks

    Regards
    Bala

  4. #4
    Just Joined!
    Join Date
    Jan 2007
    Posts
    1

    Calling user space function from kernel

    Hi
    Did u get any solution for calling a user space function from a kernel module
    if so please let me know.

    Quote Originally Posted by shivanu
    Hi,
    I want to call some functions of a user space program from a kernel module. I cannot obviously put the code of the user space program in the kernel module as I dont have the libraries for that in the kernel space. So can anyone tell me how to be able to call user space programs, or link to them through kernel modules?

    Thanks a lot
    Shivanu

  5. #5
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Fernando Apesteguia (Fernape) has write an article about Introducing LKM programming and support of C libraries in kernelspace (check the Basic rules):
    http://www.linuxforums.org/programmi...g_part_ii.html

    A FAQ about Library Functions In Kernel:
    http://kernelnewbies.org/FAQ/LibraryFunctionsInKernel

    Regards

  6. #6
    Just Joined!
    Join Date
    Aug 2012
    Posts
    4
    Quote Originally Posted by abhijitkumbhar View Post
    Hi
    Did u get any solution for calling a user space function from a kernel module
    if so please let me know.
    Well , has anyone found a particular solution to this ? I need to do something similar

  7. #7
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Quote Originally Posted by maheshma View Post
    Well , has anyone found a particular solution to this ? I need to do something similar
    You'll probably have much better luck with creating a new thread and post as much info as possible descibing your problem. Hope this helps. *locking this thread*
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •