|Anselm Levskaya d3ff9f170d Update readme.md||1 year ago|
|refactoring_hacks||8 years ago|
|CMOS.js||6 years ago|
|KBD.js||7 years ago|
|LICENSE||7 years ago|
|PCEmulator.js||5 years ago|
|PIC.js||6 years ago|
|PIT.js||6 years ago|
|Serial.js||7 years ago|
|clipboard.js||7 years ago|
|cpux86-ta.js||5 years ago|
|cpux86-ta.original.js||8 years ago|
|index.html||5 years ago|
|jslinux.js||5 years ago|
|linuxstart-20110820.tar.gz||8 years ago|
|linuxstart.bin||8 years ago|
|readme.md||1 year ago|
|root.bin||8 years ago|
|term.js||8 years ago|
|vmlinux-2.6.20.bin||8 years ago|
This repo corresponds to a very old version of jslinux, Mr. Bellard currently uses an emscripten converted emulator for the current jslinux.
There are better emulator codebases out there for pedagogical use!
For a simpler RISC architecture, take a look at the linux on jor1k emulator project.
Finally, the Angel emulator (source) shows off the elegant open-ISA 64bit RISC-V architecture that is being brought to silicon by the lowrisc team. This is by far the cleanest architecture for studying general low-level hardware and operating system implementation details.
I wanted to understand how the amazing JsLinux worked, so in a fit of mania I hand de-obfuscated the codebase while studying it over a few days' time. In the off-chance someone else might be interested in this code as a basis for further weird in-browser x86 hacking I posted this redacted version of the code here, with permission of Mr. Bellard.
The current codebase should run on most modern versions of Chrome, Safari, and Firefox. If you're running it locally, you will need to load it via a local server to allow the XHR requests to load the binaries.
jslinux-deobfuscated is still a dense, messy code base from any pedagogic point of view. However for those interested in Mr. Bellard's code, this version is nowhere near so incomprehensible as the original. Nearly all of the global variables and function names have been named somewhat sensibly. Many pointers to references have been added to the source.
The core opcode execution loop has been commented to indicate what instruction the opcode refers to.
One mystery is, why does CPUID(1) return 8 << 8 in EBX? EBX[15:8] is now used to indicate CLFLUSH line size, but that field must have been used for something else in the past.
The CALL/RET/INT/IRET routines are still quite confused and haven't yet been rewritten. The code dealing with segmentation, and some of the code for real-mode remains relatively messy.
Any recommendations / clarifications are welcome!
This is a pedagogical/aesthetic derivative of the original JSLinux code Copyright (c) 2011-2014 Fabrice Bellard. It is posted here with permission of the original author subject to his original constraints : Redistribution or commercial use is prohibited without the (original) author's permission.
Some other helpful references for understanding what's going on: