Comments (6)
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.
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.
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.
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.
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.
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)
- Remove pycscope from tools HOT 1
- Multithread HOT 1
- running ipm in Windows desttop
- Create new platform darwin with xcode project HOT 2
- false positive in string/sequence comparison HOT 1
- Patch for /src/lib/dict.py
- PIC32 support? HOT 4
- Linker trouble due to ordering of files HOT 1
- Compiler warning when shifting an 8-bit value beyond 8 bits HOT 1
- Implement SLICE_1,2,3 HOT 2
- Fix string cache
- Implement the simplest form of try/catch HOT 1
- Fix compile system so string cache can be disabled
- Fix sys.time overflow HOT 3
- Fix build break when HAVE_SNPRINTF_FORMAT is false HOT 4
- Fix C_NULL for C++ compiler HOT 3
- Unable to build v10 posix64 HOT 1
- support for user data types
- functions assigned to a class attribute are promoted to members HOT 1
- empty string assignment produces garbage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-on-a-chip.