Chi-Yi Lin wrote:

> Thank you for your reply. The information is very helpful.
>
> For the reason why I would like to know how system globals
> are allocated, I'm trying to implement an utility that takes snapshots
> of the dynamic heap and then the dynamic heap could be recovered
> later using the snapshot. In my experiment, the recovery process
> restores all the memory content except the stack region of the recovery
> process itself.

What is the intent of this program?

> The restoration of memory content seemed successful
> when I ran the utility through debugger, but finally the system crashed
> when I tapped on the silk-screen button after the restoration completed.
> I'm wondering if I should not overwrite the system globals, so I would
> like to know where the system globals are and try not to overwrite them
> during recovery.

You are really moving into a lot of territory that isn't well documented at all in the 
PalmOS.  My guess is that you are trying to
circumvent the OS to preserve state of the machine and bring it back up to that status 
at a later time.  Unfortunately the Kadek
kernel is doing a lot underneath the OS such as memory and thread management.

Thus, to "snapshot" the binary image and preserve the state, you usually need to 
understand all system operations from the CPU reset
vectors on up.  Palm only documents the PalmOS API and not its internals publicly.  My 
guess is that the kernel is not in the same
state when you took the snapshot and are now trying to replace it, thus some sort of 
memory table of semaphore group is not
identical.

If you are willing to state the intention of you application, I'm sure someone here 
can suggest a more orthodox and stable solution
other than raw, binary, memory block access a la microcontroller code.

Steve


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to