Re: execute a user process in the kernel

From: Jari Kirma (kirma_at_cs.hut.fi)
Date: 09/22/04

  • Next message: Julian H. Stacey: "Re: slow login, app launching, etc"
    Date: Wed, 22 Sep 2004 15:51:45 +0300 (EEST)
    To: freebsd-hackers@freebsd.org
    
    

    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
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Julian H. Stacey: "Re: slow login, app launching, etc"