DOS-Minix 2.04

I was looking around for some old compilers as a side project of mine has stalled looking for some TS-11 Fortran compiler with overlays…

Anyways I found mention of this DOS-Minix.  It does NOT comply with things like DPMI, VCPI as it will not run in nice things like emm386 & other v86 switchers.  However it will run in DOSBox.

Digging through the kernel & the boot program, you’ll find the basics of a DOS Extender.  The boot program will allocate as much memory as it can from the XMS driver, and then switch to protected mode & transfer control to the kernel.  Likewise the kernel then uses MS-DOS & BIOS calls for video, disk access etc as you can find it’s int86 calls that switch from protect to real mode, (doshead.s) or even in the disk driver dosfile.c

Installation is SUPER simply, just download the file DOSMINIX.ZIP unzip it somewhere then either use the great DOSBox, or any other pc emulation etc that you could want to use…  The NTVDM from Windows NT is not good enough as you’ll get an error message about not being able to load the 386 kernel on an 8086.  This again probably stems from dosminix not using DPMI calls, but the old fashioned raw XMS calls.. I guess it *could* be updated…

Start it up is simple you just run the boot program and point it to a diskfile:

boot minix.mnx

Then you’ll get greeted by the boot loader..  For me hitting any key doesn’t do anything, so I just press escape, then type in boot.

And in NO time you’ll be up and running MINIX!

The ‘best’ way to shut it down I’ve found is to type in ‘reboot’ then press escape like wild, and you’ll interrupt the boot loader.  Then you can type in ‘exit’ and you’ll get dumped back into MS-DOS.

I think it’s an interesting example of how to use the ancient MS-DOS to bootstrap yourself into protected mode… And the source seem somewhat straight forward…

dosminix on DOSBox.

dosminix on DOSBox.

Microsoft Fortran Powerstation 1.0

PowerStation Fortran for Windows 3.1

