Hello Jason,
On 04/01/2011 01:02 AM, Jason Philip wrote:
I take your advice but nothing change. I do not know what you mean by "use the top of the stack rather than the bottom" if i say "sp = (L4_Word_t)stack" would that mean the start address of the array? But just in case I use "sp = stack[1023]"
No, use 'sp = &stack[1024]'. This way, the initial sp points to the address just beyond the stack array. When the first stack element is pushed, the stack pointer gets pre-decremented and thus, the first element gets stored at offset '1024 - sizeof(L4_Word_t)'.
Please also remove the 'L4_Wait' call from your 'Jenev' function. There is no need to explicitly wait for the startup message. This message is implicitly handled by the kernel to start the execution of the new thread. As your code stands right now, the new thread would infinitely wait for a new message because no one is sending anything.
BTW, you could have figured this out by yourself with the help of the Pistachio kernel debugger. Please do not expect the subscribers of this mailing list to lend a helping hand for debugging your program if you are not willing to at least give the kernel debugger a serious try.
Good luck Norman