Re: execute a user process in the kernel
From: Robert Watson (rwatson_at_freebsd.org)
Date: 09/24/04
- Previous message: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- In reply to: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- Next in thread: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- Reply: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Sep 2004 14:11:19 -0400 (EDT) To: Dag-Erling Smørgrav <des@des.no>
On Fri, 24 Sep 2004, Dag-Erling Smørgrav wrote:
> 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.
Well, we have kproc/kthread APIs, but none of that is semantically
compatible with the notion of execve(), which is a very user-centric
concept ("replace the address space with a mapping of binary <x>"). You
could fudge together a related notion, though, involving loadable kernel
modules that have a main() routine run from a thread. That said, the
notion of simply running user code in kernel (as has been pointed out) is
fraught with peril, primarily because the kernel is basically one big
program with many special requirements, and user applications are written
with the assumption that they are the only program, not running in the
context of another program.
Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org Principal Research Scientist, McAfee Research
_______________________________________________
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"
- Previous message: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- In reply to: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- Next in thread: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- Reply: Dag-Erling Smørgrav: "Re: execute a user process in the kernel"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|