NetBSD 1.5.1 – arc

Well… I was looking around for another OS that’d run on a MAGNUM (ie ARC MIPS in little endian mode), and I found that NetBSD supports the ARC Magnum, unlike OpenBSD.

Sadly it’s *VERY* touchy…. The current version 5.0.2 crashes when unpacking the distribution… However 1.5.1 runs! … kind of.

NetBSD 1.5.1 for the ARC has no install program… So I had to prepare a system partition with Windows NT, then boot that disk under the i386 qemu emulator with NetBSD 1.5.1, setup the disk, and unpack the distro.

From there it was a matter of rigging the ARC loader to boot up an ecoff kernel.

There were a few files in the /etc directory to ‘fix’ to allow normal booting (fstab/rc.conf) and to make sure there is no /netbsd in the root.. For some reason while extracting symbols for the ps tables and whatnot it CRASHES.

So far I’m having issues with the networking, but it is running!

I may have to do some more experimenting with this to see if later versions of NetBSD can get their networking going… The ‘big’ issue at the moment is the ethernet reports a MAC address of all zeros… While the same nvram file in Windows NT works just happily……..

Oh well, here is a screen shot!

NetBSD 1.5.1 ARC on Qemu 0.12.3

NetBSD 1.5.1 ARC on Qemu 0.12.3

I guess it’s worth mentioning that once it boots up, it’s been stable enough for me to rebuild a kernel.. And the kernel even booted! (but transferring it out was such a major ordeal…)

Dungeon for NetBSD little endian MIPS

Dungeon for NetBSD little endian MIPS

Oh, and of course it runs dungeon!

Neko x64!

For no real reason today I remmeber that there used to be this cool program back in the Windows 3.0 days called Neko. I was trying to explain it to my girlfriend about this cat that would chase your mouse!  Click the picture above to play with neko in jdosbox.

I recall that Neko even made it to OS/2 as it was more interesting than the mouse trails alternative from Microsoft.

At any rate, I was wondering if there ever was a 32bit version of Neko… And much to my amazement I found there was a Neko95, and a Neko98! And they even ran on my x64 version of Windows… So after googling around, I found the source code to Neko 98!

So, I did the next best thing, which is download the source, fix a single casting ‘error’ in some square root function and I got it building under Visual C++ 2008. Then I figured, what the hell, added a target for the x64, and built… a 64 bit version of neko!

You can download the x64 binaries, and the source directory that I used here.

You may need some VC runtimes if your system is an old x64… At this moment it can be found here:

Or by searching for Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)

Oh well at any rate, it’s cool to see Neko still kicking!

PS When I get back, I’ll have to see about an i386, MIPS, Dec Alpha and Itanium build… wink wink!

—edit

Neko98’s source code has been rescued, all saved here. and on github.

—years later

I just received this screen shot of Neko x64 rocking it on Windows 8 (Desktop mode)

Neko on Windows 8

Updated Qemu for MIPS emulation

Today I found out that the latest ‘git’ repository version can run Windows NT in color, and with corrected mouse support! The NVRAM is still corrupting and you’ll have to fix the time/date but a usable mouse, and being able to see what you are doing go a long way!

I’ve put the updated binaries here.

If you feel adventurous you too can compile the emulator, I’ve downloaded todays snapshot to here in the off chance this won’t be build able for some time.

I don’t know if there is any good way to enable sound, but things like Visual C++ 4.0 & Quake 1 are usable in that you can actually see what is going on!

Here’s a screen shot of my NT 4.0 workstation….

Qemu MIPS Windows NT color

Qemu MIPS Windows NT color

Qemu ARM, MIPS & PowerPC images…

Well I was thinking of building something like this, but someone did the work for me….

You can find various images here.

So needless to say, a special thank you goes to the dietpc guy… These are all set for MS Windows users, just download the VM you want, and you are ready to go. The only ‘issue’ I had with the PowerPC one, is that I needed to run fsck on the root and reboot it…. (remember the root password is foobar).

Other then that it seems happy as it can be.

root@dietpc3-dev-ppc:/usr/src/f2c# cat /proc/cpuinfo
processor : 0
cpu : 740/750
temperature : 62-64 C (uncalibrated)
clock : 1000.000000MHz
revision : 3.1 (pvr 0008 0301)
bogomips : 40.44
timebase : 16605783
platform : PowerMac
model : Power Macintosh
machine : Power Macintosh
motherboard : AAPL,PowerMac G3 MacRISC
detected as : 49 (PowerMac G3 (Silk))
pmac flags : 00000000
pmac-generation : OldWorld

I wouldn’t dream of really benching it, but this is better then blindly cross compiling as you can check your work…

The downloads are quite sizable about 450mb each… but it is a complete run & go linux environment.

And here is a gratuitous screenshot:

 

Quake for the MIPS (NT4)

Well I started this off hoping I could get Quake running on Windows NT 3.1 … I’m almost there I have the null version running just fine. However I’m not all that great with DIB programming so I was looking thru SDL and saw that it has a WINDIB driver!

So with a LOT of tweaking through SDL 1.2.13 I got it to compile with Visual C++ 1.0!! However it is lacking one critical call, the CreateDIBSection api call in GDI is not present in NT 3.1. So remembering all the MIPS stuff as of late, and that I have Visual C++ 4.0 which should easily support this call, I first got it running with Visual C++ 2.0 on the i386 (Under XP of all things). So it was just a matter of building the source, and making sure there is no errors, uploading it to the emulator, and rebuilding for the MIPS.

And after 30 minutes, I got my exe, and it ran!

Quake 1.06 on the MIPS/NT

Quake 1.06 on the MIPS/NT

I’ve included a link for any other MIPS people out there that want to play quake. I haven’t built the networking as I was having issues with my network earlier and couldn’t get it working…

The exe is available here.

And the source code with all the bits is right here.

In this build I’m not building SDL as a DLL or static library, but rather compiling Quake right into the source. Now that SDL is running on the MIPS, and possibly other Win32 OS’s (I have yet to test Win32s… I suspect the inherent threading in SDL will prevent it, but could the DBI calls be made directly stripping out SDL…?) but who knows, I think anything past 3.51 would work.

Visual C++ 4.0 arrived today!

For the RISC cpu!… That being Alpha & MIPS. Although the back of the box does mention PowerPC there is no PowerPC anything here…

Visual C++ 4.0 RISC box

Visual C++ 4.0 RISC box

I always did like the old Microsoft boxes during this time period… They always looked somewhat professional, not like today’s weird boxes that look like some kind of toy should be inside.

Also speaking of RISC cpu’s check the back of the Visual C++ 2.0 for mips box:

Visual C++ 2.0 MIPS box back

Visual C++ 2.0 MIPS box back

You have to remember it was “time” the golden age of the promised RISC cpu… Intel was hitting that wall with the 486, but lo the pentium changed all of that. And the Pentium PRO cemented all the little RISC cpu’s death. It’s funny how at the same time the “itanic/itanium” is just as dead as well.. MIPS. At least MIPS has their embedded space.. Which is funny looking back at the R4000 as a workstation CPU, and now it’s available in handhelds & set tops.. Although the Acorn derived strongarm is well… Strong-arming MIPS & Power for embedded dominance.

I’m pretty sure that Visual C++ 4.0 brought a lot of Windows 95 like functionality to NT, so I’ll have to see just how much(or little) of modern stuff will build. According to this link, 4.0a was the LAST version to support the MIPS, so Unless I can find 4.0a this is as good as it’s going to get.

If anyone has either insight on where to get Visual C++ 4.0a for the MIPS, or even where to get NT 3.1 for the Alpha give me a line…. Not to mention service pack 3 for the MIPS running NT 3.1… I have a feeling the shiped kernel is at fault in the emulator…

Microsoft eMbedded Visual C++ 4.0

Well I was looking for a way to cross compile to the MIPS and also if I could use my old Platform builder 2.11… Anyways Platform builder has cross compilers, but no libraries, I figured you need the eMbeded Visual C++.. And as luck has it, you can download it right here!. Also you’ll probably want service pack 4.(local mirror), and don’t forget the code TRT7H-KD36T-FRH8D-6QH8P-VFJHQ

System Requirements

  • Supported Operating Systems: Windows 2000; Windows XP
  • Microsoft Windows® 2000 Professional SP2, Microsoft Windows 2000 Server SP2, or Microsoft Windows XP Professional
  • A desktop computer with a Pentium-II class processor, 450 MHz or faster
  • 96 MB (128 MB recommended) memory for Windows 2000 Professional or Windows XP Professional. 192 MB (256 MB recommended) memory for Windows 2000 Server.
  • 200 MB hard disk space
  • CD-ROM drive
  • VGA or higher-resolution monitor. A Super VGA (800 x 600 or larger) monitor is recommended.
  • Mouse or compatible pointing device

If your machine is NOT up to this kind of capability, then you can download the older eMbedded Visaul C++ 3.0, that will run on Windows NT 4.0 (i386 of course). Purdue also had a nice walkthrough on installing the 3.0 tool kit.

I DO recommend that you install IIS on your cross compiling machine, as it’s an easy way to move your object files to the MIPS host for linking.

