At Wed, 04 May 2011 09:47:48 +0200, Andreas Raab wrote:
Very interesting. Can you roughly say what needs to do to get the Squeak VM into NaCL?
- No stdio files. I wrote small wrappers for fopen, ftell, fseek, fread, and etc. for memory buffer.
- No dlsym, dlopen and etc. The Unix VM depends on them so a little simplifications and hack to make a NaCl VM module visible to the main VM. (Thus no external plugin either.)
- Write schemes to get the image data from the net. the JavaScript to NaCl module interface is very limited so you need to work around it.
- Adapt to PPAPI that provides a way to get drawable pixel buffers and get events.
- multi threading for separating the interpreter and browser/NaCl module interaction.
- A lot of figuring out of which library functions actually exists, which of these work and what values to be expected from the browser.
- ...
-- Yoshiki
On 5/4/2011 8:18, Yoshiki Ohshima wrote:
Hello,
I'm playing with Google Native Client a bit and made a port of Squeak VM to it. It is far from complete (even the state where backspace or Cmd-p etc. does not work, sound does not work, etc.), It now reached to the state where I can say the basic part of it is working.
The source code is available at:
http://github.com/yoshikiohshima/NaClSqueak
. Also, f you have Google Chrome 11 beta available, try to turn on the Native Client on (by typing "about:flags" into the title bar) and access:
http://tinlizzie.org/~ohshima/squeak/squeak.html
(The first try may take some time.)
It is gnuify-ed but we're still learning the JIT situation of NaCl. So, it' need some work to port Cog.
The image data is embedded as a C array in this executable. You can remove EMBEDDED_IMAGE_FILE flag off, and comment/uncomment the corresponding part of squeak.html, it can load the image separately via XMLHttpRequest of the browser.
There is some strange issue when you do fast drag the system window.
As you can see, the source code is derived from the Unix VM. It was hard for me to write some CMake stuff to set it up for the cross compilation. A help to merge it back to the Unix code would be greatly appreciated.
If Google takes over the world and all apps become a Native Client (may be even other browsers^^;), this port may be useful^^;
-- Yoshiki