Porting Pythin to embedded platform

Phil Thompson phil at river-bank.demon.co.uk
Wed Jan 2 20:51:55 EST 2002


Frederic Rudman wrote:
> 
> 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




More information about the Python-list mailing list