Boot Linux In Your Browser
An anonymous reader writes "Fabrice Bellard, the initiator of the QEMU emulator, wrote a PC emulator in JavaScript. You can now boot Linux in your browser, provided it is recent enough (Firefox 4 and Google Chrome 11 are reported to work)."
...does it run BSD?
Like Everest, because it was there.
There was a GIF out several years back, which I haven't been able to find any time recently (and would love a pointer to) of some guy who had something like *19* hardware emulators running on one monitor simultaneously, in 4 or 5 separate stacks.
TRS-80, C-64, T/S-1000; everything you've ever seen an emulator for, he had running on Linux all at the same time; some hosting others.
Fabrice also wrote his own version of emacs in his own realtime C compiler, and he also at one time held the record for calculating pi.
I did it for fun, just because newer Javascript Engines are fast enough to do complicated things. Real use could be: Benchmarking of Javascript engines (how much time takes your Javascript engine to boot Linux ?). For this particular application, efficient handling of 32 bit signed and unsigned integers and of typed arrays is important. Client side processing using an x86 library, for example for cryptographic purposes. For such application, the x86 emulator can be modified to provide an API to load x86 dynamic libraries and to provide a js-ctypes like API to call the C/C++ functions from javascript. A more advanced version would allow to use old DOS PC software such as games.
.......... of Linux on the browser on the desktop.
da da da dum indeed.
So you can boot linux in your browser, then launch a browser, and boot linux in that browser....
Yo dawg, if you had a beowulf cluster, you could run kturtle all the way down.
THL phish sticks
Yo dawg, JavaScript and the JVM have less to do with each other than an Orthodox rabbi and a porkchop.
Il n'y a pas de Planet B.
Well, I'm off to tie up a few loose ends. It's only a matter of time before he gets X running in there. After that someone will try running firefox. Shortly after that someone will direct that copy of firefox to the link posted in the summary and then the universe will end.
Either that, or the Higgs bogon will be discovered.
I was promised a flying car. Where is my flying car?
Yo dawg, we hear you liked Linux...
Yeah, but does it run Lin - hang on....
... Oh My God. It's penguins all the way down!
Crumb's Corollary: Never bring a knife to a bun fight.
This has been done before with JSMIPS - a Javascript MIPS system with well-implemented JIT optimizations. :)
See http://codu.org/jsmips/system.html. Even runs vi pretty well
Finally I have the courage to do a /*
rm -rf
Free the Quark 3 from asymptotic confinement! Bring your charm! Don't get down! All colours and flavours welcome!
+1 Brilliant
less to do with each other than an Orthodox rabbi and a porkchop.
This will now replace 'What does X have to do with the price of tea in China' in my daily conversation. You almost got a beverage spray from me because this bit of wit.
I don't post AC. I like my -1, Flamebaits. Trump/Sheen 2012 on the Batshit Insane ticket!
You can run X in this thing? OMFG!!!
Let's see what this baby has under the hood:
/proc/cpuinfo :
/proc/meminfo
/bin/sh /sbin/init
~ # cat
processor : 0
vendor_id : GenuineIntel
cpu family : 5
model : 4
model name : Pentium MMX
stepping : 3
cache size : 0 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : yes
coma_bug : no
fpu : no
fpu_exception : no
cpuid level : 1
wp : yes
flags
bogomips : 20.21
clflush size : 32
~ # cat
MemTotal: 30448 kB
MemFree: 26960 kB
Buffers: 2048 kB
Cached: 456 kB
SwapCached: 0 kB
Active: 2636 kB
Inactive: 64 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 8 kB
Writeback: 0 kB
AnonPages: 212 kB
Mapped: 324 kB
Slab: 700 kB
SReclaimable: 96 kB
SUnreclaim: 604 kB
PageTables: 36 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 15224 kB
Committed_AS: 456 kB
VmallocTotal: 1007592 kB
VmallocUsed: 0 kB
VmallocChunk: 1007592 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
~ # top
Mem: 3472K used, 26976K free, 0K shrd, 2048K buff, 472K cached
CPU: 0.5% usr 0.3% sys 0.0% nic 87.2% idle 0.0% io 6.2% irq 5.5% sirq
Load average: 0.08 0.04 0.01 1/12 78
PID PPID USER STAT VSZ %MEM CPU %CPU COMMAND
78 75 root R 1136 3.7 0 12.7 top
75 1 root S 1156 3.8 0 0.0 sh
1 0 root S 1136 3.7 0 0.0
3 1 root SW< 0 0.0 0 0.0 [events/0]
4 1 root SW< 0 0.0 0 0.0 [khelper]
2 1 root SWN 0 0.0 0 0.0 [ksoftirqd/0]
5 1 root SW< 0 0.0 0 0.0 [kthread]
16 5 root SW< 0 0.0 0 0.0 [kblockd/0]
34 5 root SW< 0 0.0 0 0.0 [kswapd0]
35 5 root SW< 0 0.0
Well's all that ends.
The days of programming a turtle are over!
Stupidity is its own reward.
Admit it - who else tried startx!
I'm not sure I'd call that "fun" exactly, probably more like "excruciating" - but I would find it funny viewing this page in Chrome running on Windows running in Chrome running on Linux running in Firefox running on Windows running in Chrome running on Linux..
which is totally what she said
Looking at the page code - it looks like he's written a generic x86 emulator in JS, and although booting Linux is undoubtably cool, has anyone tried to patch it to boot MS-DOS (or PC-DOS if you want to avoid any legality issues) ?
Just thinking about all those classic DOS apps that will never see the light of day otherwise.
-Jar
Together, We Can Make Slashdot Better. I Do NOT Mod ACs. - Check Me Out
When you think about it, most user land applications should be targetting a virtual machine. If Linux shipped with an LLVM runtime, all the userland apps could be built the once regardless of hardware and they would execute against the runtime. Behind the scenes the runtime would compile and cache a native binary on first invocation but it would be completely seamless and transparent to the user. Performance would be exactly the same as if the app had been natively compiled in the first place. The runtime could even be ported to Windows or OS X or QNX or some funky hypervisor from VMWare / Redhat whatever and be running over PPC, MIPS, ARM, x86 and they'd still run. The potential for this is enormous.
I get a feeling that Apple will soon have native LLVM support in OS X in preparation for their move to ARM and it would not surprise me if Windows got some kind of analog too. Therefore I wonder if it's time for Linux to be considering likewise.
It's not obfuscated, it's condensed to run faster. Also, it's a x86 emulator, it's pretty much obfuscated for 99.99999999999999999999999999% of humans.
Didn't work for me. It got to a text thing with a flashing cursor but stopped there. I don't see my Ubuntu desktop or browser icon.
== Jez ==
Do you miss Firefox? Try Pale Moon.
Just thinking about all those classic DOS apps that will never see the light of day otherwise
It might make you happy to know that you can already enjoy old classic DOS games on your machine by using DOSBox.
How can someone be so damned silly enough to think there's no use for it... Man, a FULL x86 EMULATOR written in Javascript! Possibilities are endless. The point isn't just to run Linux, but anything that is written in C, and that you want to run in your browser. ANYTHING. Running Linux is just a proof of concept.
Bellard wrote FF-Mpeg, Qemu, and now this. I have no words to express my admiration for his talent.
This thing booted on my Android phone running Firefox 4 Mobile.
Can't type anything though, as I can't get the virtual keyboard activated.
However I also got 20.21 bogomips, which seems odd.
aka Gardener, aka ollej
Linux PC running Virtual Box --> Windows XP
I do run this on my Fedora 14 i7 laptop and don't have any issues with it, in fact XP on my machine boots in about 20 seconds although it still takes up to a minute before I can do anything. One really good feature of virtual MS Windows is the fact that I can recover in about 15 minutes so I don't care about virus protection although I am careful about which sites I connect to and because I am running a virtual machine there are very few sites need connect to, because I do all my web browsing on Firefox or Chrome (latest version) running under Linux.
:)
In my case the only use for Win XP that I have found is to bring up the iTunes application for my wife's iPhone since Apple does not have a version for Linux (surprise, surprise). Fortunately I have an Android phone and so don't need the iTunes application so it is rare I need to virtual boot XP. Still when my wife wants to change some things on her iPhone I can boot in a separate session window or just switch to her account
In my professional capacity I only use OpenOffice for MS Office documents when collaborating with customers and I have never found a reason to use MS Windows other than those rare applications that are so locked to MS Windows. Before people say "Games" I don't play PC games although I do have a PS3 which I do play games on. Of course my counter to "Games" in a profession capacity is you must have a very understanding workplace
There ain't no such thing as proprietary standards only proprietary formats. Standards are by definition open.
No man pages.
AT &F1DT0,T0800665544 - Real men, real help desk support.
If you die in any of it, you wake up in the outer most OS, unless you are trapped by the limbo exception handler, for which you are trapped forever.
The Linux, Virtualbox, XP setup also works for streaming Netflix.
Yes, but there are already PC emulators that will run in Java and export their display data to glue code that allows a plug-in to display the window in your browser.
Fixed that for you. Java Applets do not "run in your browser," nor does Flash; that is an illusion. These are entire platforms that run programs, and can export the display independently; your browser provides a windowing manager for them, like Sawfish.
Support my political activism on Patreon.
Create a mounted loopback file system as ~/loopback.img, mounted to /mnt. Then copied hello.c to our mount point, unmounted it, and gzipped the image =D
# dd if=/dev/zero of=loopback.img bs=1000 count=400
400+0 records in
400+0 records out
400000 bytes (390.6KB) copied, 0.129992 seconds, 2.9MB/s
# mkfs.ext2 -F loopback.img
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
48 inodes, 390 blocks
19 blocks (5%) reserved for the super user
First data block=1
Maximum filesystem blocks=262144
1 block groups
8192 blocks per group, 8192 fragments per group
48 inodes per group
# mount -o loop loopback.img /mnt
# cp hello.c /mnt && ls -al /mnt ..
drwxr-xr-x 3 root root 1024 May 17 14:21 .
drwxr-xr-x 13 root root 1024 May 16 16:33
-rw-r--r-- 1 root root 166 May 17 14:21 hello.c
drwxr-xr-x 2 root root 12288 May 17 14:19 lost+found
# umount /mnt
# gzip loopback.img
# ls -lh
-rwxr-xr-x 1 root root 1.9K May 17 14:14 a.out
-rw-r--r-- 1 root root 166 May 15 22:15 hello.c
-rw-r--r-- 1 root root 905 May 17 14:23 loopback.img.gz
I haven't looked at his javascript yet, but from what I can read from the technical notes it's an x86 intepreter. I'm actually working on a pc emulator in javascript, but with a dynamic translator at its core.
The project is hosted at github here: https://github.com/poizan42/jsx86
Hi from Emacs. It seems to work quite well, although a lot of scrolling is needed in order to get past the boilerplate that's normally at the top and sides of the screen. (I had to try multiple backends; the Lynx backend kept logging me out, but this w3m backend works fine.) One slight bizarreness; when I went to write this comment, it opened up an editor for me to write the comment in - and perhaps surprisingly, given that the browser was running in Emacs, it opened in vim. Still inside Emacs, though. I've long been aware that it's possible to run vim from inside Emacs, but I hadn't thought that either vim users or Emacs users would be particularly inclined to try...
(1)DOCOMEFROM!2~.2'~#1WHILE:1<-"'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$"'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1"
But not the latest Safari.
It's too late to lose the weight you used to need to throw around.
I'm going to run Firefox inside Linux which is running inside Firefox. I'm going for Inception!!
Oh man, I have a strong desire to get apache running in this, just so I can have the web browser serving pages to itself =) We just need a network driver...
now where is network support, ssh, nmap and other tools that could make this actually useful to the roaming sysadmin?
frog blast the vent core
... a beowulf cluster of tabs!
/.
Or is that joke a little too 20th century these days? Been out of touch with
This would be amazing if if had an eth0 interface with an SSH client.
That would mean that you could SSH to any of your servers from within Safari on an iPhone with no need for paid-for apps.
http://bellard.org/jslinux/config_linux-2.6.20
http://bellard.org/jslinux/cpux86.js calls ya.load_binary() that makes XMLHttpRequest()s for "vmlinux26.bin", "root.bin", and "linuxstart.bin". For the latter two his HTTP server responds with root.bin.en.gz and linuxstart.bin.en.gz. After gunzip you can mount root.bin.en as a loopback ext2 filesystem to see the ramdisk FS contents; most binaries are hardlinks to the same 768kB BusyBox ELF 386 binary. I'm not sure what the 14,858 byte linuxstart.bin file is.
=S