[ANN] node-jslinux and typed-arrays

834 views
Skip to first unread message

Tom Robinson

unread,
May 20, 2011, 8:53:24 AM5/20/11
to nod...@googlegroups.com
Just for the hell of it I got the jslinux emulator (http://bellard.org/jslinux/) working in Node, and of course to do that I needed more complete implementations of typed arrays:

https://github.com/tlrobinson/node-jslinux
https://github.com/tlrobinson/v8-typed-array

I included a little command line wrapper so you should be able to type:

1) npm install jslinux
2) jslinux

Or you can call boot() from the "jslinux" module:

$ node
> require("jslinux").boot()
[Node.js switching to raw mode. Hit Ctrl-C four times in a row to exit.]
{ base: '/usr/local/lib/node/.npm/jslinux/0.0.1/package/external/',
terminal:
{ handler: [Function: Jf],
...
boot: [Function] }
> Starting Linux
Linux version 2.6.20 (bellard@voyager) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 Wed May 18 23:22:20 CEST 2011
BIOS-provided physical RAM map:
...
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 124k freed
Welcome to JS/Linux
~ # echo hello node
hello node
~ #

Enjoy!

-tom

p.s. I'm still waiting for someone to get Node in jslinux working. We need to go deeper!

Daniel Baulig

unread,
May 20, 2011, 9:25:39 AM5/20/11
to nod...@googlegroups.com
Am 20.05.2011 14:53, schrieb Tom Robinson:
> p.s. I'm still waiting for someone to get Node in jslinux working. We need to go deeper!

Yo dawg, I heard you like node, so we put a node in your node, so you
can run JavaScript while you run JavaScript? ;)

mscdex

unread,
May 20, 2011, 9:38:26 AM5/20/11
to nodejs
Then we can run jslinux within node within jslinux within node! :-D

Scott Elcomb

unread,
May 20, 2011, 9:43:55 AM5/20/11
to nod...@googlegroups.com
On Fri, May 20, 2011 at 8:53 AM, Tom Robinson <tlrob...@gmail.com> wrote:
> Just for the hell of it I got the jslinux emulator (http://bellard.org/jslinux/) working in Node, and of course to do that I needed more complete implementations of typed arrays:
>
> https://github.com/tlrobinson/node-jslinux
> https://github.com/tlrobinson/v8-typed-array

Thanks Tom! Please consider letting Fabrice know; I was in contact
with him a couple of days ago inquiring about non-minified sources.
He hasn't decided yet but perhaps if he sees active interest from
developers (like what you've done here) he may be more inclined to
open source his code.

Cheers,

--
  Scott Elcomb
  @psema4 on Twitter / Identi.ca

  Atomic OS: Self Contained Microsystems
  http://code.google.com/p/atomos/

  Clerk of the Pirate Party of Canada
  http://www.pirateparty.ca/

Diogo Resende

unread,
May 20, 2011, 10:10:42 AM5/20/11
to nod...@googlegroups.com
On Fri, May 20, 2011 at 1:53 PM, Tom Robinson <tlrob...@gmail.com> wrote:
> Just for the hell of it I got the jslinux emulator (http://bellard.org/jslinux/) working in Node, and of course to do that I needed more complete implementations of typed arrays:
>
> https://github.com/tlrobinson/node-jslinux
> https://github.com/tlrobinson/v8-typed-array
>
> I included a little command line wrapper so you should be able to type:
>
> 1) npm install jslinux
> 2) jslinux
Just like the online demo (tried on Chrome 12), the boot stops here:

"Freeing unused kernel memory: 124k freed"

After a while, my pc starts to get slower.

Ryan Gahl

unread,
May 20, 2011, 10:11:28 AM5/20/11
to nod...@googlegroups.com
This is nasty cool.

Can't wait to see Gnome or KDE running in this :)

Meta-Quake anyone?





--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.


Diogo Resende

unread,
May 20, 2011, 10:25:52 AM5/20/11
to nod...@googlegroups.com
On Fri, May 20, 2011 at 3:11 PM, Ryan Gahl <ryan...@gmail.com> wrote:
> This is nasty cool.
> Can't wait to see Gnome or KDE running in this :)
> Meta-Quake anyone?

I'm not thinking about that but maybe virtual hosting using virtual
node machines. The only problem is jslinux does not have networking
working properly yet (I think).

Scott Elcomb

unread,
May 20, 2011, 10:37:29 AM5/20/11
to nod...@googlegroups.com

No, but a websocket-based device in /dev might do the trick. :-)

Bradley Meck

unread,
May 20, 2011, 10:55:22 AM5/20/11
to nod...@googlegroups.com
Yea, but how to emulate a listener socket...

Vyacheslav Egorov

unread,
May 20, 2011, 11:22:23 AM5/20/11
to nod...@googlegroups.com
> Just like the online demo (tried on Chrome 12), the boot stops here:
> "Freeing unused kernel memory: 124k freed"

This was caused by a bug in the optimizing compiler.

If you are using V8 3.3.x consider upgrading to 3.3.8.1
If you are using V8 3.2.x consider upgrading to 3.2.10.10
V8 3.1.x should not be affected by the problem.

--
Vyacheslav Egorov

Laurie Harper

unread,
May 20, 2011, 12:44:10 PM5/20/11
to nod...@googlegroups.com
Stunned. O_O

Very cool :-)

> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>

--
Laurie Harper
http://laurie.holoweb.net/

Nick

unread,
May 20, 2011, 1:00:48 PM5/20/11
to nodejs

Well, now if anyone asks the old Slashdot standby, "Yeah, but does it
run Linux?" We can say, "Yes, yes it does."



