Javascript PC emulator runs Linux
Fabrice Bellard, creator of the multiple architecture emulator QEMU and FFmpeg, amongst other open source projects, has unleashed his Javascript powered PC emulator. In its current state, it boots a stripped down, text mode Linux implementation and runs within a modern browser. Interesting curio or a potentially useful tool?
To say it's written in Javascript, an interpreted language that is usually used for client-side scripting on web pages, the emulator runs remarkably quickly. It boots to a command prompt in about a minute on this machine (Sempron 3000, FF 4.1). [Update: Considerably faster than that on my CoreDuo] By the way, the emulator requires a modern browser such as Firefox 4 or Chrome in order to operate.
Things are still at the proof of concept stage but there is already enough to play around with. Sitting on a command line prompt, the first thing I tried was typing ls. Doing this revealed the presence of a single file, a C source code file called hello.c. Attempting to compile with GCC wont work because GCC isn't installed. Examining the content of the file got the the bottom of things:
~ # cat hello.c
/* This C source can be compiled with:
tcc -o hello hello.c
*/
#include <tcclib.h>
int main(int argc, char **argv)
{
printf("Hello World\n");
return 0;
}
~ #
That the system includes the Tiny C Compiler (not to be confused with Small-C) makes sense as that is another project that was started by Bellard. You can get an idea of what other utilities are supported by the system by typing
ls /bin
So, what could this thing actually be used for, I hear you ask? As it stands, not all that much. For one thing, networking is not yet emulated. To perform any type of file transfer between the host and guest environments, one has to use the system cut and paste buffer and a virtual /dev/clipboard device. Other than that, there's no way to get data into or out of the system. This could be a point in the system's favor because, as it really is running locally, rather than on a server, it's fairly good in privacy terms. You can wipe the entire system by simply hitting refresh.
It could perhaps be used to provide some sort of training environment to teach people how to use the Linux command line. As it stands, the system could be used to compile simple snippets of C code if you were to find yourself stuck on a machine without a compiler installed.
[Update: Seems that a pal of mine, Chris Williams, is using it to demo his hobbyist microkernel project Diosix]
The implementation of a complete machine emulator is not the type of task that Javascript was created for. If you really needed a Linux command line that can be accessed without installing anything to the host machine, you'd be better off either SSHing into a remote box or running a virtual machine locally. If it must be browser based, a Java based PC emulator would be quite slow but it would still run faster than one written in Javascript. The JPC website even hosts some example Linux demos that you can try out, but of course, they require that you have Java installed.
Bellard's Javascript PC Emulator is an intriguing feat of programming, but it's likely that it wont see much practical use. It's still cool though.
The Javascript PC Emulator website.
UK based freelance writer Michael Reed writes about technology, retro computing, geek culture and gender politics.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Linux Systems Administrator
- Validate an E-Mail Address with PHP, the Right Way
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Introduction to MapReduce with Hadoop on Linux
- RSS Feeds
- info
48 sec ago - info
44 min 34 sec ago - information
47 min 6 sec ago - info
49 min 16 sec ago - Bought photoshop CS5 for developing a website :(
4 hours 1 min ago - What the author describes
5 hours 27 min ago - Reply to comment | Linux Journal
9 hours 38 min ago - Reply to comment | Linux Journal
10 hours 23 min ago - Didn't read
10 hours 33 min ago - Reply to comment | Linux Journal
10 hours 38 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
I ran rm -rf * LOLOLOLOLOLLL
I ran rm -rf *
LOLOLOLOLOLLL
This is so cool! OK everyone
This is so cool!
OK everyone put your heads together and ponder what other interesting uses this can have.
Absolutely! I have no idea
Absolutely! I have no idea what this could be used for, but it is simply cool. Any of you old enough to remember people asking similar questions about Linux itself?
Wow, it's great, Someday I
Wow, it's great, Someday I wanna make that kind of system : )
Does not require FF 4, unless
Does not require FF 4, unless you are referring to a specific function, seems to run fine on FF 3.6.17 (claims to take 34s to boot).
this is... art.
this is... art.
Missed the point entirely
No GCC? Are you serious? This is a demo of Bellard's programming prowess plus the power of JavaScript. Maybe one day, Linux will just be a bootloader for JavaScript.
Nothing wrong with it not
Nothing wrong with it not having GCC. In fact, it would probably be inappropriate on such a resource constrained environment.
UK based freelance writer Michael Reed writes about technology, retro computing, geek culture and gender politics.