4 ms·
Em-DOSBox is incredible. I'd previously wondered if it might be possible to run DOSBox in the browser with emscripten, but there seemed to be nothing working ou
by TazeTSchnitzel 11y ago
Em-DOSBox is incredible. I'd previously wondered if it might be possible to run DOSBox in the browser with emscripten, but there seemed to be nothing working out there. Then the Internet Archive started hosting DOS games, and I wondered what they were using, thus I found Em-DOSBox.
At the same time, I was getting a bit of nostalgia for Windows 95, the first upgrade to Windows I ever used. And it turns out with a bit of fiddling you can run Windows 95 in DOSBox and have it mostly work.
Thus http://win95.ajf.me/ http://win95.ajf.me/ was born. Windows 95 running in the browser. It's still rather unbelievable. You can listen to CANYON.MID on an emulated Sound Blaster 16!
(Unlike the Internet Archive's games, this doesn't do any saving to local storage, sorry. I'm not sure it practically could, because it's not using a fake filesystem mapped to fopen() calls by intercepting DOS system calls, as DOSBox typically does, but rather DOSBox is giving Windows 95 a real disk image, so you'd have to stuff 131MB into localStorage.)
- digi_owl 11y agoThings like this just make my mind spin when contemplating the number of layers invoked to get it working. an OS running inside DOSBOX compiled to JS deliver over HTTP/TCP/IP to be interpreted by a browser (at this point perhaps a OS in its own right) running on top of a OS on top of a CPU. It really feels like we are back in the leased terminal era...
- seanp2k2 11y agoEvery few months someone finds a way to put another turtle on top, and some of those attempts stick.
- breatheoften 11y agoWonder if it would work in iOS Safari running on the iOS simulator ...
- TazeTSchnitzel 11y agoYep! And you can even run DOS apps inside Windows 95, so you can have Virtual 8086 Mode inside your virtual x86 CPU (DOSBox) inside your JavaScript virtual machine, inside a sandbox... Disk access here is fun through the sheer number of layers. Consider a DOS prompt inside 95. When a DOS application tries to perform an I/O operation, it will make a DOS system call. DOS, in turn, will call the BIOS. This BIOS call will be intercepted by Windows 95 which, since it has no 32-bit disk driver (DOSBox doesn't simulate a real disk controller), will pass it on to DOS (the one underlying 95), which in turn will make a BIOS call. Everything before this point has been under DOSBox's x86 emulation. We then go through to the C++ fake BIOS of DOSBox, which handles the BIOS call by calling the C standard library I/O functions. However, those have been replaced by emscripten's shims, which will grab that data from the asm.js heap somewhere (or does it ferry it out to JS? I'm not sure.) And DOSBox itself has been compiled to asm.js (which your browser may compile to machine code through JIT) and is running in your browser's JS VM. Which, if the browser you're using is on Windows, may be a 32-bit version, which is running under Windows's WOW64 (Windows 32-bit on Windows 64-bit)... The layers never end! http://i.imgur.com/lcZZ5YU.png http://i.imgur.com/lcZZ5YU.png
- MrRadar 11y agoReminds me of The Birth and Death of Javascript: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- caf 11y agoYou might be able to just store the sectors that have been modified in localStorage, loading the unmodified ones from the original template.
- runn1ng 11y agoIt's working really slow even on my own, pretty fast, computer. But then, I am running Windows in DOSBox in JavaScript. I have no right to complain. edit: welp, now I tried to run Internet Explorer 3.0 on the machine and it never finishes running, maxing out at 100% CPU and Chrome then wants to kill the tab. And on Firefox, it crashes with "uncaught exception: SimulateInfiniteLoop". Well, it's not perfect!
- jvilk 11y agoWell, it's not infeasible. We don't use localStorage -- we use IndexedDB, which can store gigantic files. But I've never tried stuffing 100+MB into IndexedDB before. (Sidenote: I'm the author of the BrowserFS library, and helped implement this feature.)
- TazeTSchnitzel 11y agoKeeping a copy of the disk around might actually be a good idea, as that means the browser has to hold on to it. I've found that in practice, Firefox and Chrome never hung onto the disk image in their cache.
- egeozcan 11y agoI think your work is amazing and you should link to it: https://github.com/jvilk/BrowserFS https://github.com/jvilk/BrowserFS
- StavrosK 11y agoI can't believe the nostalgia. It's not just bringing back good memories, it's actually making me feel like I'm 16 again, in my old room, with all my old things around me. It's amazing how much I'd associated the Windows 95 startup sound with that room... Thanks for that. EDIT: Hey, can I mount win95.data on DOSBox locally? Do you know the command line?
- TazeTSchnitzel 11y agoThe file is an emscripten package, I don't know if it's possible to extract it. If you want to try 95 on your local machine, I'd grab the install CD ISO from somewhere and use it in a proper virtual machine. Probably not VirtualBox, since it emulates graphics hardware 95 can't handle (so you're stuck at 640x480 at 4bpp) and lacks MIDI emulation (no music). You could also try to run Windows 95 in DOSBox itself, just like this page does, but unfortunately DOSBox has a few issues with it. There are tutorials out there for doing it, though, and DOSBox supporting the right graphics and sound hardware is a big plus.
- StavrosK 11y agoThanks for the information! I tried installing it in DOSBox and VirtualBox with no luck. Which emulator would you recommend?
- TazeTSchnitzel 11y agoYou couldn't get it to install in VirtualBox? That's strange. Are you sure you were using a bootable ISO?
- StavrosK 11y agoSetup would just randomly hang in places, I'm afraid. The ISO booted fine, and I disabled VT-x, so that's not it either... EDIT: Managed to get it running in the end, these two guides helped: http://eduardprogramming.blogspot.gr/2014/01/20140120-windows-95-installation-on.html http://eduardprogramming.blogspot.gr/2014/01/20140120-window... https://forums.virtualbox.org/viewtopic.php?t=9918 https://forums.virtualbox.org/viewtopic.php?t=9918
- mstade 11y agoWindows 95 in a browser? What a time to be alive.. I tried loading up Internet Explorer (3.0!) but it crashed the whole thing. This thing is very accurate.