Re: execute a user process in the kernel

From: Dag-Erling Smørgrav (des_at_des.no)
Date: 09/24/04

  • Next message: Robert Watson: "Re: execute a user process in the kernel"
    To: Mike Meyer <mwm@mired.org>
    Date: Fri, 24 Sep 2004 18:21:25 +0200
    
    

    Mike Meyer <mwm@mired.org> writes:
    > Gordon David <kylincsos@hotmail.com> writes:
    > > Kqueue is a good method to notify the user. But I want the code in
    > > the kernel directly calls a user program.
    > How about starting with the code in kern/kern_exec.c?

    execve(2) assumes you already have a process. You get a process by
    forking another process. The only process we ever create from scratch
    is init(8), and that takes a s**tload of work (see kern/init_main.c).
    This is why we have stuff like nfsiod(8) which does nothing but
    provide the kernel with a process context it can use for other stuff.

    You could, of course, write a kernel API for creating processes from
    scratch. They'd still need a parent, but you can use init(8) (pid 1)
    for that.

    DES

    -- 
    Dag-Erling Smørgrav - des@des.no
    _______________________________________________
    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: Robert Watson: "Re: execute a user process in the kernel"

    Relevant Pages

    • Re: Embedded Software
      ... > it seems a bit daunting to set this all up from scratch. ... Does this require a kernel re-build? ... for the stuff that needs to be protected (kernel, system libs, busybox ect.) use cramfs... ...
      (comp.os.linux.embedded)
    • Re: execute a user process in the kernel
      ... I want the kernel to notify the userland program ... man 2 kqueue? ...
      (freebsd-hackers)
    • Re: 5.2-CURRENT: ldd /boot/kernel/kernel generates signal 6 (ABRT) ?
      ... complications heavier than the user comfort. ... > The kernel isn't dynamically linked to any libraries ... Hm <scratch, scratch>, so you map dynamic libraries to ...
      (freebsd-current)
    • Re: I have no "lo" :(
      ... >> Trying to build up the laptop from scratch after a big crash. ... Start from a .config file ... > helps avoid problems. ... Perhaps the kernel config ...
      (comp.os.linux.setup)
    • Re: linux kernel without users
      ... system within the linux kernel, taking ideas from Coyotos (and little ... Then you might as well start wondering if you really need an operating system. ... So every time someone wanted to write a program, they'd start from scratch, putting everything ... lay it right on the hardware. ...
      (comp.os.linux.misc)