execute a user process in the kernel

Allan Fields bsd at afields.ca
Wed Sep 22 15:46:50 PDT 2004


On Wed, Sep 22, 2004 at 08:49:11AM +0000, 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?

You probably really don't want to do this and if you do, there is
likely a better approach.

> 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

Why?

> what shall I do?

Lots of good references on distinctions between kernel and userland.

Try:

The Design and Implementation of 4.4BSD (First few chapters)
file:///usr/share/doc/en/books/design-44bsd/

> Thanks
> Gordon

--
 Allan Fields, AFRSL - http://afields.ca
 2D4F 6806 D307 0889 6125  C31D F745 0D72 39B4 5541


More information about the freebsd-hackers mailing list