It is worth noting that Visual C++ 4.0’s emulator will NOT run under Virtual PC.. They use the same call set, and it thinks VPC is Windows CE… I know it’s confusing.

I would imagine everyone could run this. Well if they were so inclined.. Well the installation is pretty simple but now for the ‘fun’ stuff.

First let’s download the source code to Quake.. ID software has been most kind to provide the Quake engine under the GPL!. So we can use it for a MIPS cross compile test.. (As far as I know there is no Dec Alpha cross compiler, but there is a PowerPC.. Anyone use a PowerPC NT machine?). You can download it here. .This went nowhere, as it turns out WindowsCE and Windows NT use different models for floating point, and are incompatible.

Ok with your embedded tools installed, we are now going to merge our Visual C++ MIPS CD so we use it for libraries & include files.. Since we are all going to use the same compiler it’ll be somewhat easy.. I’m using the tools out of “C:\Program Files\Microsoft eMbedded C++ 4.0\EVC\WCE400”

11/27/2001. 03:00 AM........ 1,073,152 C1XX_MP.DLL
11/27/2001. 03:00 AM.......... 581,632 C1_MP.DLL
11/27/2001. 03:00 AM........ 1,056,768 C2_MP.DLL
11/27/2001. 03:00 AM........... 69,632 CLMIPS.EXE
06/13/2001. 03:00 AM.......... 180,276 MSPDB60.DLL

To make it “feel” like visual c++ 2.0 I’m going to put them in the c:\msvc20\bin directory on my HOST pc (Vista Pro x64).. Then I simply copy the include & lib directory from the MIPS Visual C++ CD into the corresponding directories on my host.. We are ALMOST there.

The next thing I did was to grab an intel copy of Visual C++ 2.0 (I almost be dammed near all of them can do this..) and take it’s linker.. The linker out of the embedded tools is obsessed with the WindowsCE subsystem which won’t help us at ALL.

09/16/1994. 01:00 PM........... 67,584 DBI.DLL
09/16/1994. 01:00 PM........... 12,980 LINK.ERR
09/16/1994. 01:00 PM.......... 420,352 LINK.EXE

Go ahead and place those files into the c:\msvc20\bin directory.

Now we just need to create a simple batch file to keep our environment in order:

set LIB=c:\msvc20\lib
set PATH=c:\msvc20\bin;%path%
set include=c:\msvc20\include

Save that to something like mipvars.cmd, and run it & we should be ready to start compiling!

To test the cross compiler I’m going to build a SIMPLE program that has 2 files.

hi.c


#include <stdio.h>

extern int bob(void);

void main(void)
{
printf("%d",bob());
}

bob.c

int bob(void)
{
return 3;
}

Ok, now we compile it like so:

C:\msvc20>clmips *.c -o bob.exe
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9419 for MIPS R-Series
Copyright (C) Microsoft Corp 1984-2001. All rights reserved.

bob.c
hi.c
Generating Code...
Microsoft (R) 32-Bit Incremental Linker Version 2.50
Copyright (C) Microsoft Corp 1992-94. All rights reserved.

/out:bob.exe
/out:bob.exe
bob.obj
hi.obj
LINK : error LNK1104: cannot open file "corelibc.lib"

Oh no trouble!. Because this was all ripped from the embeded tools it wants to think it has corelibc not libc.. But we can cheat, just copy libc.lib to corelibc.lib and I’ve also copied rpcndr.lib to coredll.lib to satisfy the linker.. Now when we re-compile:

C:\msvc20>clmips *.c -o bob.exe
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9419 for MIPS R-Series
Copyright (C) Microsoft Corp 1984-2001. All rights reserved.

bob.c
hi.c
Generating Code...
Microsoft (R) 32-Bit Incremental Linker Version 2.50
Copyright (C) Microsoft Corp 1992-94. All rights reserved.

/out:bob.exe
/out:bob.exe
bob.obj
hi.obj

That’s right, we got an executable!. Now if you run it on your x86(or x64) host you’ll get this:

c:\msvc20\bob.exe is not a valid Win32 application.

And of course, since you installed IIS on your HOST (or cross compiling VM) you can connect to it from your MIPS VM, download the exe & run it.

MIPS cross compile
MIPS cross compile

I’m kind of surprised it worked.. It does go to show though, that somewhere inside Microsoft they have some COOL cross compiler technology, it’s just too bad they didn’t make it into an easy package for the RISC stuff.. But now that the MIPS is coming back to life via Qemu, and NT 4.0 can be had for $5 a retail box on ebay, I figure it’s worth this much for those people who can find Visual C++ for MIPS/RISC.

SoftPC –AT Version 3

