Gesendet: Montag, 05. April 2021 um 19:48 Uhr Von: "Alexander Tormasov via users" users@lists.genode.org An: "Genode users mailing list" users@lists.genode.org Cc: "Alexander Tormasov" a.tormasov@innopolis.ru Betreff: Re: how to open elf file image from inside genode? libbacktrace question
Returning to my question, could I use posix open(«/test-go») to open my binary from which I run executable, if I have the following code in run file:
<start name="test-go" caps="250"> <resource name="RAM" quantum="20M"/> <config verbose="yes" ld_verbose="yes" > <vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log" stderr="/dev/log"/> </config> </start>
or I need to modify it and add another «double» option, something like
You need this configuration. But why do you want to use a way that is dependent upon config, when you need it for a language detail. That is why make something compiled in depend on something configured. And why has it to be POSIX open ()? Alternatively you can store that capability on startup in a static var in open () where it is returned from upon encountering a special parameter combination for instance an empty string as filename.
<start name="test-go" caps="250"> <resource name="RAM" quantum="20M"/> <config verbose="yes" ld_verbose="yes" > <vfs> <dir name="dev"> <log/> </dir> <rom name="test-go"/> </vfs> <libc stdout="/dev/log" stderr="/dev/log"/> </config> </start>
5 апр. 2021 г., в 14:36, ttcoder@netcourrier.com написал(а):
Your parent needs a ROMFile capability to run your program. Ask it for that capability to read your own file. You can call that RPC getexecname or whatever strikes your fancy.
the question is what path for open() call I should use for ROMfile?
Not sure if that's relevant to the discussion as I'm jumping in mid-stream, but in my Genode run scenarios I use the following, in order to access data files (not exe files) :
<start name="my_application"> <config> <vfs> <rom name="background.jpeg"/> ..etc
Sincerely, Alexander
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users