The page was near-unreadable for me because the CSS uses the font stack "courier,fixed,swiss,sans-serif", and courier is just too thin and wispy against a black background. I opened Firebug and changed the CSS declaration to be "monospace" and then all was right with the world.
That said, it's a phenomenal achievement, and should be a great way for websites to demonstrate command-line tools to people. :)
(also: browsers let you store more information with DOM Local Storage than you could in a cookie; If you could expose that to Linux as a block device...)
Yeah. That would be a whole interesting can of worms. Would need PCI/USB/whatever bus your ethernet card was on. Plus emulation of the selected ethernet card itself.
I guess a tun/tap to some server-side service might be possible too, but perhaps not very interesting. The x86 dynamic library api suggested in the tech notes sounds more useful.
Edit: Easier idea might be adding ttyS1 and connecting that to a websocket on the server. Combined with something like socat or ppp, that ought to work. Since the console is already ttyS0 and connected to the js terminal, it might be doable even with the obfuscated source.
Or you can write a simple paravirtualized eth card driver and its implementation side, without trying to emulate real hardware. Linux is free software, take advantage of that.
You can't - Javascript can't generate arbitrary network traffic like that. You'll have to wait for someone to write a driver for /dev/json, I guess. ;)
After FFmpeg (used in all your TVs and gadgets, very likely), QEmu (used also by Xen and VBox and other), tcc and his IOCC entries, the DVB-T emission with an ATI card, Fabrice comes, once again with something crazy...
In the days before KVM, he wrote a paravirtualization kernel module for QEMU (kqemu), gave away binaries and tried to sell the source. I don't know what happened with that business.
According to the Wikipedia page, you need to be a US citizen or resident to be eligible. He seems to be residing in France and I doubt he has a US citizenship. Otherwise, he definitely fits the bill.
Don't forget that he discovered the fastest known algorithm for computing an arbitrary digit of pi. If you ever are tempted to get egotistical, just think of this guy. If you are prone to low self esteem, avoid reading about him.
It isn't so much the "normal" company thing, I think, as having a good work/playthings/life balance. The main reason none of my personal/toy/experimental projects are languishing on note paper or electronic equivalent is that my balance is very wrong and getting worse!
He is presumably working for a good company (or at least one that is good for him) and has time management skills himself.
That, and a brain to be envious of plus a supply of inspiration!
OTCC is an Obfuscated Tiny C Compiler for i386-linux. It generates FAST! i386 32 bit code (no bytecode) and it is powerful enough to compile itself. OTCC supports a strict subset of C. This subset is compilable by a standard ANSI C compiler. OTCC compiles, assembles, links and runs C code without the need of any other program.
Great hackers can use whatever languages/tools they like. The fact that they're being great is not the consequence of the tools they chose, but of the masterpiece work they achieved.
I am always fond of such an analogy: in terms of efficiency, the greatest hackers has an algorithmic complexity of O(1); meanwhile, the majority of us may be O(n), if you can manage to get a O(log n) you can make into the club of good hackers. The tools, be it OS, programming languages, etc, are only a constant coefficient to that complexity, i.e., they can make you noticeably more efficient, but they won't improve your "greatness".
Close but I think you have your orders understated. A normal programmer faces O(n^2), while a great programmer achieves O(n log n). Really bad programmers do O(k ^n) amount of work to achieve the same, with k>2.
Didn't know about this guy! Unbelievable track record of consistently releasing groundbreaking software. Oh, and the x86 js emulator is cool too! made my day!
Unbelievable, this is like magic. I am totally impressed. It is a real linux instance. BTW. I see the hello.c file someone mentioned here. Have we all mounted the same disk image?
I see so many use cases for this, but I don't fully understand what is going on behind the scenes. Maybe someone can shed some light on it:
1) How is the disk emulated. Is it a local image, or is it running on the backend?
2) Is there a remote possibility to get the networking up and running?
3) Can the disk image be externally accessed to be customized?
1): The disk doesn't seem to be emulated; it's just a rootfs in RAM.
2): See another thread here.
3): Check out cpux86.js. In the start() function at the very end, the following section might be enlighting (even though it is a bit obfuscated by a javascript compressor):
This is completely awesome. When I saw http://cb.vu a few years ago I thought hey, someone has finally done it, but that turned out to be a hack. Kudos to Bellard once again.
Nitpicking: the terminal emulation is messed up. It keeps resizing horizontally, and less gets confused. I'm sure the terminal emulator was fun to play with. A correct vt100 state machine implementation [1] would probably not be quite as fun [2]. There's a vt100.js library used by a couple projects that might improve things. [3]
Indeed, this is completely awesome. I first thought it was some remotely hosted virtual machine, but it really runs inside the browser. Insane! Especially considered how fast it is.
When he adds X, we can run Firefox inside Linux inside Firefox inside Linux :')
Edit: seems the terminal emulator supports ANSI escape codes such as the 16 Linux colors, but not the XTerm 256 color mode (\e[38;5;CCm) or Konsole 24 bit (\e[38;2;RR;GG;BBm). Guess it could be easily added as it's HTML.
This would require a server-side component, as the browser has cross-domain limitations and couldn't generate arbitrary network traffic anyway. You could tunnel through websockets, however.
That would be even better. One could make a Linux device driver to directly access Canvas, WebGL, or even the DOM. It seems that in my post I used "X" as a generic name for "Linux graphics" which is pretty short-sighted.
As far as I can guess, any networking implementation would have to pass low level requests through a proxy on the server, which would end up making things pretty slow even on an unburdened server.
I'm sad the source has been compressed so there's no easy human-readable View Source, like there was on the VAX emulator that came up a few weeks ago. :( Still awe-inspiring, though. :)
Feel bad to miss out on this as I am on FF 3.6. But this remind reminded me of a service from a long time ago. Dont remember their name, this was some 10 years ago. But they used to provide a KDE desktop via the browser as a java applet. It was not terribly snappy, but quite surprisingly usable. Any one remembers this ?
With Guacamole (http://guacamole.sourceforge.net/) you can run a VNC session in Javascript, so you can have your desktop, but alas this still needs a remote (virtual) machine running the desktop.
Hmm if network emulation was added to the javascript VM you could combine it with this.
You can build your own custom Linux distribution, run it in your browser, and share it with others using http://susestudio.com/ — it might not be what you're thinking of (as it's only a few years old, not 10 years), but it does what you mention (and more).
It does. It tests for ArrayBuffer support, outputting that message if the necessary constructors aren't found. What browser are you using that you expect to be supported? (Safari doesn't have support for ArrayBuffer, but a recent WebKit nightly does, and this runs in that).
254 comments
[ 4.4 ms ] story [ 266 ms ] threadLast-Modified: Mon, 16 May 2011 21:14:50 GMT
Linux (none) 2.6.20 #3 Sat May 14 19:08:30 CEST 2011 i586 GNU/Linux
That said, it's a phenomenal achievement, and should be a great way for websites to demonstrate command-line tools to people. :)
(also: browsers let you store more information with DOM Local Storage than you could in a cookie; If you could expose that to Linux as a block device...)
Loopback (which is present) is so much simpler.
Edit: Easier idea might be adding ttyS1 and connecting that to a websocket on the server. Combined with something like socat or ppp, that ought to work. Since the console is already ttyS0 and connected to the js terminal, it might be doable even with the obfuscated source.
# cat /proc/cpuinfo
...
f00f bug: yes
#
Hah!
20 bogomips by the way, at least on Chrome on a MacBook Pro.
I sense a whole new era of browser performance testing..
[... and] my unfinished but usable emacs clone QEmacs.
?!? I am wasting my life in comparison to this super-hacker.
Unfortunately, M-x spook does not, so he clearly still has some work to do for feature completeness.
I'd be curious to know if this is was intentional, or a side-effect of the emulation.
long main = 0xc8c70ff0;
That used to crash my old Pentium box.
Makes sense to me. The MVP here is cpu emulation.
He is really impressive...
Indeed he also wrote QEMU.
He is presumably working for a good company (or at least one that is good for him) and has time management skills himself.
That, and a brain to be envious of plus a supply of inspiration!
http://en.wikipedia.org/wiki/Albert_Einstein
http://norvig.com/performance-review.html
Seriously, who does Bellard work for?
He seems to leave virtually no trace (other than awesome software) on the Internet. I googled the shit out of him tonite...
Probably because he spends his time writing awesome software.
OTCC is an Obfuscated Tiny C Compiler for i386-linux. It generates FAST! i386 32 bit code (no bytecode) and it is powerful enough to compile itself. OTCC supports a strict subset of C. This subset is compilable by a standard ANSI C compiler. OTCC compiles, assembles, links and runs C code without the need of any other program.
http://www0.us.ioccc.org/2001/bellard.hint
(Note for those not familiar with the IOCCC: This is done in 2048 bytes)
I am always fond of such an analogy: in terms of efficiency, the greatest hackers has an algorithmic complexity of O(1); meanwhile, the majority of us may be O(n), if you can manage to get a O(log n) you can make into the club of good hackers. The tools, be it OS, programming languages, etc, are only a constant coefficient to that complexity, i.e., they can make you noticeably more efficient, but they won't improve your "greatness".
Searching for "IOCC" returns nothing, and "IOCC Fabrice" returns a site that is caching HN in realtime, and it's your post.
Any help?
http://www.google.com/search?q=site:ioccc.org+bellard
~ # ./hello
Hello World
That is just too impressive for me to process.
Edit: This is damn cool.
I see so many use cases for this, but I don't fully understand what is going on behind the scenes. Maybe someone can shed some light on it:
2): See another thread here.
3): Check out cpux86.js. In the start() function at the very end, the following section might be enlighting (even though it is a bit obfuscated by a javascript compressor):
The files vmlinux26.bin, root.bin and linuxstart.bin are fetched from the server.Nitpicking: the terminal emulation is messed up. It keeps resizing horizontally, and less gets confused. I'm sure the terminal emulator was fun to play with. A correct vt100 state machine implementation [1] would probably not be quite as fun [2]. There's a vt100.js library used by a couple projects that might improve things. [3]
[1] http://vt100.net/emu/dec_ansi_parser
[2] http://vt100.net/emu/vt500_parser.png
[3] http://fzort.org/bi/o.php
When he adds X, we can run Firefox inside Linux inside Firefox inside Linux :')
Edit: seems the terminal emulator supports ANSI escape codes such as the 16 Linux colors, but not the XTerm 256 color mode (\e[38;5;CCm) or Konsole 24 bit (\e[38;2;RR;GG;BBm). Guess it could be easily added as it's HTML.
Reddit has a meme for that. ;) (downvote away, I've earned it!)
"I don't always write Linux Kernels"
"But when I do, it's in browser hosted Javascript"
~ # ifconfig
Skip the middle man, output gtk via html5 http://blogs.gnome.org/alexl/2011/03/15/gtk-html-backend-upd... (I don't actually know if it still has dependencies on X11 :P)
However, wget is there, so all the building blocks are in place.
wget is available, and it would be cool to piggy back the linux network stack through the browser.
cut & paste support is a must for any terminal
The space characters are very narrow. Needs to be monospace.
All fairly minor compared to the coolness of this.
[1] http://www.pixelbeat.org/scripts/ansi_colours.sh
https://chrome.google.com/webstore/detail/kkioiolcacgoihiiek...
Hmm if network emulation was added to the javascript VM you could combine it with this.
I downloaded a webkit nightly from here, and it works now. Also, of note, the nightly picks up all my Safari settings, so it's not too much of a pain.