mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-27 01:11:06 +00:00
6894ced63b
This patch implements 'execve' in Genode's libc. The mechanism relies on the dynamic linker's ability to replace the loaded binary while keeping crucial libraries - in particular the libc - intact. The state outside the libc is wiped. For this reason, all libc internal state needed beyond the 'execve' call must be allocated on a heap separate from the application-owned malloc heap. E.g., libc-internal file-descriptor objects must not be allocated or refer to any memory object allocated from the malloc heap. Issue #3481
33 lines
775 B
Plaintext
33 lines
775 B
Plaintext
build { core init test/execve }
|
|
|
|
create_boot_directory
|
|
|
|
install_config {
|
|
<config verbose="yes">
|
|
<parent-provides>
|
|
<service name="ROM"/>
|
|
<service name="LOG"/>
|
|
<service name="CPU"/>
|
|
<service name="PD"/>
|
|
</parent-provides>
|
|
<start name="test-execve" caps="300">
|
|
<resource name="RAM" quantum="1G"/>
|
|
<config ld_verbose="yes">
|
|
<arg value="name_of_executeable"/>
|
|
<arg value="100"/>
|
|
<libc stdin="/null" stdout="/log" stderr="/log"/>
|
|
<vfs> <null/> <log/> </vfs>
|
|
</config>
|
|
<route> <any-service> <parent/> </any-service> </route>
|
|
</start>
|
|
</config>
|
|
}
|
|
|
|
build_boot_image {
|
|
core init ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so test-execve
|
|
}
|
|
|
|
append qemu_args " -nographic "
|
|
|
|
run_genode_until "child.*exited.*value 0.*\n" 15
|