MCC Linux 0.97 & dungeon

Interestingly enough it seems that the ancient linux circa 0.01 – 0.10 not only didn’t have FPU emulation, but didn’t support FPU instructions at all… Or I could be doing something wrong with gcc 1.40 as there isn’t a libm, nor does it inline the math… So anything with floating point is out. So with a bit of digging around for an ancient distro, I found a Linux 0.97 version of MCC. It’s incredibly small, as things were back then. So I’ve installed it, altered the kernel to default to a US keyboard map, (Sorry to people in the UK), and tried to squeeze the disk image down to something not too big. And I’ve included the f2c components and a build of dungeon.

Another f2c platform!

For anyone interested, I’ve uploaded my MCC image, it’s just under 6 megabytes. WOW how the times have changed!!!!

Again special thanks to Jiong Zhao’s most excellent oldlinux.org.

With that said, I’ve also just gotten a note from Artyom that his SunOS patches have been sent upstream to Qemu, so hopefully they’ll be downstream any day!

Pov-ray & Fortran

A long time ago, I had this 286 computer, and I thought it was so cool because I had a 287XL math co-processor. It basically was a 80387 math chip that was wedged to work on a 80286 computer. And it being the early 1990’s the one thing everyone loved to do was to show off rendering stuff.

I’ve long since lost all my stuff, but I do remember the ‘switch’ from DKBTrace to POV-Ray.

I did lament at the time that doing a good ‘quality’ render could take a week or more… And power in South Florida being a ‘best effort service’ wasn’t very forgiving for those of us on FPL. But it was still very neat and exciting for the time. OpenGL kind of killed that as now you could do ‘good enough’ stuff in realtime!

Anyways I was googling around checking out pageranks (I know so shameless) when I came across Kurt Bangert’s page, that included a POV-Ray scene with some fun filled Fortran stuff.

So after downloading the files, and the latest POV-Ray (3.7), and fixing a trivial line I was able to render the above picture in 16 minutes!!

I figured by now POV-Ray could support SMP, and found the new beta version, that supports SMP! So on my HP laptop with 4 cores, and hyperthreading enabled, I was able to render the scene in 1.5 minutes in 1024×768 resolution!!

The Fortran printout is the ‘adventure’ cave game, along with another variation of the snoopy Fortran calendar.

Some notes on UnixWare

A long while back, I got this UnixWare 7 kit on ebay.. So I figured it was as good a time as any other to install it and give it a whirl…

Now one cool thing is that 7.1 will install on Virtual PC 2007, and runs quite nice.. The one trick is to not give it too much memory. I found that 1GB of ram made it run horribly, while 256MB had it running great.

Another weird thing is that if you suspend the VM for any reason, the network will stop working. The only fix is to reboot the VM. Also

Also the C compiler, while not the most feature rich one out there is amazingly fast.. It builds Quake in around 5 seconds, once all the source is ‘fixed’. Also if you want to build any X11 programs, be sure to install the linux compatibility, or have a handy source of X11 headers to grab, as for some reason my UW7 didn’t include them.. ?

So yes, with a bunch of tweaks from the SUN source version of QuakeWorld, here it is:

Quake-on-UnixWare

Quake 1 for UnixWare 7.

And naturally it’ll run Dungeon as well with some f2c magic. The only caveat is that you can’t build the libf2c with any optimizations or it’ll crash or give really strange results….

Dungeon 2.5.6 on UnixWare

Dungeon 2.5.6 on UnixWare

Dungeon 2.5.6 on UnixWare.

Other then that, UnixWare is just another SYSV wrapped up in CDE. But I do recall it being used in the call center world, in conjunction with some seriously old unix machines (think NCR 386!), mostly doing voicemail and other stuff. I think it was the UnixWare 2.x stuff that all included that PC emulation software that could run Windows with the Netware client.. OH the horrors of someone loading up that and lotus notes to check mail on the VM server.. people did notice!!!!!!

I’m not sure if people still use UnixWare with Avaya G3’s anymore.. I know the G3’s were busy moving to linux, but I don’t know about all the support stuff, so for all I know CMS & friends still run on Solaris/UnixWare.

It’s a shame UnixWare got a bad rep from the SCO lawsuits, as it’s a pretty fast & responsive Unix, and too bad they never did get it ported to the Itanium & x64. I mean it’s still not too late, but I suspect the required investment to make it happen is just too great.

OpenWatcom for the DEC Alpha

Someone had contacted me about running some Fortran programs on the DEC Alpha with Windows NT. Now I know that DEC had released some compilers for the Alpha, the Digital Visual Fortran thing which some people still sell for around $600 USD.

OUCH.

But luckily a friend mentioned that I should look at the source code for Open Watcom.

So, I figure for the hell of it, I’ll show how to build a Dec Alpha cross compiler for both C & Fortran. First I’m using Open Watcom 1.8, the current ‘release’ version. You are on your own for older or newer versions.

First install Open Watcom 1.8, with whatever your host is (I’m running on win64, so I’m using the win32 install), and set the target for 32bit NT. We will need the headers so this is the easiest way to ensure your Watcom can make NT exes.