Ok, so I’ve been on this MIPS kick as of late.. Me & Antoni just split the cost of Visual C++ 4.0 for the MIPS…  All being well it’ll arrive on Wednesday and we can do some more stuff.  As I understand it, Visual C++ 4.0 was THE compiler for Windows 95 people at the time, and it will have all the controls & stuff that Visual C++ 2.0 simply does NOT have.

Anyways while I was playing with my virtual MIPS machine, I decided to try the MS-DOS emulation out..  I had heard that they had a pretty advanced emulator to run stuff.  So I downloaded a new version of MSD, and was really surprised at the CPU that it was emulating… a 486!  And this is on a MIPS machine, I had to wonder why they couldn’t have continued this for the x64 product…

486!

486!

Anyways ok so it’s a 486, but can it play DOOM?

doom under MIPS NT (1)

Much to my amazement, the answer is YES.  Ok the pallet is all screwed up, and yes it is SLOW.. It reminds me of a 386, but it’s actually running!

Now I was interested, I opened up the ntvdm.exe in notepad to reveal it’s origin:

SoftPC-AT Version 3

(C)Copyright Insignia Solutions Inc. 1987-1992

@(#)sun4_a3cpu.c    1.2 5/24/91 Copyright Insignia Solutions Ltd.

Now what is really interested is this bit.. It only appears in the MIPS binary:

This version is subject to confidentiality provisions and should not be distributed. %s %s%s Copyright %s, an unpublished work by Insignia Solutions Inc.%s %s %s Copyright %s by Insignia Solutions Inc. All rights reserved.

Otherwise there is a LOT of mentions of D:\nt\private\mvdm\softpc.new  I guess it’s about their build process since the DDK is nt\public.

Anyways I thought it was really interesting to see just how involved the NTVDM was on the RISC cpu’s.  I think there is no doubt that the Connectix product was faster, and of course on Ghz+ machines its usable.  Not to mention once Connectix made a native version of Virtual PC for Windows… It’s really not that surprising why Microsoft snatched the product up!

Somewhere around here I have SoftPC 3.0 for the Apple Macintosh… I wonder if it can load doom?

SimpleIRC & ROIDS for the MIPS!

 

Well I’ve been looking for an IRC client for the MIPS and I’ve come up with nothing… And looking for source to much of anything win32 is LONG past something that will compile with Visual C++ 2.0 …

However I did find this simple library built by Andrew Cater: http://www.rohitab.com/discuss/index.php?showtopic=33056

So with very little understanding of how IRC actually works I was able to build a SUPER simple client.  Please note that it’s so simple the / commands that you’ve come to love are not implemented…!  You get one shot for your name/nick/server & channel.. But hey the exe is like 70kb for the MIPS/x64 and 35 for the i386.

sirc and roids MIPS in action

sirc and roids MIPS in action

You can find it’s source & binaries right here.

Also Antoni Sawicki has given me a BUNCH of leads on old public source, and binaries, namely ROIDS the first real graphical game we seem to have now for the MIPS.  The source was a part of a PDTools thing that Dec had put together, however a lot of it will build for both i386 & MIPS. I’ve extracted the source for roids here.

I don’t want to over promise but I’ll see if I can get quake to build some time in the next week.. I don’t know if I can get any graphics out of it, but it’d be fun for a server at least…  Windows NT 4.0 sp1 should have DirectX 2.0 …  The pinball game is quite playable (although the colors are all screwed up, due to a pallet glitch in the emulator) so we shall see.

More fun with Nethack & MIPS NT!

Well a friend of mine pointed out some great archives of OLD Windows NT software..  Checking the list I noticed that there was a port of Nethack to Windows NT, namely Nethack 3.1.2  So using the nethack wiki I got the source code, and converted it to a zip file ( tar & gzip on SFU!)

The build was a little weird as it’s expecting the first compiler tools that shipped with the Win32 SDK “Final release” for Windows NT 3.1  While it may have been ‘easier’ to just install the old SDK, you can just copy cl.exe to mcl.exe & make a dummy ntdll.lib ….

Anyways with a little poking around I got it to build & run!  It’s cool!  Although to be honest I SUCK at nethack.

You can download it here.  It’s lovingly hard coded to use c:\games\nethack … I’m sorry about that, as I’ve given up on having C/D/E drives like a ‘secure’ MIPS machine, and just have a giant (haha!) 2GB system partition.

nethack MIPS

nethack MIPS

It’s also worth noting that it’s easier to try to build stuff on a ‘native’ machine running MSVC 2.0/2.1 then copy the stuff over the the MIPS simulator as it is SLOW.  But then that is to be expected.. It’s too bad the Qemu MIPS simulator cannot idle… as it runs one of my cores @ 100%.