jsbochs - Bochs PC Emulator for the Browser
Inspired by Fabrice Bellard's fantastic jslinux.
(Being) Ported by Johannes Ahlmann
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.
Suggestions for Performance
-s PRECISE_I64_MATH=0will likely not work. I am very concerned that doubles > 2^32 may not be monotonic when adding 1.
-s INLINING_LIMIT=0compiles very slowly. But I will try to get it compiled (>1h)
- replace 64bit ints with 32bit. Not sure what to replace the instruction counter with since 32bit counter will overflow in (2^32instructions/30,000,000instructions/s/60s =) 2.5 minutes. I will try a clock divider since I don't need instruction-precise timers anyway.
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
- Currently it runs under node in the console. Get main loop running for browser
- Get an output running. Either a nicer terminal output or SDL output in the browser
- Get it to compile with -O2. This would be a tremendous speedup, but currently there are compiler errors about bit arithmetic.
- Browser main loop
- Compile with closure (bit arithmetic errors)
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.