Next you are going to need the file owaxp0401.zip. This is a pre-compiled version of the compiler & libraries for the DEC Alpha. All we need from this is the libaxp directory, which you can just unzip to your Watcom directory.

Now we’ll need to copy some files to satisfy the build process.

C:\WATCOM\binnt>copy wcl386.exe bwcl386.exe
C:\WATCOM\binnt>copy wlib.exe bwlib.exe
C:\WATCOM\binnt>copy wrc.exe bwrc.exe

Ok, now with that out of the way, run c:\watcom\owsetenv.bat to setup your environment, and now let’s extract the source to 1.8. I’m just going to use c:\temp as a place to put it. Also you will have to edit the setvars.bat file, and change the following:

set OWROOT=c:\temp\ow18src
set WATCOM=c:\watcom
set DOC_BUILD=0

Now I suppose you could save this into a batch file, and kick that off, and this will build the needed libraries, then the C compiler.

cd c:\temp\OW18src\bld\builder\nt386
wmake
cd c:\temp\ow18src\bld\dwarf\dw\osi386\
wmake
cd c:\temp\OW18src\bld\yacc\nt386
wmake
copy yacc.exe \WATCOM\binnt\byacc.exe
cd c:\temp\OW18src\bld\re2c\nt386
wmake
copy re2c.exe \WATCOM\binnt\re2c.exe
cd c:\temp\ow18src\bld\cg\risc\axp\nt386\
wmake
cd c:\temp\ow18src\bld\sdk\rc\wres\flat386\mf_r
wmake
cd c:\temp\ow18src\bld\cfloat\osi386
wmake
cd c:\temp\ow18src\bld\as\alpha\inline\osi386\
wmake
cd c:\temp\ow18src\bld\owl\osi386\
wmake

Now this will build the cross compiler…

cd c:\temp\OW18src\bld\cc\wcl\nt386.axp
wmake
copy wclaxp.exe \WATCOM\binnt
cd c:\temp\OW18src\bld\cc\nt386.axp
wmake
copy wccaxpc.exe \WATCOM\binnt\wccaxp.exe
copy wccdaxpc.dll \WATCOM\binnt\wccdaxp.dll
cd c:\temp\OW18src\bld\as\alpha\nt386
wmake
copy wasaxp.exe \WATCOM\binnt

Now for the Fortran 77 compiler. Please note that the default flags include -we which will cause the compiler to error if there is a warning. And as luck would have it, one function doesn’t declare a prototype… So you can either remove the -we flat from the mif file, or fix the c file… The choice is yours.

cd c:\temp\OW18src\bld\f77\wfl\nt386.axp
wmake
copy wflaxp.exe \WATCOM\binnt
cd c:\temp\OW18src\bld\f77\wfc\nt386.axp
wmake
copy wfcaxp.exe \WATCOM\binnt
attrib c:\temp\OW18src\bld\f77\f77lib\flags.mif -r
notepad c:\temp\OW18src\bld\f77\f77lib\flags.mif

Do a search and replace on -we and replace it with nothing…

cd c:\temp\OW18src\bld\f77\f77lib\winnt.axp\_s
wmake
copy flib.lib \WATCOM\libaxp

With all that out of the way, let’s build some test programs…

Let’s start with hello.f for the Fortran compiler.

C234567
program hello
print *, ‘Hello!’
end

c:\temp>wflaxp hello.f
Open Watcom F77 Alpha AXP Compile and Link Utility Version 1.8
Portions Copyright (c) 1990-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wfcaxp hello.f
Open Watcom FORTRAN 77 Alpha AXP Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
hello.f: 3 statements, 40 bytes, 1 extensions, 0 warnings, 0 errors

Open Watcom Linker Version 1.8
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
loading object files
searching libraries
creating a Windows NT(AXP) character-mode executable

c:\temp>

Watcom Fortran cross on Dec Alpha

Watcom Fortran cross on Dec Alpha

Ok, now that’s enough for now…! Later I’ll show how to build these compilers so they’ll run on the Dec Alpha.

OS/2 1.x emulation via HXRT

I finally got this working, although I’ve got to sit down and work out the old makefile format to bind in the hxrt stub instead of running it all on the CLI…

So as a poor example, I used the ancient Fortran 5.1 to build up an OS/2 1.x VIO executable of dungeon, which would run happily on NT 3.1, but of course will not run on XP as they have removed the OS/2 subsystem.

Anyways it’s impossible to run the exe on dos, but fishing around I came across my old Visual C++ 1.5 CD, and on there was the Phar lap 286 dos extender. And one of the neat things it could do, was run simple OS/2 applications under MS-DOS!

So I bound the exe and now it’d run under MS-DOS.

phar lap 286 dungeon 2.5..6

phar lap 286 dungeon 2.5..6

However, since it’s a trial version, it’s limited to 2MB of ram, and you can’t redistribute the resulting exe. Now this is where HX DOS Extender (archive.org mirror/sourceforge mirror) comes in. Over the years, the HX dos extender has provided the functionality of the old Phar lap TNT dos extender by allowing you to run Win32 exe’s under MS-DOS, and it provides a pretty impressive subset of the Win32 api on MS-DOS.

