Coder Social home page Coder Social logo

nbarkhina / doswasmx Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 2.0 26.58 MB

Build your own DOS/Windows machine in the browser

Home Page: https://www.neilb.net/doswasmx/

License: MIT License

Makefile 0.08% C++ 38.48% C 61.37% Shell 0.01% Objective-C++ 0.06% MAXScript 0.01% Dockerfile 0.01%
dos emulators

doswasmx's Introduction

DOS Wasm X

This is a browser based DOS emulator designed around ease of use and stability. It is based on the newer DosBox-X codebase and thus supports both Windows 95 and Windows 98 installations. However if you just want to use DOS applications and games you can stay in DOS mode. To begin using it simply drag and drop any application or game files onto the emulator. You can then save your hard disk with the click of a button or just exit if you want to discard your changes. I went with a simple and clean interface to try and make it approachable and non-intimidating. The hard disk saves directly in your browser so you can come back later and continue where you left off. It's like your own personal virtual machine on the web!

Supports the following features -

  • Fully web based application - using web assembly
  • Save hard drive to the browser (512mb, 1 gig, or 2 gig options)
  • Automatic support for a variety of file formats (Iso, Zip, Bin, Cue, Img, 7z)
  • Customize RAM (32mb, 64mb, 128mb)
  • Import/export files into and out of the emulator
  • Export your entire hard disk image for local saving
  • Load/change CD while emulator is running
  • Floppy Disk Support
  • Audio support
  • Full screen
  • Zoom controls
  • Mouse capture
  • Resize resolution
  • 16 and 32 bit color (via 16 bit color fix)
  • Customize CPU speed
  • Host the application yourself
  • Customize startup hard drive image
  • Send CTRL/ALT/DELETE
  • Pause/Unpause
  • Import existing IMG hard disk if you already have one

You can try it here: https://www.neilb.net/doswasmx/

Build Instructions

You will need a Linux environment to build DOS Wasm X

  • create a folder outside of this repo to install emscripten
  • git clone https://github.com/emscripten-core/emsdk.git
  • cd emsdk
  • ./emsdk install 3.1.49
  • ./emsdk activate 3.1.49
  • source ./emsdk_env.sh
  • replace Binaryen with special version
    • replace the file wasm-opt in emsdk/upstream/bin/wasm-opt with the one from this repo code/wasm-opt
    • navigate to the emsdk/upstream/bin/ folder and run chmod +x wasm-opt
    • this is needed because default Binaryen does not support Exceptions and Asyncify together
    • huge credit goes to @Caiiiycuk for developing this!
    • see references below if you prefer to get wasm-opt directly from his releases page
  • navigate back to the code folder in the DosWasmX repo
  • run make
    • you will get a build error towards the end saying EM_CACHE_IS_LOCKED
    • to get past this error simply copy the faulting emcc command from the terminal and run it manually (See screenshot below)
    • this should succeed and then run make again to finish building
    • later builds should not get this error after you do this one time fix
  • this process will update the main.js and main.wasm files in your dist folder
  • now serve the dist folder from a webserver and Enjoy!

The emscripten installation above is a one time setup however you will need to always run source ./emsdk_env.sh from the emscripten folder every time you close the terminal and before running make. This is because the emscripten compiler does not get saved to the PATH

builderror

Hosting

You can host the app on your own web server. Copy everything in the dist\ folder to your web server.

Also you can optionally configure a Default Hard Drive to load when users navigate to your application. After Saving/Configuring a Hard Drive locally you can export it from the advanced menu.

exportdrive

Then update the settings.js file with the path to your img file

var DOSWASMSETTINGS = {
    CLOUDSAVEURL: "",
    ISOURL: "",
    DEFAULTIMG: "https://www.yourwebsite.com/hdd.img"
}

Docker

If you wish to run directly in a container, you can use the following command after installing Docker Desktop:

docker run -d -p 80:80 nbarkhina/doswasmx

Once it has started, you can open your browser to http://localhost.

Online Documentation

