Discussion:
Linking genode processes at different address space
Parfait Tokponnon
2016-10-15 12:34:06 UTC
Permalink
Dear Genode community,
I would like to know if there is a way to link Genode process (or
components) at different address spaces especially when building Heeselicht
scenario.
When playing with the kernel (Nova), I encounter some weird values from a
userland process, but which component exactly it is, i don't really know
since almost all of them are linked to the same virtual adress.
According to me, one way to deal with it would be to name each PD
(protection domain) in the kernel according to the Genode component they
belong to, but I think this would be a bit tedious.
So what I am projecting to do is to guess the component name from the
adress space they are executing in (if they have different address space,
right?).
Any other idea is welcome.
Thanks
--
Parfait T.
Martin Stein
2016-10-17 08:57:05 UTC
Permalink
Hello Parfait,
Post by Parfait Tokponnon
Dear Genode community,
I would like to know if there is a way to link Genode process (or
components) at different address spaces especially when building
Heeselicht scenario.
When playing with the kernel (Nova), I encounter some weird values from
a userland process, but which component exactly it is, i don't really
know since almost all of them are linked to the same virtual adress.
According to me, one way to deal with it would be to name each PD
(protection domain) in the kernel according to the Genode component they
belong to, but I think this would be a bit tedious.
So what I am projecting to do is to guess the component name from the
adress space they are executing in (if they have different address
space, right?).
Any other idea is welcome.
Yes, the components are all in different virtual address spaces.
Anyway, I assume that changing the linking in such a way to get a
components name would be like taking a sledgehammer to crack a nut. I
wonder what exactly you mean with weird values (IP, stack pointer,
pagefaults, ...?) and at where you are when observing them (Core,
Kernel, debugger, ...?). I ask because, for example, the
Region-Management code in Core actually knows which Address Space is
used by which component. If your component causes a pagefault, Core not
only prints the name of the component but also name and IP of the thread
that caused it.

Cheers,
Martin
Parfait Tokponnon
2016-10-18 09:16:01 UTC
Permalink
Hello Martin,
Post by Martin Stein
Hello Parfait,
Post by Parfait Tokponnon
Dear Genode community,
I would like to know if there is a way to link Genode process (or
components) at different address spaces especially when building
Heeselicht scenario.
When playing with the kernel (Nova), I encounter some weird values from
a userland process, but which component exactly it is, i don't really
know since almost all of them are linked to the same virtual adress.
According to me, one way to deal with it would be to name each PD
(protection domain) in the kernel according to the Genode component they
belong to, but I think this would be a bit tedious.
So what I am projecting to do is to guess the component name from the
adress space they are executing in (if they have different address
space, right?).
Any other idea is welcome.
Yes, the components are all in different virtual address spaces.
Anyway, I assume that changing the linking in such a way to get a
components name would be like taking a sledgehammer to crack a nut. I
wonder what exactly you mean with weird values (IP, stack pointer,
pagefaults, ...?) and at where you are when observing them (Core,
Kernel, debugger, ...?).
I am in the kernel.
My real problem is this :
When an EC (Execution Context) traps into the kernel, how the kernel can
know which component it belongs to or which component originates this trap,
and when the kernel, returning to userspace, elects an EC, which component
this EC belongs to. I would like to get from the kernel at runtime the
component an Ec belongs to. Is it Possible?
Post by Martin Stein
I ask because, for example, the
Region-Management code in Core actually knows which Address Space is
used by which component. If your component causes a pagefault, Core not
only prints the name of the component but also name and IP of the thread
that caused it.
Because I am in the kernel, I assume i have no idea of what is going on in
core and other components.
Post by Martin Stein
Cheers,
Martin
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
genode-main mailing list
https://lists.sourceforge.net/lists/listinfo/genode-main
Thank you a lot!
--
Parfait T.
Alexander Boettcher
2016-10-18 15:31:14 UTC
Permalink
Post by Parfait Tokponnon
When an EC (Execution Context) traps into the kernel, how the kernel can
know which component it belongs to or which component originates this trap,
and when the kernel, returning to userspace, elects an EC, which component
this EC belongs to. I would like to get from the kernel at runtime the
component an Ec belongs to. Is it Possible?
You will need to add your own support code in the kernel and Genode/NOVA
to correlate things.

If you haven't yet a fully high dynamic setup, I would advise to enable
in the kernel the debug output in the beginning of

sys_create_ec
sys_create_pd

and accordingly in Genode add debug output of the names of the process
and thread before all occurrences of

create_ec
create_pd

in repos/base-nova.

With the information you are able to correlate EC and PD pointers in the
kernel with Genode names for the process and threads.

Hope it helps,

Alex.
--
Alexander Boettcher
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Parfait Tokponnon
2016-10-24 11:39:08 UTC
Permalink
2016-10-18 16:31 GMT+01:00 Alexander Boettcher <
Post by Parfait Tokponnon
Post by Parfait Tokponnon
When an EC (Execution Context) traps into the kernel, how the kernel can
know which component it belongs to or which component originates this
trap,
Post by Parfait Tokponnon
and when the kernel, returning to userspace, elects an EC, which
component
Post by Parfait Tokponnon
this EC belongs to. I would like to get from the kernel at runtime the
component an Ec belongs to. Is it Possible?
You will need to add your own support code in the kernel and Genode/NOVA
to correlate things.
If you haven't yet a fully high dynamic setup, I would advise to enable
in the kernel the debug output in the beginning of
sys_create_ec
sys_create_pd
and accordingly in Genode add debug output of the names of the process
and thread before all occurrences of
create_ec
create_pd
in repos/base-nova.
With the information you are able to correlate EC and PD pointers in the
kernel with Genode names for the process and threads.
It works fine,
Thanks
Post by Parfait Tokponnon
Hope it helps,
Alex.
--
Alexander Boettcher
Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
GeschÀftsfÌhrer: Dr.-Ing. Norman Feske, Christian Helmuth
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
genode-main mailing list
https://lists.sourceforge.net/lists/listinfo/genode-main
--
Parfait T.
Loading...