On May 20, 8:53 am, Tom Robinson <tlrobin...@gmail.com> wrote:
> Just for the hell of it I got the jslinux emulator (http://bellard.org/jslinux/) working in Node, and of course to do that I needed more complete implementations of typed arrays:
>
> https://github.com/tlrobinson/node-jslinuxhttps://github.com/tlrobinson/v8-typed-array

Stephen Belanger

unread,
May 20, 2011, 1:03:53 PM5/20/11
to nod...@googlegroups.com
Now we just need it to run Crysis and we've got all the bases covered. :O

Mark Hahn

unread,
May 20, 2011, 2:37:09 PM5/20/11
to nod...@googlegroups.com
When will the online implementation be fixed?  I'm very curious to try it.

Scott Elcomb

unread,
May 20, 2011, 3:07:14 PM5/20/11
to nod...@googlegroups.com
On Fri, May 20, 2011 at 2:37 PM, Mark Hahn <mha...@gmail.com> wrote:
> When will the online implementation be fixed?  I'm very curious to try it.

The author is currently learning JavaScript, so it might be a bit. In
the meantime the easiest way to try it out is probably to download a
copy of Firefox 4 <http://www.mozilla.com/en-US/firefox/all.html>

I had to do the same, but was worth it to see linux running
in-browser. (Of course now I'll just be using Tom's module - at least
until there's an update to JS/Linux.)

Stefan Zehe

unread,
May 23, 2011, 6:21:39 AM5/23/11
to nod...@googlegroups.com
Am 20.05.2011 16:55, schrieb Bradley Meck:
> Yea, but how to emulate a listener socket...

simulate the whole networking thing over one single websocket-connection.

Yauhen Yakimovich

unread,
Jul 13, 2011, 9:08:57 AM7/13/11
to nodejs, jslinux-...@googlegroups.com
Hi,

Recently I've arrange an internet connection for jslinux box (without
nodejs). Project is called jsmodem. It is just a script based on what
I have learned from Bellard's code. I would appreciate some feedback
and testing of http://www.youtube.com/watch?v=MEsmgHrKQYM. Code is on
github.

PS It would be great if someone who is in contact with Fabrice could
tell him a word. I was unable to reach him.

On May 20, 2:53 pm, Tom Robinson <tlrobin...@gmail.com> wrote:
> Just for the hell of it I got thejslinuxemulator (http://bellard.org/jslinux/) working in Node, and of course to do that I needed more complete implementations of typed arrays:
>
> https://github.com/tlrobinson/node-jslinuxhttps://github.com/tlrobinson/v8-typed-array
>
> I included a little command line wrapper so you should be able to type:
>
> 1) npm installjslinux
> 2)jslinux
>
> Or you can call boot() from the "jslinux" module:
>
>     $ node
>     > require("jslinux").boot()
>     [Node.js switching to raw mode. Hit Ctrl-C four times in a row to exit.]
>     { base: '/usr/local/lib/node/.npm/jslinux/0.0.1/package/external/',
>       terminal:
>        { handler: [Function: Jf],
>            ...
>       boot: [Function] }
>     > Starting Linux
>     Linux version 2.6.20 (bellard@voyager) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 Wed May 18 23:22:20 CEST 2011
>     BIOS-provided physical RAM map:
>         ...
>     VFS: Mounted root (ext2 filesystem).
>     Freeing unused kernel memory: 124k freed
>     Welcome to JS/Linux
>     ~ # echo hello node
>     hello node
>     ~ #
>
> Enjoy!
>
> -tom
>
> p.s. I'm still waiting for someone to get Node injslinuxworking. We need to go deeper!

dvbportal

unread,
Jul 14, 2011, 12:37:32 PM7/14/11
to nod...@googlegroups.com, jslinux-...@googlegroups.com
This is very impressive. Networking was a big missing point and many people said that it couldn't be done with JSLinux. Your solution works perfectly and shows what can be achieved with Linux and some deeper knowledge about it. You found a very clever way using socat. Everything worked out of the box. I just changed python2.6 into python in serve.sh because natty comes with 2.7.

Now I need a ssh client and have then a web-based administration console.

Linus G Thiel

unread,
Jul 14, 2011, 1:01:41 PM7/14/11
to nod...@googlegroups.com
Amazing! Great job, someone has to ping Fabrice Bellard. Try it out,
it's nicely packaged and simple to get up and running.

Git repo:
https://github.com/ewiger/jsmodem

> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines


> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com

> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com

> For more options, visit this group at

> http://groups.google.com/group/nodejs?hl=en?hl=en
>

--
Linus G Thiel
Hansson & Larsson
http://hanssonlarsson.se/
+46 709 89 03 85

Scott Elcomb

unread,
Jul 14, 2011, 2:23:22 PM7/14/11
to nod...@googlegroups.com
On Wed, Jul 13, 2011 at 9:08 AM, Yauhen Yakimovich
<eugeny.ya...@gmail.com> wrote:
> Recently I've arrange an internet connection for jslinux box (without
> nodejs). Project is called jsmodem. It is just a script based on what
> I have learned from Bellard's code. I would appreciate some feedback
> and testing of http://www.youtube.com/watch?v=MEsmgHrKQYM. Code is on
> github.

I look forward to trying this out - and it may help with a
proof-of-concept I'm working on. I also have partial networking in
place: basic ethernet devices and an emulated network. I expect to
have full networking (along with other useful improvements) sometime
next month.

I'm working on a project authorized by Mr Bellard (for research &
demonstration only) for a Toronto presentation I'm giving in October.
I'd be happy to bring jsmodem up next time I speak with him, though
it'll likely be several weeks before I do.

Reply all
Reply to author
Forward
0 new messages