Gordon David wrote:
Hello,
I have a question. Anyone would like to tell me how to execute a user process or shell script in the kernel?
As we know, the kernel forks a process named initproc and executes /sbin/init, etc. If I want to execute a user level process, such as a simple printf("Hello world") in a driver, what shall I do?
Proper way to do this is to have userland daemon handling this stuff, waiting for device driver using device-specific method (most likely a file under /dev). I'm pretty skeptic processes that don't have init process as their first ancestor can be created easily at all.
There's also another question to consider: where the output should go? These kind of things are better to be handled in the userland.
-kirma _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"