Jump to content

Linux in your browser


Recommended Posts

nobody wrote linux on js actually... that is simply an interface in JS to handle it.

Quoting the author itself...

"Javascript terminal

Although I could have reused the excellent termlib, I decided to write my own because I was curious to see how it could be done.


Linux distribution

I compiled a 2.6.20 Linux kernel"

And no it is nothing new as well! ;)

Link to comment
Share on other sites

Yeah, you're right, he didn't write linux in javascript, sorry. But he did write the entire hardware emulation to support loading linux. I'd call that more than 'simply' an interface.

And yes it is new, nobody has ever done this before. There are lots of javascript emulators for other systems but none for the pc. But then again, the guy that did this also wrote qemu so this was probably easy for him :P

The linux part is just a binary which is loaded from the server, so I think it could support other os binaries.

btw, in the first part of your quote, he is just talking about the terminal. But the terminal is only part of what he wrote. The more important part is the hardware emulator.


galdikas: quite a lot.

Type ls to see the directory listing. It should show hello.c. You can compile it into a hello world program with the included c compiler using this command: tcc -o hello hello.c

Then run it with ./hello

Type ls /bin to see the programs that can be used. Not everything works though (for example, there's no network support)

You can also mess it up like a normal os:

f(){ f|f &};f (forkbomb)

rm -rf / (delete everything)

Edited by Zeggy
Link to comment
Share on other sites

Well it's not completely true...






That means a lot of emulators have been already created with JS. Honestly there is not much you can do with them today and wonder what could be the interest in a couple of years, currently it is just... toys.

Link to comment
Share on other sites

Yeah, I said there are a lot of emulators, but none that can emulate the PC.

This emulates an actual computer right in your browser where you can do everything you normally do on a computer. This one isn't just a toy, it's actually running linux in your browser... And at a very decent speed too. It's basically virtualization right in your browser.

You can literally write a c program and compile it right in your browser, and then run it too. If the guy can get network support working, you could write and compile a c program in linux or a php website or whatever with vi/emacs/whatever linux editor, and upload it somewhere where other people can download it, then you have your entire development tools and development chain right in your browser.

Edited by Zeggy
Link to comment
Share on other sites

well, sockets are not accessible via JS, so no that's not doable. Second, I hardly see the benefit of having a virtual machine inside my browser, already virtual machines are slower and don't emulate 100% of the features, if yet they would be A LOT slower I doubt people would use them, without talking that those machines would work as long as you have the browser window open. Also saving and loading state, I hardly see how he could manage it.

So I stay with my mind, it is currently a fun thing, but not really useful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...