thread.id.lthread inquiry

Adam Lackorzynski adam at os.inf.tu-dresden.de
Tue Mar 11 08:00:09 CET 2008


On Sun Mar 09, 2008 at 23:41:01 -0700, hazwan wrote:
> Currently im studying on how to build an application using fiasco/L4. Im
> very new to this subject and it requires me lots of fundemental issues
> concerning this topic. I need to go deep in the code ie:-the
> roottask/sigma0/kernel implementation. So far i had try some steps to aquire
> answers. One of them is by printing out a thread which is initialize as
> l4_threadid_t. I didnt call any sys calls (l4_myself() to that particular
> thread. So, what i had done is :-
> 
> l4_threadid_t thread;
> l4_threadid_t pager;
> 
> printf("%x\n", thread.id.lthread);
> printf("%x\n", pager.id.lthread);
> 
> when i print this out, the thread will print out its id as 34 in hex.
> Meanwhile the pager will identify as 0 for its lthread id. The question is
> why is this happening? If i turn back around the code, it will still print
> out the thread as 34 for its id and pager is 0. Is it reading some garbage
> value from the memory or the roottask/sigma0/kernel will identify it as 34
> only if we didnt initialize any system calls. I need to study this in depth
> due to my yearly project which highly involves fiasco/L4 as its platform. If
> it is applicable, can anyone show me which file(header/*.c etc..) that
> locates the number of 34 happens. Thanks. 

If I understand this corrently this just happens because you're using
the C language. Non-initilialised variables on the stack are undefined
and might contain anything, there's no magic. You should be familiar
with C...



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list