While going through my stuff, I did manage to find some diskettes for Microsoft FORTRAN PowerStation 1.0   I recall using this under Windows 3.1 but there was some reason we never really used it under Windows 95 & NT (Found it 9 years later!

So, I loaded it up on a VM with Windows 3.1 and quickly found out why:  While it produces win32 exe’s they are built with pre-release tools, and will *NOT* work under any released version of Windows NT, (Yes, including Windows NT 3.1!!).

I’m sure others may find themselves down the path with failed exe’s that crash with:

RtlExAllocateHeap not found in ntdll.dll

Microsoft had a fix, named beta2fix.  It renamed the references to ntdll.dll into beta2.dll.  Which sounds fun, except the resulting exe’s DONT WORK. Nothing like a ‘solution’ that took missing references into exe’s that just crash.

Naturally the ‘fix’ is to upgrade to 4.0 which.. is impossible to find, or track down Compaq fortran, or even Intel fortran.  Or just run it in a MS-DOS/Windows 3.1 VM and be happy for emulation.

But I figured what the hell, perhaps it’s possible to replace some of the key parts with old versions of Visual C++ and use HX DOS as an extender instead of an ancient Phar Lap TNT.

Googling around, the issue lies with the linker, link32.exe.

Now on my Visual C++ 1.0 cd there is a link32.exe that just calls link.exe.  On the Visual C++ 2.0 & 4.0 CD’s there is no link32.exe.  Seeing that Visual C++ 1.0 just calls through I just made a ‘stub’ program to call link.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void main(int argc,char* argv[])
{
char command[255];
int rc;
int j;

memset(command,0x0,sizeof(command));
sprintf(command,”link “);
j=1;
while(j<argc)
{
sprintf(command,”%s %s”,command,argv[j]);
j++;
}
printf(“running [%s]\n”,command);
rc=system(command);
printf(“return code was %d\n”,rc);
if(rc==-1)
{printf(“I think it’s too many nested DPMI things between TNT & whatnot\n”);}
}

Ok, it’s not work of art, but it’ll get the job done.  You’ll need some kind of MS-DOS 16 bit real mode compiler to build this thing.  I would imagine Watcom’s C++ compiler can still build 16bit dos realmode exe’s, or Borland has something in their museum thing.  I’m using QuickC for Windows in a Windows 3.0 VM

Ok so now with our ‘link32.exe’ replacement, copy it into the f32\bin directory overwriting the existing one.

Next we will need the link.exe from Visual C++ 2.0 (or higher I figure), and copy that into the f32\bin directory, along with its needed files dbi.dll & msvcrt20.dll.

Next, download and unzip the HX runtime And you can either place it’s bin directory onto the fl32\bin, or unzip it to it’s own directory, and add a statement in your autoexec.bat adding it’s bin directory to the path.

Reboot to pick up the hxrt’s bin directory, unless you copied its bin into fl32\bin

Now we need to alter Visual C++ 2.0’s linker to run under MS-DOS. Simply run:

pestub \f32\bin\link.exe

And now you should be able to run link.exe under MS-DOS.

Finally replace the libc.lib & kernel32.lib with ones from your Visual C++. Naturally these are in the \f32\lib directory. Visual C++ 2.0 will link without complaining, 4.0 gives some weird messages, but it still works.  I never did test Visual C++ 6.0 & beyond.

So, building a simple ‘hello.for’ (mention in the prior blog post)

c:\F32>fl32 hello.for
Microsoft (R) FORTRAN PowerStation Optimizing Compiler Version 1.0
Copyright (c) Microsoft Corp 1984-1993. All rights reserved.

hello.for
Microsoft (R) 32-Bit Incremental Linker Version 2.50
Copyright (C) Microsoft Corp 1992-94. All rights reserved.

-out:hello.exe
-debug:none
-machine:i386
-base:0x00010000
-subsystem:console
-entry:mainCRTStartup
-stack:32768,4096
-defaultlib:libf.lib,libc.lib,kernel32.lib,ntdll.lib
hello.obj
running [link  -link @C:\TEMP\003635lk]
return code was 0

The only caveat here, is that because of HXDOS it *thinks* it’s running on Windows NT, (beta 2!) and will not run the bindmsf.exe program Not that it mattered as it was broken. I suppose if I were braver, I could read the link file, and scan for a ‘-out’ and run pestub on the output.. But I don’t so you will have to.  Otherwise, when you run hello.exe you’ll get:

This program cannot be run in DOS mode.

But running pestub.exe:

c:\F32>pestub hello.exe
pestub: hello.exe modified successfully

C:\F32>hello
HELLO!

Ok, so with all this work, we’ve managed to restore the basic functionality of Microsoft Fortran here.  Now the bigger question, will hello.exe run on say Windows Vista x64?

C:\Users\neozeed\dos\F32>ver

Microsoft Windows [Version 6.0.6002]

C:\Users\neozeed\dos\F32>hello
HELLO!

Not too bad, eh?

Oh, and onto zork:

c:\F32\DUNGEON>fl32 *.for
Microsoft (R) FORTRAN PowerStation Optimizing Compiler Version 1.0
Copyright (c) Microsoft Corp 1984-1993. All rights reserved.

ACTORS.FOR
BALLOP.FOR
CLOCKR.FOR
DEMONS.FOR
DEMONS.FOR(520) : warning F4999: RLIGHT : variable declared but not used
DEMONS.FOR(520) : warning F4999: RSER : variable declared but not used
DGAME.FOR
DGAME.FOR(781) : warning F4999: PROTCT : variable declared but not used
DMAIN.FOR
DSO.FOR
DSUB.FOR
DVERB1.FOR
DVERB2.FOR
GDT.FOR
MACHDEP.FOR
NOBJS.FOR
NP.FOR
NP.FOR(397) : warning F4999: DFLAG : variable declared but not used
NP.FOR(397) : warning F4999: QHERE : variable declared but not used
NP.FOR(507) : warning F4999: DFLAG : variable declared but not used
NP.FOR(780) : warning F4999: DFLAG : variable declared but not used
NP.FOR(1154) : warning F4999: DFLAG : variable declared but not used
NP.FOR(1277) : warning F4999: DFLAG : variable declared but not used
NP2.FOR
OBJCTS.FOR
ROOMS.FOR
ROOMS.FOR(1195) : warning F4999: F : variable declared but not used
SVERBS.FOR
VERBS.FOR
VILLNS.FOR
Microsoft (R) 32-Bit Incremental Linker Version 2.50
Copyright (C) Microsoft Corp 1992-94. All rights reserved.

-out:ACTORS.exe
-debug:none
-machine:i386
-base:0x00010000
-subsystem:console
-entry:mainCRTStartup
-stack:32768,4096
-defaultlib:libf.lib,libc.lib,kernel32.lib,ntdll.lib
ACTORS.obj
BALLOP.obj
CLOCKR.obj
DEMONS.obj
DGAME.obj
DMAIN.obj
DSO.obj
DSUB.obj
DVERB1.obj
DVERB2.obj
GDT.obj
MACHDEP.obj
NOBJS.obj
NP.obj
NP2.obj
OBJCTS.obj
ROOMS.obj
SVERBS.obj
VERBS.obj
VILLNS.obj
running [link  -link @C:\TEMP\000731lk]
return code was 0

The exe works fine on Vista, and pestub will allow it to run on MS-DOS.

*NOTE that the fortran compiler will *NOT* run on Vista/XP/NT.  The compiler was also linked with bad libraries & linker and it just won’t work.  I doubt forcedos would help for 32bit NT systems as the phar lap stuff is all out of date.  However DOSBox will happy run the compiler.

I haven’t even tried to debug anything, as I figure the best environment would have been a virgin copy of PowerStation 1.0 running under Windows 1.0 I did say keep a copy right!!!

Frontier, Elite II

I was playing with DOSBox on an XP machine, and I came across this exciting link: http://www.eliteclub.co.uk/download/ You can now download Frontier II as shareware! Most cool, so I’ve downloaded it & just run it under DOSBox. No tweaks, answer for the SoundBlaster sound card, and away you go! Here is me attempting to do a flyby of the Saturn system..

This game was super cool back in the day for it’s realistic physics as you could do slingshots, flybys, orbits & even land on various moons & planets. There is nothing more exhilarating then flying through the solar system or the universe at hundreds of thousands of Km/s. Not to mention the hyper drive!

You can give it a shot too, if your browser is Java enabled!  Just click right here, and enjoy!

Back to DOS

It’s been a long while, life has been busy. But I figured I ought to try to make a post this year!

Ok, I’ve gotten a new laptop over the last few months & I’m running the 64 bit version of Vista. One or the first things us old people will find is that the MS-DOS & Win16 subsystems have been completely removed.

This of course, poses a massive problem! How to play games!!!!?

Thankfully there exists two really great solutions for Vista 64bit users. The first one I’ll suggest is Virtual PC from Microsoft, and DosBox.

It’s no wonder Microsoft has made Virtual PC a free download since they have crippled the compatibility of the OS. Now I’m personally a little biased for Virtual PC as I’ve been using it since it was owned by Connectix. Virtual PC is a complete PC emulation strategy, allowing you to run MS-DOS or quite a few other operating systems. For this example I’m going to install MS-DOS, but it’s capable of running all kinds of other operating systems.

Now back to my laptop. It of course doesn’t come with floppy drives, so I used an older PC with a drive to create disk images. (it was running OpenBSD so I just ran ‘dd’. Winimage is capable of creating disk images as well). Of course I could use a USB floppy drive and boot my MS-DOS 6.22 floppies from that as well.

The cool thing is that you can setup a virtual machine, boot off either real floppies or virtual disks, and you will need to setup a virtual hard disk. Naturally it will need partitioning, and formatting. As for installing games, again if you have floppies of them, everything is cool. There even is an emulated CD-ROM device, however you will need a device driver to use it! (https://www.google.com/search?q=idecd.sys) Virtual PC emulates an IDE CD-ROM, and you can use just about any driver you can find out there. Once you can read CD-ROM’s under the emulated MS-DOS you can install the ‘extensions’ program, which has an idle program (to stop the emulator from consuming 100% of your CPU, as MS-DOS has no inherent idle loop), and a neat program called fshare. Fshare will allow you to give your emulated PC access to a directory on the host computer.

The plus’s of Virtual PC is that it’s a more accurate emulation, it provides sound blaster pro emulation, and good psudo device emulation. The major downside for me is that it provides no joystick emulation. Of course you’ll need to bring your own DOS, however I imagine that FreeDos ought to work just fine, but I kind of like the real thing.

The second emulator I’d like to mention is DOSBox. Unlike Virtual PC, DOSBox is not a complete system emulator, it’s designed specifically to run MS-DOS programs. So you will not need a copy of MS-DOS, nor will you need to worry about such hassles as media, or emulated hard disks.

To run DOSBox for the most part all I do is add the following lines into my config file:

Mount c: c:\Users\Jason\dos
C:

This will make my C: drive a dos directory in my home directory on Vista, and change the current directory there. From here I can unzip any of the old programs I have, or just copy from CD to my vista directory and just run things. Overall DOSBox has pretty good compatibility. I’ve even run Windows 3.1, and some compiler & development stuff. And yes, it supports Joysticks & the emulation of various sound cards. DOSBox also has various throttle and various video emulation strategies. The other cool thing DOSBox can do is setup a virtual IPX/SPX network, and allow you to play old DOS multiplayer games over the internet. Warcraft 2 & Doom work quite nice under DOSBox. While Virtual PC does provide virtual Ethernet interfaces, it does not provide a way to connect them up over the internet. While it could be done with loopback adapters & PPTP routing, it would be way beyond the average user. DOSBox can listen on a specified TCP port, you can setup your internet router to redirect that port to the host PC, then allow your friends to connect in.

While I can understand Microsoft’s desire to cut all ties with past OS’s in terms of support, It’s a good thing that there still exists an emulation strategy for the two of us. And between DOSBox and Virtual PC hopefully your needs will be met.

*Yes I’m aware of VMWare, however it’s not technically free, and while you can create your own config files, and disk images in Qemu, and install your own OS, it’s not the ‘right’ thing to do according to the EULA.