exec()

Jason Butler jbutler at elliptictech.com
Thu Oct 23 14:47:04 CEST 2014


Ok Thank you very much for taking the time to clarify.
________________________________________
From: l4-hackers [l4-hackers-bounces at os.inf.tu-dresden.de] on behalf of Björn Döbel [doebel at os.inf.tu-dresden.de]
Sent: Thursday, October 23, 2014 2:36 AM
To: l4-hackers at os.inf.tu-dresden.de
Subject: Re: exec()

-----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-----

_______________________________________________
l4-hackers mailing list
l4-hackers at os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers



More information about the l4-hackers mailing list