lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Messa
?ÃhD: <B6C802AB.250F%rw20@cornell.edu>
In-Reply-To: <20010304014648.A2157@home.com>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit

Handles in PalmOS are allocated out of dynamic memory.

If you do allocated memory from the storage heap then you generally have to
write to the memory using DmWrite and not through pointer assignment (*ptr =
value).  If you do the later then a hardware memory exception is raised by
the DMA.  In short you'd either have hack PalmOS, grab the memory semaphore
(a dangerous proposition and not officially something developers should do)
or change every *ptr = value in the Lua source.

My guess is that you are still using the "limited" dynamic heap.

Russ Webb
PalmOS Engineer

> From: Lenny Palozzi <lenny.palozzi@home.com>
> Reply-To: lua-l@tecgraf.puc-rio.br
> Date: Sun, 4 Mar 2001 01:46:48 -0500
> To: Multiple recipients of list <lua-l@tecgraf.puc-rio.br>
> Subject: Lua running on PalmOS!
> 
> I hacked a version of Lua to run on PalmOS.
> 
> In short
> * used latest gcc tools
> * compiled with PalmOS v2 SDK
> * running on PalmOS 3.1 (that's all I have), should run on PalmOS 2!
> * followed LTN 2 for a minimal version
> * rewrote Lua's generic memory allocator
> - used memory handles so memory is not allocated in the limited dynamic heap
> - memory allocation is the most difficult issue of this port. Different
> versions of PalmOS have different limitations.
> - different strategies could be used to su
?Ãht each version
> * commented a few calls to unsupported functions (fgetc, etc...)
> * test app(very limited) and Lua compiled as single executable.
> ~33K prc.
> * am able to register a C function and call it from lua, manipulate global
> variables (and opening and closing of Lua states of course)
> 
> Not sure where I will go with this, a stable port maybe? Comments?
> 
> Thanks,
> -Lenny.