Find the answer to your Linux question:
Results 1 to 5 of 5
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 ...
  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

Posting Permissions

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