Hi seL4-devs and users,
I have a question about implementing server and client using badged
endpoints. Below I have laid out the scenario, the issue, and some
I have a userspace server that implements the functionality for an
object(say type obj_T1). The server hands out badged-endpoints to clients
to interact with this object. The badge is the virtual address of the
object's struct in the server’s virtual address space. A client can
interact with the object by sending messages on this badged endpoint. The
client never learns the badge value. The kernel extracts the badged value
when the server receives a message on this endpoint. By using the badge
value, the server knows which object the client is trying to manipulate.
The same PD, which implements the 1st server, also implements another
server(in a separate thread, but same address space) for another object
type (say type obj_T2). The server follows the same paradigm of handing out
badged endpoints and using the badges values to keep track of the object.
I have a scenario where the client wants to invoke the functionality of
obj_T1. This functionality needs access to obj_T2 as well. The client has
badged EP caps to both objects. The client can invoke the badged EP handed
out by server-1 for obj_T1 and give the badged EP of obj_T2 as an extraCap
in the IPC message(or vice versa). Since the server has no way to look up
the badge of the second cap, it cannot look up the underlying object for
So my questions are:
Is there a way for a PD to look up the badge value of badged EP? I think
the answer is no, but I thought I would still ask.
Is my idea of using the badge to keep track of the underlying object on
the right track? Is there a better way of going about doing it?
As a potential solution, I can extend my server to add a new function,
say GETID, which returns the badge value of a given object(i.e., EP). Since
I know that the server always badges the EP with the virtual address of the
struct, it is a trivial call to implement. But I somehow feel like this is
not a neat idea, not quite sure why.
Thanks for the help, everyone!
CS Graduate Student @ UBC