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.

This entry was posted in mips, qemu, Windows NT 4.0 by neozeed. Bookmark the permalink.
avatar

About neozeed

What is there to tell? I've loved UNIX like things since I was first exposed to QNX in highschool (we had the Unisys ICONS!), and spent the better time of my teenage years trying to get my own UNIX... I should have bought Coherent in retrospect.. Anyways latched onto Linux in 1992, and then got some old BSD admin books and have been hooked on the VAX BSD & other big/ancient things since...!

14 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)

Leave a Reply

Your email address will not be published.

Notify me of followup comments via e-mail. You can also subscribe without commenting.