For more extensive guides and technical information please refer to our Online Documentation

Screenshots

screenshot

screenshot

screenshot

screenshot

screenshot

screenshot

screenshot

Installing Windows

DOS Wasm X supports installing Windows 95 or Windows 98 using your own copy of Windows. Simply drag and drop the ISO onto the startup page. DOS Wasm X will detect the Windows CD and begin the installation process. If you choose to Install Windows 95 you may get the error below. Simply click OK and then cancel when it asks you for the Path to the CD. This will allow you to continue with the installation. The reason for this error is because at this stage of the process the CD drivers have not yet been loaded. However after restarting Windows it will detect the CD Drive and finish installing the drivers successfuly. Always remember to shut down windows in the guest OS before exiting the page. This will automatically save your hard drive changes to the browser and prevent scandisk from running the next time you boot into Windows.

screenshot

Common DOS Commands

  • DIR - Display list of files and directories
  • CD - Change the current directory
  • XCOPY - Copy Files
  • DEL - Delete one or more files
  • MKDIR - Create a directory

You can also type HELP at the command line to get a list of commands.

References

Disclaimer

This app was made for fun and is not affiliated or associated with Microsoft.

doswasmx's People

Contributors

chopinrlz avatar nbarkhina avatar omarstewey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

doswasmx's Issues

Windows 98 white screen after boot c: on SR1

General Issue

If you boot into Windows 98, shutdown Windows 98, then use the Import Files function to import a ZIP file, the emulator will load the ZIP file, copy the files into the virtual disk, then attempt to boot Windows 98 again, which fails with a white screen--the emulation generates an error and terminates.

JavaScript Console Log File emu-js-console.log

This log file captures the events which transpire and the error that happens when Windows 98 stops loading.

Steps to Reproduce

Assumes starting from a brand new disk image.

  1. Set your RAM to 32 MB and disk size to 2 GB
  2. Perform a clean install of Windows 98 from a ZIP file
  3. Boot into Windows 98
  4. Shutdown Windows 98 to return to the DOS emulator environment
  5. Click the Import Files option under Advanced in the DOS Wasm X command bar menu
  6. Select a small ZIP file, like QUAKE.ZIP to import a small game
  7. Wait for the virtual machine to load the ZIP file and boot into Windows 98

Error Behavior

What will happen next is Windows 98 starts to boot. After a few seconds of starting up, Windows 98 will white screen, meaning the emulator will stop working due to an error, which you can see in the log file linked above.

Workaround

What is interesting is this behavior does not happen if you drag and drop the QUAKE.ZIP file onto the DOS Wasm X file importer drop location before you click Start Computer. Thus, the issue itself is related to the state of the emulator after a Windows 98 shutdown occurs.

Drive A unmounted on CTRL+ALT+DEL

When I restart the DOS prompt with CTRL+ALT+DEL, it forgets that A: exists and unmounts the drive. I am unable to remount it, because apparently it doesn't exist.

Additional comment: when loading a new instance with just a floppy, it seems to forget that C: exists.

How To Preload Zip?

Hi! I have a disk image that I want to have users see when the app is loaded. You explain this in the documentation. However, I also want to run a command automatically on machine load. How would I do this? Thank you!

Boot HDD and CD ISO?

I'm successfully booting up using 'DEFAULTIMG:"/pc/hdd.img' into windows 98.
If I manually choose Advanced->Load CD and give it an ISO, it correctly reboots the machine and the CD ROM contents shows up just fine.

What I'd like to do is boot up with the CD ISO already in the drive so it doesn't have to reboot. Ideally give it a URL to an ISO file to load.

I tried setting both ISOURL and DEFAULTIMG, but that didn't work, it never tries loading the CD ISO. I tried loading with myApp.loadRom(false) but then it just tries to boot the CD ISO, which doesn't work as it's not bootable. So I don't think that ISOURL is designed to do this.

Any tips?

By the way, I'm totally open to modifying the script.js fiel in any way needed to accomplish this feat :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.