Emscripten "port" to Javascript of the Bochs PC Emulator.
Inspired by Fabrice Bellard's fantastic jslinux.
(Being) Ported by Johannes Ahlmann
The code runs flawlessly under javascript. The only issue is that it runs SLOOOOW. It runs the BIOS code reasonably fast, but then goes down to 0.04MIPS instead of native 30MIPS.
Also, I have almost no output options yet.
This git repo is currently my work bench and a bastadization of the original bochs code. I have removed all files that were not absolutely necessary for compilation in order to get my bearings.
-s PRECISE_I64_MATH=0
will likely not work. I am very concerned that doubles > 2^32 may not be monotonic when adding 1.-s INLINING_LIMIT=0
compiles very slowly. But I will try to get it compiled (>1h)Simply run the build_it.sh
script which will configure and build the bochs.js file.
Alternatively follow the steps below:
emconfigure ./configure --disable-plugins --disable-x86-64 --enable-cpu-level=4 \ --with-term --disable-large-ramfile --disable-cdrom --disable-debugger-gui \ --disable-readline --disable-iodebug --enable-show-ips --enable-logging \ --disable-idle-hack --disable-debugger --disable-disasm --enable-fpu emmake make emcc -O1 bochs.bc -o bochs.js node launch.js
Bochs (and jsbochs) as a whole is released under the GNU Lesser General Public License
Parts of Bochs have specific licenses which are compatible with the GNU Lesser General Public License. Hence each source file contains its own licensing information.