Porting Pythin to embedded platform 
Author Message
 Porting Pythin to embedded platform

I'm new to python. I'm looking for a small portable language to quickly port
to a small-memory based embedded system.

1) Does anyone know where to best get info on that?
2) What's the general footprint of python in an embedded system (ballpark)
3) Is there a "parser phase" output to python (so that I only need to port
the interpreter to the embedded base: no interactivity needed there anyway)
and if so, what's the general footprint of the interpreter? Or do I need to
port the parser as well?
4) What level of ANSI C api do I need for a port: all of it, the memallocs
only, something in between?

Any other pointers for porting python to a non-linux, non-intel platforms
would be appreciated.

BTW: I'm not sure if this is the right group for these questions but it's
the only group I found on my ISP (if there's a better suited group, please
let me know, and sorry for the inconvenience).

Sincerely,
Frederic Rudman



Mon, 21 Jun 2004 07:21:43 GMT  
 Porting Pythin to embedded platform

Quote:

> I'm new to python. I'm looking for a small portable language to quickly port
> to a small-memory based embedded system.

> 1) Does anyone know where to best get info on that?
> 2) What's the general footprint of Python in an embedded system (ballpark)
> 3) Is there a "parser phase" output to python (so that I only need to port
> the interpreter to the embedded base: no interactivity needed there anyway)
> and if so, what's the general footprint of the interpreter? Or do I need to
> port the parser as well?
> 4) What level of ANSI C api do I need for a port: all of it, the memallocs
> only, something in between?

> Any other pointers for porting python to a non-linux, non-intel platforms
> would be appreciated.

I've just gone through the process of porting the latest Python to the
Sharp Zaurus. This is Linux, but non-Intel. Python itself is quite
small, but has fairly large number of extension modules and it isn't
obvious how may of these are really used.

I put most of the work into understanding the module interdependencies
with the aim of producing a sensible core, but reducing some of the
requirements of the core on (for example) distutils and pydoc.

On the Zaurus the size of the interpreter is just under 800K, and the
core modules another 300K. I haven't looked at run-time memory usage.

Getting the code to compile was fairly straightforward. The Python build
process isn't designed for cross-compilation - but it's easy enough to
hack.

Phil



Mon, 21 Jun 2004 09:51:55 GMT  
 Porting Pythin to embedded platform
Le 02/01/02 23:21, Frederic Rudman crivit:

Quote:
> I'm new to python. I'm looking for a small portable language to quickly port
> to a small-memory based embedded system.

I'm all for Python, but Lua is somewhat smaller than Python (and less
powerful), while still having a nice syntax. Don't have the URL at hand.

Quote:
> 1) Does anyone know where to best get info on that?

For specific problems, right on this list/newsgroup :-)

Deeply Embedded Python might be interesting to you:

    http://www.abo.fi/~iporres/python/

It's a port of Python 1.5.1 to an embedded system without even an OS.

Quote:
> 2) What's the general footprint of Python in an embedded system (ballpark)
> 3) Is there a "parser phase" output to python (so that I only need to port
> the interpreter to the embedded base: no interactivity needed there anyway)

If I understand correctly, this is what happens anyway when "embedding"
Python, i. e. link to libpython.(a/so) resp. the Python DLL on Windows.

Quote:
> and if so, what's the general footprint of the interpreter? Or do I need to
> port the parser as well?
> 4) What level of ANSI C api do I need for a port: all of it, the memallocs
> only, something in between?

There Python core shouldn't need much ANSI C. You task will probably be
to decide which modules you want to compile in. Just deselect the
modules you don't want to have in the core by editing Modules/Setup, and
for getting out even more, you can use a few #ifdefs.

Also check the autoconf build options (if autoconf applies to your build
process at all; else just "fake" it, like the Windows build process
does: edit pyconfig.h by hand). You can for example build without
threads and Unicode support.

My only experience is that I cross-compiled Python 2.2 for my Compaq
iPAQ running Linux/StrongArm.

Gerhard
--
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



Mon, 21 Jun 2004 10:24:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Porting application to other platforms

2. Porting Clipper Application to Mac platform

3. Looking for port of C2Ada to Wintel platforms or help porting

4. Porting GCC/LD/AS to diffierent CPU/PLATFORM

5. Porting GNAT to other platforms

6. Porting Python to non-pc platforms

7. Porting distribution to new platform

8. Porting from other UNIX platforms to Linux (64bit)

9. Guidelines for porting Tcl to new platforms

10. Porting to non-ASCII platforms

11. Porting tk to new platform

12. Porting ST/V to different platforms

 

 
Powered by phpBB® Forum Software