So taking this lead, HX now has a 16 bit 286 centric version that provides a basic OS/2 emulation layer.

So by simply passing the OS/2 exe as a parameter to the DPMI loader (I haven’t quite worked out the stub syntax…) you can run the OS/2 build of dungeon under MS-DOS!

HX16 dungeon 2.5.6

HX16 dungeon 2.5.6

For anyone stuck with either legacy 16bit tools, or a need to support ancient systems, it’s certainly nicer with OS/2 as you have access to a LOT more memory! According to the documentation the HX extender should work nicely with the OpenWatcom Fortran & C, although I currently haven’t tested it.

What’s kind of interesting is that HX doesn’t work under DOSBox, while the Phar Lap 286 DOS Extender will….

Both of these dos extenders build on the old idea of the “Family API” where common API’s between OS/2 and MS-DOS could be mapped between the two OS’s, and a common “bound” executable could then run in either environment. However on the MS-DOS side, it’d be subject to the memory constraints of a realmode MS-DOS executable. The DOS extenders build on this idea, but provide access to additional memory, and a more feature rich OS/2 api.

Back to 386 BSD

Well gunkies is getting a little more life to it, and Dugo contributed this install guide for 386 BSD. Along the way I installed it again with floppy images, and I hit the same fault again:

/386bsd: wd0a: overlaps open partition (b)

However this time I noticed that if you keep on rebooting, it’ll actually stop complaining and work!

So not only was I able to recover from a crash after trying to install the source code, but I was able to complete the install, and install the patchkits! What this has resulted in, is that Qemu can now run 386BSD!!! And it’s significantly faster then Bochs. Not to mention you gain the whole SLiRP / Usermode networking.

So far I’ve tested this with Qemu-0.11.0 just fine. I’m not sure about other levels… so it’s another YMMV.

So now I’ve been able to not only rebuild the kernel & world, but the following programs:

gzip 1.2.4
unzip 5.52
irc II-4.4
lynx 2.8.2

Oh yeah, and another f2c build, and yes it’ll run Dungeon!

So for the few people interested in some BSD history, as this is the ‘first’ Net/2 derived freely available release in a qemu format right here (sorry, link removed, if you want it install this instead).

Just uncompress the qcow2 file (sorry it’ll blow out to 500MB), then run Qemu something like this:

i386-softmmu/qemu.exe -L pc-bios -hda bsd386.qcow2 -M isapc -net nic -net user -no-reboot -m 256

And with any luck, you’ll find the VM booting, and all set and ready to roll. If it comes up in single user-mode, just close Qemu & fire it up again..

I’ll probably put together a windows install package for this later, but for now I figure I’ll unleash some 386BSD onto the world.

Visual Studio 2010 just shipped

So many editions!!… I’m already confused. I think this is the last version to support the Itanium, as that platform is basically cooked.

Considering how lackluster and scarce they were at the launch I guess it’s not surprising.

Anyways It’ll be nice to fire up the x64 CLI tools, and not be told that the ‘release’ is infarct a beta…

Anyways, there is some details over at the MSDN site.. And a demo/eval download.

On the ‘cheap’ front, the express editions are also updated to the 2010 level. I’d recommend getting the ‘offline’ ISO image… That way you’ve got all the bits in one shot.

On the UNIX front, I found that on OpenSolaris, that the SunStudio is a free download. This includes SUN’s C/C++/Fortran (77/90/95) compilers.

I took a quick look at the SUN F77 compiler, and it’s certainly the UNIX one from the days of v7 as it behaves the same way… I guess that’s not too surprising.

Other then that, not a heck of a lot going on.

The real programmer’s Snoopy Calendar.

I was googling around last night waiting for this huge dataset to copy (lol more on that disaster later) when I came across this cute posting about real programmers.

And of course in there, every ‘real programmer’ has a Snoopy Calendar dated from 1969.

With a bit of googling, I come across this site that has the needed snpcal.for, snppic.for and snpcal.dat. Now granted this is from 1987, but hey, it’s as distant as even the original program from the 1960’s.

Now there is a lot of folklore about this program from the 1960’s along with an older version which can be found here, but sadly it wasn’t enough to keep the wikipedia page alive as they had no real sources backing it up prior to the 1980’s.

Anyways with a few minor tweaks, the code from the 1980’s will compiler on MS Powerstation Fortran, and that code will in turn compile via f2c!

So, for the few people that care about this kind of thing, or stumbled upon it, here it is:

Just take note that it’s made for a 132-column printer, which was a popular thing back in the day. Although I’m sure laser & various ‘jet’ printers can print this thing in portrait mode.

I’ve included the source that I changed, along with a win32 exe and the output (in MS-DOS text format) here.

If you want a more ‘modern’ version of the calendar, just edit the data file, you can easily find the star/stop portion in there (search for 1969!).

Next time I’m near a printer and nobody’s looking I’ll have to print one!

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!