Pages

Tuesday, May 17, 2011

jslinux by Fabrice Bellard - http://bellard.org/jslinux/ - lets you "run Linux in your browser". It requires a fairly recent browser. I used Google Chrome 11.0.x. Just saw this on Hacker News (HN) and tried it out. It does work some. Showed typical messages of a Linux OS booting up, in the browser window. Then came to the Linux prompt. I tried a few standard Linux commands:

uname -a # Worked.

ls -l #Worked, showed only one file, hello.c

cat hello.c # Worked, showed a hello world program that can be compiled with tcc.

tcc -o hello hello.c #Worked, created the hello binary

./hello # Worked, showed output "Hello World".

which cat # Worked, showed "/bin/cat".

The /bin directory has about 97 commands. Some of them are dummies, e.g., hostname outputs "null". The less command and the grep command worked. So did wc.

ls -l | wc -l
97

The HN comments say that Fabrice used JavaScript to create an x86 emulator in the browser.