Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    how to exec a user-mode program in kernel mode?

    I want to execute a program in kernel mode( in a module inserted), the module is inserted before /bin/init. so there is no tty exists. When inserting, I want to read password from keyboard to ensure the user is the right person.
    Can anybody tell me how to do this? Any kind response is welcome!

  2. #2
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    A purist would tell you: "Don't do it"

    As a general case it is not a good idea to call user-mode programs from kernel mode, since that programs call the kernel via syscalls...

    If you want, take a look at kmod.c (it calls modprobe)

    This is all I'm able to say, sorry.

    Best regards

  3. #3

    It wroks!

    Thank you, fernape!
    It works, but the user mode program cannot return the result, and the priority is lower than the kernel module. So, the module doesn't wait for the completion of user mode program, and my expectation of the user mode program to intercept and verify the proper user of the module can't work.

    Best regards!


  4. $spacer_open

Posting Permissions

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