WoWMIPS: A MIPS Emulator For Windows Applications

When Windows NT originally launched it had ports to a wide variety of platforms, ranging from Intel’s x86 and i860 to DEC’s Alpha as well as the MIPS architecture. Running Windows applications written for many of these platforms is a bit tricky these days, which [x86matthew] saw as a good reason to write a MIPS emulator. This isn’t just any old emulator, though. It maps 32-bit Windows applications targeted at the MIPS R4000 CPU to an x86 CPU instead. Since both platforms run in a little-endian, 32-bit mode, this theoretically should be a walk in the park.

The use of the Windows PE executable format is also the same, so the first task was to figure out how to load the MIPS PE binary in a way that made sense for an x86 platform. This involved some reverse-engineering of the MIPS ntdll.dll file to figure out how relocations on that platform were handled. Following this, the mapping of the instructions of the R4000 CPU to the (CISC) x86 ISA was pretty easy. Only Floating Point Unit (FPU) support was left as a future challenge. Memory access was left as direct access, meaning no sandboxing or isolation, for simplicity’s sake.

The final task was mapping the native API calls, which call almost directly into the underlying host Windows OS’s API, with a bit of glue logic. With all of this done, Windows NT applications originally written for 1990s MIPS ran just fine on a modern-day x86_64 PC running Windows — as long as you don’t need an FPU (for now).

12 thoughts on “WoWMIPS: A MIPS Emulator For Windows Applications

  1. I’m a huge fan of emulating old stuff. However, it seems like static recompilation is the more adventurous route that has great benefits. The downside being that you’re locked into the target architecture so you don’t get the option of compiling your emulator to run on DEC Alpha or PPC. However, it seems this is only intended for x86 anyway, so not really a loss. Here’s the code repo:

    1. This might be more useful if it targeted 16-bit applications that no longer run natively in 64-bit Windows since there were a whole lot more of those. But then it would be an almost entirely different project and difficulty level.

      1. Interestingly, Win16 applications (and DOS applications) were the ones being supported universally on all architectures.

        So Windows 3 applications didn’t need any modifications.
        They ran on all Windows NT platforms of the 90s.

        To make that work, the RISC editions of Windows NT used to ship with an 80286 CPU emulator.
        In NT4, it was being updated to an 80486 level.

        That’s important for Windows on Windows subsystem (WoW),
        because of the MS Windows “386 Enhanced-Mode” kernal.

        As the name implies, that Windows 3.x kernal needed an 80386 or higher.
        An 80286 processor could do Standard-Mode, at least.

        There also was a commercial CPU emulator, FX!32.
        It allowed i386 Win32 applications to run on Windows NT for Alpha.!32

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.