GithubHelp home page GithubHelp logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
STarted on a local copy of trunk.  The first tricky issue is that an image file 
will be 
used at 2 times: (1) when a module is imported to read it into a code object 
and (2) 
when the code object is executed to fetch the bytecode.  So a method is needed 
to store 
the file name for (1) and (2) and to store an offset to the bytecode for (2).

The second tricky issue is that during VM execution, the pointer to the open 
file must 
be switched every time the frame pointer changes; unless the bytecodes are read 
into a 
RAM buffer.

Original comment by [email protected] on 5 Mar 2010 at 4:58

  • Changed state: Started

from python-on-a-chip.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
I've posted a question on the mbed forums asking about a feature that would 
greatly 
simplify solving this issue (http://mbed.org/forum/mbed/topic/567/).  I'm going 
to wait 
for a response.

Original comment by [email protected] on 5 Mar 2010 at 5:28

from python-on-a-chip.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
How elua accesses the filesystem:
http://mbed.org/users/jsnyder/notebook/elua-preliminary-port/

Original comment by [email protected] on 8 Jul 2010 at 5:00

from python-on-a-chip.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Attached patch of partial work.  I do not like the direction the work was 
headed (it runs into the problems mentioned above).  Patch is against r441.

Original comment by [email protected] on 18 Oct 2010 at 4:12

Attachments:

from python-on-a-chip.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
I investigated this recently in order to bypass the need to recompile my code 
every time or load it from ipm.  I modified main.cpp to automatically load a 
fix-named compiled python file output from pmImgCreator into malloc'd RAM.  I 
use img_appendToPath() to make the code available.  I also read a name of a 
module to run from a file called autorun.txt.  If none of that works then it 
just runs "main" as before otherwise it runs whatever module was specified.  
Since the mbed has a pretty good chunk of RAM I figure that this will allow 
quite a bit of code to be loaded on the fly.

Ideally it would be nice if the filesystem could be part of the import search.  
So if the module is not found it would be loaded in a similar manner to this 
(but keep those names short, mbed has an 8.3 file name limit).  I poked around 
the code but my stumbling block for this is keeping it multi-platform 
compatible (to be rolled into the distribution).  I'm very hesitant to make 
changes deep into the code base for fear of having a mess of tracking updates.  

I'm attaching my new main.cpp in case anybody is interested in my kludge-fix.  
Obviously the concept could be extended to have a text file listing the names 
of python files to load rather than just having a fixed single name.

Original comment by [email protected] on 8 May 2011 at 1:42

Attachments:

from python-on-a-chip.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Unfortunately it looks like I left a few tidbits of information in my comment 
above.  Only one week away and I had forgotten how to make this work.

Use the pmImageCreator.py tool using the -f, -b, and -o options to generate a 
file called pslib.pbn (an arbitrary name I made up, change the main.cpp if you 
want a different name).  You can pass in as many .py file names to compile as 
you want when you run pmImageCreator.  Change the module name in autorun.txt to 
correspond with one of your .py files you compiled.  Don't compile a file with 
the name main.py since the standard p14p build already uses that name.

Original comment by [email protected] on 15 May 2011 at 8:25

from python-on-a-chip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.