Re: exec()

Björn Döbel <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On 22.10.2014 17:09, teclis High Elf wrote:
> Could some one please point me to or give me example code to do the
> L4Re equivalent of UNIX exec(), spawn a new process?

as Adam already told you in his mail from Oct 21st, starting a new
program differs on L4 from how it is done in UNIX. The basic steps are:

* Create a new task object to represent the address space.
* Inspect the ELF binary you want to run and load the respective
  segments into this new address space.
* Set up initial capabilities for the new task. These are necessary,
  so that the task has a memory manager, memory allocater, namespace
  etc. set.
* Create a thread within the new task and let it run from the ELF
  binary's start address.

There is a libloader that wraps most of this, especially the setup and
binary loading part. Example users of libloader are pkg/moe, pkg/ned,
and pkg/plr.

Bjoern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlRIoecACgkQP5ijxgQLUNmyFQCePPw9SjJFQordAk/h2toK1ysN
vvcAn3bmzUE9ol0jcLUVRli/luWd9Bkz
=7Rkp
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.