Thursday, April 21, 2005

Update

OK... So I have trying to debug the multi-tasking code yesterday and today and no luck. I just cannot call MemMove from and to the stack while its in use. I will use a different technique which is the A7 register stack pointer. Hopefully this will work since so many developers tell about it. People have no idea how hard these things are to design. The proccess should be quite simple where I copy the stack to dynamic memory and set the A7 to the copied stack. When I want to restore the stack, I just set the A7 back to the original location and Jump to the right location in code. This way I always have the threads stack in a saveable location in dynamic memory. Cobalt doesn't allow to pass dynamic memory through SysAppLaunchRemote calls so I use dynamic memory to pass the stack but use feature memory to pass it back which means that on Cobalt it will be slower although the proccessor should be faster anyway so no big deal hopefully. Garnet on the other hand just passes a system dynamic allocated stack which is used and switched between application launches. Once I know that I can swatch threads locally, I will write PublicThread component which will allow the object storage to be able to multi-task (so you can copy an object and switch to another thread in between).

No comments: