Linux In JavaScript, With Persistent Storage 171
An anonymous reader writes "Remember Fabrice bellard's [Linux-booting PC emulator in JavaScript] ? This modified version [Note: click on "emulator.html" in that directory to see it in action] allows the same emulator to boot the most recent linux kernel, 3.0.4, as well as providing the user with persistent storage. It is achieved by building a virtual block device, which stores data in HTML5 local storage. The block device can be partitioned and formatted as ext2, so it can be easily used."
Great! (Score:2, Funny)
Re: (Score:2)
Educational sandbox? (Score:4, Interesting)
Sandbox is all you have (Score:2)
Re: (Score:2)
"unless you represent a major corporation"
So we'll have RedHat, Ubuntu, and Oracle Enterprise Linux and Suse. And I guess the Ubuntu folks get a key for debian as well.
Of course it would negatively affact minor distributions, and I'm totally against it, but don't pretend that Linux would just suddenly disappear.
Re: (Score:2)
You know damned well it doesn't work that way. Ask your local soccer mom. Linux has a scary black background with a cryptic text interface and is either a.) a tool for copyright infringement to steal from hard-working, job-creating content owners b.) only used by subversive teenagers c.) used to commit cyber crimes (just like in The Lawnmower Man and isn't it wonderful that writer in Maine can explain computers to us simple folken, say thankya) d.) a tool of the devil with its black background. Nobody wh
The license of GRUB, for one thing (Score:3)
Only the bootloader needsto be signed for secure boot, so as long as grub is signed, you can boot whatever yoou want.
The license of GRUB requires that it be distributed with "Installation Information", which includes private keys for signing. Operating systems would need to be shipped with a non-GPL bootloader, and makers of home PCs would have no incentive to include keys for this bootloader because boot-time malware could work by installing it and setting it as default.
you can boot linux from the NTloader just fine if you have a system tah only has MS signing keys and no way to disable secure boot.
The NT loader of Windows 8 will check the signature on any kernel it loads, and (I'm guessing) so will the NT loader of Windows 7 and Windows Vista after
Re: (Score:2)
If not, the PC will be no more than a glorified MS version of iPad, and I'll be boycotting any such manufacturer.
Until all well-known laptop manufacturers choose to start making "a glorified MS version of iPad". When faced with a choice between a $350 mainstream laptop with only the Windows key and a System76 laptop for twice the price, what will the general public choose?
Re: (Score:2)
Fortunately I believe people (and even most governments, perhaps not the US one though) won't accepted the dumbing down of the PC to an appliance.
People already accepted the dumbing down of TV-connected video game computers like the C64 to appliances like the NES, and they accepted the dumbing down of the smartphone from Windows Mobile 6 to iOS 1.
Re: (Score:2)
Believe me or not but for a 101 bioinformatics course I taught this year, I picked up jslinux to teach grep, pipe and other shell scripting basics.
This was just the simplest option to get a linux prompt on every machine of the computer lab - and studenta who had brought their own laptops could work on the very same examples as the rest of the class, in an identical environment.
Busybox grep is good enough for teaching the basics to students, and they can access the very same setup from home if they want to r
New Java VM/Script? (Score:2)
Oracle is making announcements about Java 7 and 8 this week. Supposedly the new stuff is better integration between Java and HTML5, and between Javascript and the JVM.
Will that revised tech be good support for an interactive user shell with a Javascript commandline calling Java objects, reporting back HTML5 in a DOM? Interactive HTML5 GUI objects that can take GUI events back into Javascript logic or just Javascript glue to Java objects in the JVM?
Will Android's Dalvik JVM follow that route, or take its own
Re: (Score:3)
I dont think Java will play a big role anytime soon in most of the web. Especially this demo shows, that js itself has become so powerful, that powerful conversion a compilation apis will evolve, completely removing java from interest in the web. and I fear the people who might consider your path of using integration to a VM in the background will use adobe products more for these tasks, where interaction is already given - even if the flash vm sucks.
Your point is however interesting, because it shows what
Re: (Score:2)
ah yeah, and there is the werewolf in the vampire: .net with silverlight and browsers would compete here too on windows devices.
but vampires get fewer after generations of desperate although somehow successful geeky witchhunts.
Re: (Score:2)
I don't see a GUI shell on a JVM being a Web technology. Except that the GUI and JVM could be remote from each other, transparently. Mainly I'm interested in a GUI shell to an OS and a complete machine, distributed or not. That's not really the "Web", though it could be the "Internet".
I'm especially interested in a mobile platform that works this way, so Android - which is an OS dedicated to running a JVM.
I'd like to use a fully dynamic GUI markup format like HTML5 for presentation, Java classes for computa
Re: (Score:2)
Now I understand. There is however in this scenario also the possibility that Google will Go another way.
Re: (Score:2)
Java and Javascript are two completely different technologies. The only thing they have in common is a C-like syntax and four letters.
It's the same thing to glue a Javascript object to a Java object as to glue a C# or Ruby or PHP or Perl or CGI or whatever you're running server-side object to a Javascript or VBScript or Ruby or whatever you're running client-side object.
I find languages like Javascript and Ruby very interesting, but just don't get it mixed up that Java has anything to do with Javascri
Re: (Score:2)
You are wrong. As Oracle has been announcing, Javascript is now supported by (announced) technology in the Oracle JVM.
You were correct for a long time. When introduced, the only connection was a superficial syntax similarity that is shared with many other OOP languages. But, as I pointed out, the "Sun" JVM now has Javascript support in it. FWIW, I wasn't talking about the browser, either.
Re: (Score:2)
..you can use Javascript as a scripting language in a JVM - no still no connection, you can script JVM with Groovy already does this mean it is Java ... no
JVM is a virtual machine, the main language for programming it is Java
You can also program in other languages and script it in several languages - One of this will soon be JavaScript
9.80 BogoMIPS (Score:2, Informative)
Pentium MMX. Is that what everyone gets as well?
Sequence of last story and this one... (Score:3)
"Windows 8 is going to use less memory"
"Oh yeah? Well Linux can run in javascript, ha!"
New malware vector? (Score:3, Interesting)
Re: (Score:3)
But where is the advantage? I would assume that the linux VM would face the same restrictions as any other javascript in a browser.
Re: (Score:2)
As soon as someone figures out a more useful way to access the internet than simply tunneling through http/s, this will effectively provide rooted-box-in-a-box. Ie stuff-all effort to get a huge number of hosts at your disposal. Persistent storage provides an easy way to resume where you left off.
Re: (Score:2)
As soon as someone figures out a more useful way to access the internet than simply tunneling through http/s
How about a kernel mode driver inside the browser-based Linux box for a network stack tunnelled over HTTP/s to a dedicated application running on the same host as the browser to decapsulate tunnelled traffic and dump it onto a local virtual network bridge, kind of like the one used by VMware Workstation or Xen ?
Or even just an application utilizing a Java extension API to allow the Linux-in-br
Re: (Score:2)
As soon as someone figures out a more useful way to access the internet than simply tunneling through http/s [...]
As soon as that happens, an attacker could just write his program in javascript instead of stuffing it into a VM running on the same JS engine, with the same access restrictions.
[...] to a dedicated application running on the same host as the browser [...]
What's with all the hoops? if the attacker can run an application with net access, there is no need for a Linux VM.
Re: (Score:2)
What's with all the hoops? if the attacker can run an application with net access, there is no need for a Linux VM.
I'm suggesting the application would be something 'legitimate' with legitimate uses eg users who WANT their Linux-in-browser to have network connectivity, to help with training or whatever function this Linux VM is being used for.
Re: (Score:2)
So, to break the Linux-in-a-browser out of the browser security sandbox the malware distributor simply has to gain the ability to run a HTTPS server on the same client machine outside that the Linux-in-a-browser can talk to and that will then issue the actu
Questions (Score:2)
Re: (Score:3)
I logged in with root and no password.
I guess you could install a webserver on it, then maybe even host those same files (including "emulator.html")...
Then on another session open a web browser, point to your webserver and open the emulator...
That way you'd have an emulated web server serving an emulator that is being run on an emulated web browser emulating linux.
Re: (Score:2)
Re: (Score:3)
standard linux fresh-install login.
username root
no password.
Makes me wish (Score:3)
While jsLinux is cool, and this is a cool addition, it just makes me wish JavaScript wasn't the only languageVM embedded in the browser. The thought of what could be done if one could take advantage of what the various scripting languages do best instead of trying to fit JavaScript to everything makes me sad.
Native Client (Score:2)
Re: (Score:2)
Salt and Pepper, PPAPI, are really cool if you write C/C++. I was talking more broad like Parrot.
Re: (Score:2)
Although I'm not sold on the "use the best language for the job" mentality, I have better things to do than learn new languages and port my code from one to another. I see no reason why a single language can't do everything from user scripts to systems development, while maintaining elegance and expressiveness. Not saying that language has been invented yet (or will be any time soon), but still.
Re: (Score:2)
I have better things to do than learn new languages and port my code from one to another
That sounds a lot like what a person that writes Python, Perl, Squeak, etc... would say when asked to re-write everything in JavaScript for the web. :)
IMHO. Computer languages are tools. The more tools you know how to use the easier life will be.
Re: (Score:2)
If you want to embed multiple language VMs in the browser, you immediately start having issues with cross-VM reference cycles causing leaks. The infrastructure needed for breaking those is .... nontrivial. You also get very complicated interactions performance characteristics as the VMs interact. Note that historically browsers have had issues just solving these problems for the JS VM and C++ DOM, without adding more VMs into the mix.
A better bet may be having a single VM that multiple languages can comp
Re: (Score:2)
I was referring to your second example, JVM, though it isn't a very good example. All the languages need to be "JIT'd" before use. Parrot is the better example. If they would nail down the embedding API we might have what I think people would like. I certainly would.
Re: (Score:2)
Yes, but why is Parrot a better approach than just compiling to JavaScript and using the existing JS VM?
(And note that Parrot is much like ActiveX: an unspecified single-vendor kinda thing.)
Re: (Score:2)
1) You loose a lot in translating code. No optimizations.
2) You can not use libraries native to the language.
3) You end up having to write/correct the translators with "if (typeof myFunction=='undefined') {"
unspecified single-vendor? ActiveX is a response to NPAPI with gapping holes in system security. Adding a VM that can interpret native code eliminates ActiveX, NPAPI, and PPAPI while, if done correctly, creates a jail/sandbox for web content.
Re: (Score:2)
> 1) You loose a lot in translating code. No
> optimizations.
This is true of any intermediate representation not designed with a particular language in mind, to some extent. The emscripten compiler does in fact do a fair amount of optimization, and it's operating on LLVM bitcode that's already had some optimization passes applied.
> 2) You can not use libraries native to the language.
In the specific case of emscripten, again, you just compile the libraries,
> 3) You end up having to write/correct
Re: (Score:2)
Parrot is GPL'd. Being locked into Open Source for code visible to any user isn't much of a lock in.
Re: (Score:2)
1) Many project can't use GPL'd code. Opera comes to mind, say.
2) Being GPL'd in this case just means you can fork it, not that you can affect its development or prevent changes that break you. Google has complete power to evolve Parrot in any way it wants, and if it happens to break other browsers that happen to be using Parrot or breaks websites they have no choice but to deal. It's not quite as bad as being locked into something you _can't_ fork, of course. But don't pretend like it's "not much of
Re: (Score:2)
Er, I just realized there's some confusion here (on my end) between Pepper and Parrot. So ignore what I said here while I go and read up on Parrot details. ;)
Re: (Score:2)
:) and while your at it think about why google didn't spend some effort advancing parrot instead of dumping yet another scripting language on us. it boggles the mind.
Re: (Score:2)
The answer is Curl http://en.wikipedia.org/wiki/Curl_(programming_language) [wikipedia.org]
this is a full programming language that also does markup, scripting, CSS, all in one language ...
Re: (Score:2)
Curl allows one to have my_python_code.py, my_perl_code.pl, and my_javascript_code.js files on the server and content type tags for perl, python, and javascript and the browser will interpret the three scripting languages and apply the code to the content? That is the behavior I, obviously poorly, tried to describe.
Re: (Score:2)
Can I get a link from you of an example please. Something small and easy to dig through would be nice.
Year of (Score:5, Funny)
All hail the year of linux in the browser!
One in each tab ... (Score:3)
Remember comrade.... (Score:2)
Self contained thin client applications, anyone? (Score:2)
This'll be handy for those who've bought into the Google Chromebook and discovered that all they get is a browser... no, seriously, don't you guys think you were even the slightest bit done over, when you can get a webbook for £60 with free lifetime data allowance?
Education purposes.. (Score:2)
Did anyone manage to run stuff like gcc in this? It would make a _GREAT_ education tool.
(network access would be great too, but I guess that would be pretty hard with javascript...)
Re: (Score:2)
Fabrice's original came with tcc and qemacs, both of which he wrote.
iPad (Score:3)
JavaScript a la PowerShell? (Score:2)
Can I get a JavaScript engine that copies the best features of MS PowerShell script (as PS has copied the best features of JS, Perl, csh, and Java/C++)?
Mainly I'm looking for a typed object pipeline with reflection the shell can access. Reflection that exposes APIs of all the classes (bundled in apps and in the OS) installed in the system. Which, as Javascript, should mean "installed in the Internet". Javascript that wraps reflection via CORBA or some other webservices registry/server would be extraordinary
Sync Browser Linux With Server Linux (Score:2)
This web app would be even cooler if the local Linux state could be synced with a server's state. If I could run commands locally, generating a history file that I could send to a server to execute over again there. Or vice versa, where I create state in the local Linux by rerunning history commands downloaded from the server. Or sync either direction, line by line. A kind of "VMWeb".
As it is I don't see any way to install any app in it, either by downloading a binary or by compiling typed-in source locally
This Is Not Linux in Javascript (Score:5, Insightful)
This cool Web app is not "Linux in Javascript". It is in fact a "Javascript PC Emulator", just as the app says in the app's page title. It's a bootloader and a virtual PC implemented in Javascript running in the browser JS engine. Which loads a stripped-down Linux binary into itself and runs it, as if it were running on the PC. The Linux was written in C, compiled into PC (x86) machine instructions like any PC Linux, and then runs on the Javascript PC emulator.
I suppose it might be possible to run a Windows binary on it, if that bloatware would fit in the browser. Maybe DOS, or even Novell Netware (though this Linux demo has its networking stripped, and in any case the browser enforces the originating-server-only network access).
Very admirable project. Truly journalistic bad headline and summary.
I'm holding out for the Brainfuck version ... (Score:2)
which dynamically compiles x86 code into Excel macros.
*duck*
Latest kernel (Score:2)
...is actually 3.0.6. kernel.org is back up but it's not updating properly.
Re:uhhh (Score:5, Insightful)
Because you can? Because nobody else has done it? Because it's cool? Because it's a challenge?
It depresses me that everyone always responds to these articles with "Why?" and "What's the point?" and "What a waste of time". The whole of human achievement is pretty much the story of people doing things just to see if they can, or because it's interesting to them, or because it's never been done before.
Re: (Score:3)
Re: (Score:2)
The whole of human achievement is pretty much the story of people doing things just to see if they can, or because it's interesting to them, or because it's never been done before.
Most of the achievements that actually push the world forward have been either to impress girls, make money or scientific curiosity. Hobbies don't tend to have the ambition to do any of those things, only to have personal value to you. It'd be a snowball's chance in hell if me watching TV or playing video games lead to anything like an achievement (or well, lately games have been giving me 100s of achievements for random crap). Sports or exercise might get me in better shape, but I'm not about to set any re
Re: (Score:3)
Most SW development isn't either to impress girls, make money, or even "scientific" curiosity (not eve CS). It's to enjoy doing something the doer has never themself done before, and/or have the results from your own labor. A pretty good amount of SW development motivated by that has pushed the world forward.
That is a lot different from hobbies like watching TV or playing video games. The difference is between producing something, and consuming something. Very little consumption has ever pushed the
Re: (Score:2)
Re: (Score:2)
It depresses me that some people think whacking away at a keyboard at some random futility is in any way comparable to an achievement along the lines of climbing Everest or inventing the transistor. If I decide to smear myself in feces and shove chopsticks up my ass and run screaming in the street, *just to see if I can*, that's worthy of attention?
Only if you set them on fire.
Re: (Score:2)
A Mac IIx, you must have been one of those rich kids. I had a Mac Plus and I fucking loved it!
LK
Re: (Score:2)
why?
Isn't it obvious? He wants to have the linux in order to run a browser with javascript.
Re:uhhh (Score:4, Insightful)
Honestly, this should make you chuckle and smile and say "Wow!"
"Why" might be in there somewhere but if it's your first port of call, you're a lost cause - hand in your geek card.
Re: (Score:2)
why not?
it'as easy to challenge something someone does, isn't it? now that you have discovered this, what have you done lately? it's hard to do something interesting yourself, huh?
there's people who dress up like characters from dead tv shows, people who try to grow giant pumpkins, people who bend giant steel beams and call it art, and people who spend years of their lives leveling MMORPG characters. why? why not?
and, i suppose, there are people who try very hard to comment on slashdot forums in the negativ
Re: (Score:2)
Because this guy's ePenis is bigger than yours and he wants the whole world to know about it.
LK
Re: (Score:2)
Its a great way to run Linux in places where installing Linux is strictly forbidden.
Re: (Score:3)
What is bad about it, if it's within the bounds of the browser's sandbox?
Re:Whiskey Tango Foxtrot! (Score:4, Informative)
I happen to be interested by the implementation of Javascript engines these days - but I don't know yet if I will write my own any time soon ! Anyway, this emulator was a way to learn how to write optimized code for recent Javascript engines, in particular Jaeger Monkey (for Firefox 4) and V8 (for Chrome).
Re:Whiskey Tango Foxtrot! (Score:5, Insightful)
1) Because you can,
2) Because no-one else ever has,
3) Because there are useful lessons that can be learned by performing an exercise like this.
and I'll go ahead and speculate on the fourth and possibly best reason:
4) Because the developer enjoyed solving the problems involved in doing it
The time he spent doing this is probably equivalent to the time you spent watching all 5 seasons of the Battlestar Galactica. I'll leave it to you to decide which was the more monumental waste of time.
Re: (Score:2)
He got to the front page of Slashdot. I don't think I need to say more.
Re: (Score:2, Interesting)
I think it's very cool. Technical, yes. Difficult? Probably not that difficult seeing as Linux is designed to be amazingly portable. It doesn't even need the C standard IO library to compile, so really you'd just need to emulate a few low level interfaces for things like memory access, keyboard input and a terminal display. There are a few different ways to implement it, but if he has it running quickly then that would be quite impressive :)
Re: (Score:2)
Having read TFA (well, the README), it's as the summary says and the only really new thing here is the HTML5 storage driver. So my last comment would have been better made on the previous article about JS/Linux. This storage driver is very useful if you want to mess around in JS/Linux, so it was a brilliant idea. It would be pretty funny to see X on this, maybe even with WebGL 3D acceleration.. I certainly wouldn't want to wait around for it to compile natively though!
Re: (Score:2)
I know it is. It's still linux running on JavaScript in a browser, even if it's not as efficient as it could be.
Re: (Score:2)
(I guess when I wrote my original comment, I didn't know that though - but then I read TFA)
Re: (Score:2)
Because they're a geek.
And you're not. Why are you reading Slashdot, let alone posting to it? Poser.
Re:I hope this JavaScript fad blows over soon. (Score:4, Insightful)
Do you want us to use Flash instead? O! Enlighten us, wise one, about the numerous other languages that are available for web browsers!
Re: (Score:2)
News flash: it won't and it will only get better.
Re: (Score:3)
The special thing about it, is that it's available on almost any modern computing device, down to phones. It's become the Windows of programming languages in a way - not the best option, but it's just so damn common that you should at least learn to use it. I don't know why we don't have any alternative scripting languages for browsers yet. CoffeeScript looks nice, but it just compiles down to JavaScript anyway.. so not the most efficient way to do things if you need to ship your framework as libraries on y
Re: (Score:2)
Ruby and others in a browser, not so revolutionary now but interesting.
http://ejohn.org/blog/the-browser-scripting-revolution/ [ejohn.org]
TCL in a browser, if it were integrated it would be more relevant.
http://www.tcl.tk/software/plugin/:Python [www.tcl.tk]
I doubt gawk, perl, bash scripting or others will run in a browser soon.
Re: (Score:2)
I really like the look of Pyjamas, another poster mentioned it. I was planning on trying out Python soon anyway, and Pyjamas seems to be a very, very nice way to create portable apps that can be run normally as Python apps under Linux and Windows, or compile to JavaScript for running in browsers (as long as you use no C libraries). Very cool.
Re: (Score:2)
I wasn't meaning "you" as in the GP. I was making an analogy that like it or not, you're going to need it in future if you're in certain lnes of work
Re:I hope this JavaScript fad blows over soon. (Score:5, Insightful)
Hell, it's basically a mistake of history and circumstance that it's so widely available.
Herein lies the reason why javascript is not 'just a fad'. No matter your opinion of the DOM and javascript syntax, it is *capable* of being used to get the job done and it is everywhere. Other than making tasks absolutely impossible, it's hard to offset in difficulty the benefit of being everywhere. No other language will be everywhere so long as javascript is 'good enough'. Any browser attempting to bring their own favored child in will not meet with adoption because Javascript will work too and on other browsers. Short of getting Microsoft, Google, Apple, and Firefox to adopt the language with *zero* footprint to start with, nothing will change.
Re: (Score:2)
Lua is a better scripting language, and Python is a better prototyping language
So you're saying we should build a Lua/Python interpreter in Javascript so we can use these superior languages in our browsers?
Re: (Score:3)
It's been present on pretty much all browsers of any note since the late 1990s. Love it or hate it, Javascript stopped being a fad a decade ago, and has so much momentum now that unless you want to give up web development, you'd better just man up about it.
Re: (Score:2)
Re: (Score:2)
Recursion (Score:2)
That'd be a browser in an OS in a browser in an OS. :D
... and that could be extended to an arbitrary depth!
Re: (Score:2)
That would be an interesting competition.
reporter: With me now is Tom who has just booted a computer inside a computer, insiiiiide a computer sixTEEN times!
tom: Yes, it took about a year to boot the last layer of nesting and takes nearly 2 hours to run ell ess, but it was totally worth it. I'm really excited.
reporter: And what do you want to do with it now?
tom: In a couple of years, I hope to be up to 17 layers, and it's my life ambition to get up to 32.
Seriously though, if I was to do such a thing, I'd
Re: (Score:2)
The next thing I'd do is try to automate as much as possible. Because once it starts slowing down, it would be pretty frustrating to interact with.
:D
Oblig.: Sand Universe [xkcd.com]
Re: (Score:2)
Re: (Score:2)
You have no clue what you're talking about.
Re: (Score:2)
Liar.
Re: (Score:2)
Yes, let's port the JVM to nodejs. So you can run Java on the server.. ;-)
Re: (Score:2)