Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Sep 2004 18:21:25 +0200
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        Mike Meyer <mwm@mired.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: execute a user process in the kernel
Message-ID:  <xzpekkrwsca.fsf@dwp.des.no>
In-Reply-To: <16722.59709.451226.932084@guru.mired.org> (Mike Meyer's message of "Thu, 23 Sep 2004 10:18:21 -0500")
References:  <BAY1-F10eZZfm95LyRk00055aa3@hotmail.com> <16722.59709.451226.932084@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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
--=20
Dag-Erling Sm=F8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpekkrwsca.fsf>