JSLinux rewritten to be human readable, deobfuscated and annotated
github.com
github.com
The readable source code of the JS PC emulator itself is not yet available. At this point, any mirroring or redistribution of the code needs my explicit permission
I'm a synthetic biologist, not a professional coder. I did this primarily because I wanted to study how emulation worked, and I pushed it solely in the hopes that one or two other people might find it useful as a study guide of the original codebase.
Then I'd do a "Hello, world!" type example in C and their eyes would open wide, knowing that I just compiled and ran an x86 program under a Javascript emulator in my browser.
Bellard is a reasonable man. I asked him for permission to release my web terminal (https://github.com/chjj/tty.js), (which was originally based on his jslinux terminal), under the MIT license, and he did give me permission. All it takes is the courtesy to ask and to state your intentions with it. Hopefully thats what the poster did here, but it does seem unclear.
http://www.ubercomp.com/jslm32/src/
https://github.com/ubercomp/jslm32
There's also a nice Quora answer (I don't like linking to them but what the hell) to get the ball rolling on the basics: http://www.quora.com/Emulators-computing/How-does-bellard-or...
https://github.com/levskaya/jslinux-deobfuscated/commits/mas...
So by now it's likely that Fabrice Bellard is aware of it
It's allowed to discuss Fabrice's code, it's allowed to post a de-obfuscator software tool, but it's certainly not permitted to publicize a derivate without his consent. It's plain respect for intellectual property.
http://nsl.com/papers/origins.htm
(Arthur Whitney's initial implementation of "J")
The rationale is: To write a J interpreter/compiler you need to know J. If you know J, then J-style C is easy to work with.
What is the purpose of this function, from the clock emulator:
function formatter(a) { return ((a / 10) << 4) | (a % 10);}Hint: 0->0, 1->1, ..., 9->9, 10->16, ..., 19->25, 20->32, 29->41, 30->48, ...
x86: http://en.wikipedia.org/wiki/Intel_BCD_opcode
68k: http://meseec.ce.rit.edu/eecc250-winter99/250-1-20-2000.pdf
6502: http://www.6502.org/users/dieter/bcd/bcd_0.htm
6800: http://fundamentals-digital-electronics.blogspot.com/2010/09...
Several others, such as Power6 and Sparc64: http://speleotrove.com/decimal/ (also shows this is is both still useful today)
I mean, AFAIK you just need to closely follow the SPECS.
Someday, I am going to have to produce an emulator, just to see how it is done and to try prove that part of me that thinks maybe I am just not good enough, wrong.
Although I don't have a ton of free time at the moment, I would be happy to help people get started.
Go read the list of Open Source project he's done: it's a humbling experience (even for those who managed to make it big with their startups).