Sinisa Marovic (AC/EDD) writes: > I have a few questions for you Palm OS programming gurus. I'm still a > newbie in this area, and still missing the whole picture. I'm porting > some program to run completely on ARM, and I wolud like somebody to help > me with the following issues: > > 1. Would it be correct to say that PilotMain has to reside in the code > to be compiled for m68k, and not arm? Meaning that because of backward > compatibility OS assumes every application is running m68k code, and > then eventually calls arm routines?
Yes, PilotMain() must be m68k code on Palm OS 5. The only exception is the Tapwave Zodiac device, which provides an all-ARM environment. > 2. Is it possible to have arm code inside m68k without "Standalone.h", > i.e. using STANDALONE_CODE_RESOURCE_ID directive? I tried to avoid it, > and everything worked fine (copilation and linking) until build-prc. Short answer: yes. The macros from Standalone.h add a special tag to your generated ARM code which build-prc recognizes. Then build-prc can distinguish between ordinary m68k code and ARM code meant to be called with PceNativeCall(). > 3. How do I use global variables? I used "Standalone.h" directives in > order to avoid build-prc problems, and would like to have global > variables only on ARM scope. By default, you don't. This is a fundamental limitation of the PceNativeCall() mechanism provided by Palm OS. PceNativeCall() does nothing to initialize global data references and constant strings, so if your ARM code tried to use them it would get random results. Your compiled code had a data segment, but build-prc ignored it because PceNativeCall() wouldn't recognize it anyway. There are several ways to augment PceNativeCall() to add global data support. None is perfect or completely transparent to you. * Metrowerks CodeWarrior provides the PnoLoad() / PnoCall() API to use ARM code built with CodeWarrior. I think it supports C++. However, CodeWarrior is not free and only runs on Windows. http://www.metrowerks.com/ * Peal provides the PealLoad() / PealCall() API to use ARM code built with PRC-Tools and postlinked with a special program. However, Peal does not currently support C++. http://www.sealiesoftware.com/peal/ (Disclaimer: Peal was written by me.) * elink and ARM Relocatable ELF Loader are similar to Peal; they provide a special linker or postlinker and a runtime API. I don't know how they compare to Peal's capabilities or whether they support C++. http://home.comcast.net/~beebeb/elink/index.htm http://hilary.e-fever.org/arm-elf/ -- Greg Parker [EMAIL PROTECTED] pssh: SSH 2 for Palm OS 5 http://www.sealiesoftware.com/pssh/ Peal: Palm ELF ARM Loader http://www.sealiesoftware.com/peal/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
