Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-27-2006 #1Just Joined!
- Join Date
- Apr 2006
- Posts
- 3
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!
- 04-27-2006 #2
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
- 04-29-2006 #3Just Joined!
- Join Date
- Apr 2006
- Posts
- 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!
Herbert


Reply With Quote
