Restoring the MIPS Magnum in Qemu 1.6.0

As many of you Windows NT MIPS fans may know (apparently there are more than 3 of us now!) the MIPS Magnum target is broken in the current build of Qemu.  The problem lies in the firmware as it accesses unassigned memory.  Luckily I just received an email from Hervé that details how to fix this!

The good news is that the fix is VERY easy, all you need to do is comment out a single line in target-mips/op_helper.c

In the function mips_cpu_unassigned_access:

void mips_cpu_unassigned_access(CPUState *cs, hwaddr addr,
bool is_write, bool is_exec, int unused,
unsigned size)
{
MIPSCPU *cpu = MIPS_CPU(cs);
CPUMIPSState *env = &cpu->env;

if (is_exec) {
helper_raise_exception(env, EXCP_IBE);
} else {
helper_raise_exception(env, EXCP_DBE);
}
}

Simply comment out the line

helper_raise_exception(env, EXCP_DBE);

And you’ll be able to boot up the NT PROM.

MIPS Firmware

MIPS Firmware

Remember you’ll want to run it something like this:

qemu-system-mips64el -L /tmp -M magnum -m 64 -cdrom WindowsNT4.0-MIPS.iso -hda MIPS.disk -net nic -net user -global ds1225y.filename=nvram  -global ds1225y.size=8200

Where I’m keeping my NT PROM is /tmp (although that is probably a bad idea…)  But you’ll need the NVRam stuff to add extra space for the ethernet MAC address.  The clock is always trashed but at least it is doing something this time!

For the uninitiated, some installation notes can be found here.

23 thoughts on “Restoring the MIPS Magnum in Qemu 1.6.0

  1. Has someone checked if NT 4.0 can be installed using this “fixed” version? When I tried it in 1.5.2, Qemu either crashed when the installation partition was going to be formatted or hung when the files started to be copied to it (using a preformatted disk image to get around the crash). Creating the small system partition worked fine though.

    Thanks in advance!

  2. Sorry I coudn’t find an another way to contact you, but how to cross‑compile a windows/Winapi DLL for MIPS or others deprecated processors architectures ?

    I installed Visual C++ 6.0 enterprise, but I have only the choice of x86.
    Does an older version would allow it ? If yes which one ?

    • I covered cross compiling right here but the floating point models are different between NT, and Windows CE so any program that needs floats will not work.

      Your best bet is a native MIPS version of Visual C++. 2.0 is “OK” but 4.0 is much better.

      • Yes but I don’t want to compile for windows CE I want to compile for windows NT MIPS and PowerPC.

        I don’t have the real hardware for compiling. *(My ᴍɪᴘꜱ system is screenless)*.
        Hence the need for cross-compilation.

      • Windows CE might not only using different ABI, it is completely a different subsystem (like Os/2 or POSIX or Native) (the same as Windows Embedded Compact) with a different API of the Winapi.

        It is the same as if you were trying to run an “Hello World” compiled for Xbox 360 on today’s Intel PC.

      • Of course all subsystems includes most of the C standard API.

        But I know you can’t run graphics apps compiled for Intel based Windows Embedded Compact on windows 8.

        note : The aim is to port a kernel DLL I wrote to PowerPC and MIPS
        (the DLL already works on AMD64 and Itanium)

      • Of course all subsystems includes most of the C standard API.

        But I know you can’t run graphics apps compiled for Intel based Windows Embedded Compact on windows 8.

        note : The aim is to port a kernel DLL I wrote to PowerPC and MIPS.
        (the DLL already works on AMD64 and Itanium)

  3. Make video tutorial on windows 10 how to install windows nt 4 mips on qemu ? is possible to running irix binary programs on windows nt 4 MIPS 4000 ?

    • It’s really not that exciting to install NT 4.0

      Keep in mind that Windows NT cannot run any Unix binaries out of the box, on any platform. That was only a recent thing with the Linux personality for Windows 10.

      The posix subsystem in NT is closer to 32v, and has no BSD stuff, not even sockets.

      • Is there way to emulate SGI IRIX 6.5 MIPS r4000 in QEMU? I need to transfer my work from my software Softimage 3d 4.0 to IRIX for a modern machine and qemu is great for this, I saw many on YouTube and Google working perfectly Debian (no graphic) DEC Alpha and up to Windows NT 4.0 MIPS 4000 in Qemu, how can it help? Is that possible? Do I need to send the copy of the software?

        • You *MAY* be able to run it under either Linux or *BSD on the MIPS platform if they can run IRIX binaries… I don’t know off hand, but I’d look at it that way.

          qemu also has the ability to run cpu binaries on linux, although I dont know if it has IRIX comparability at all.

          • I’m using last qemu version on windows 10 and, What Linux MIPS did you install in the last QEMU version? I also have the QEMU Deviceer Manager 7.0 used the full graphical interface as in the videos?

          • Last version qemu 2.7 dont work MIPS or without kernel ? only qemu 1.1 with MIPS kernel its work ?

          • I built the irixxxx but it really only runs 64bit stuff on windows 10, and I have nothing IRIX to even really look at.

            I don’t have any environment to cross build anything, or much of any way to look.

Leave a Reply

Your email address will not be published. Required fields are marked *

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