As reported a few days ago the Windows patches for FreeDOS were committed!..

a couple of weeks ago.

This will be the perfect follow up to the aptly named previous post FreeDOS running Windows 3.1.

I’ve haven’t built the FreeDOS kernel in a while and I have to say it’s pretty easy. I’m taking the easy way out here, so I’m using OpenWatcom v2, because I figured the tools should be both at least Win32/Win64 and halfway up to date. Don’t get me wrong, MS-DOS Player is a fantastic app but I don’t want to lean on it for 100% of the build.

I configured it for something in my mind generic with the following flags:

build fat16 wc 86 win

Naturally it had issues with 3 executables, two of which are generated as the project builds, and I just did some silliness to have MS-DOS player make ‘native’ versions:

patchobj.com: patchobj.c
        $(CLT) $(CFLAGS) patchobj.c
        msdos -cobj.exe patchobj.com
        -rm -f patchobj.com
        -ren obj.exe patchobj.exe

exeflat.exe: exeflat.c ../hdr/exe.h
        $(CLC) $(CFLAGS) exeflat.c
        msdos -cxeflat.exe exeflat.exe
        -rm -f exeflat.exe
        -ren xeflat.exe exeflat.exe

The same went for sys\bin2c.exe but it’s not rebuilt every time so it doesn’t matter.

And with that in hand it boots. YAY

And now for some absolutely unfair testing. Before anyone complains, yes this is absolutely unfair I mean hell if you bought Windows 3.1 in 2021, I guess get OS/2 or just keep digging at the yard sale and get MS-DOS. Anyways here we go:

Whoopsies!

Turning off InDOSPolling gives this lovely crash. Naturally then it’s still required.

My go-to test, Running Infocom/FASA BattleTech Crescent Hawk’s Inception in CGA mode in a Window hard locks the VM before anything is drawn to screen. Bummer. And that is pretty much the story of FreeDOS under Windows on this build. Again it’s 2021 who even needs Microsoft VDMs?

That said there must be some weird hook in MS-DOS that Win32s relies on. Just like before Win32s fails to run.

The holy trinity of ‘bad’ Windows 3.0 games, Sim City, Sim Earth and Sim Life work just as they did in the prior version, with Sim Earth instantly quitting. Not sure what is going on there. It does launch with virtual memory enabled, but then proceeds to corrupt all the file handles and Program Manager loses it’s mind. In the productivity front Excel v3, and Microsoft Word v2 run fine. Yay!

Windows 3.1 is serious business!

So in conclusion doing Win16 things in Windows 3.1 is seemingly fine.

FreeDOS running Windows 3.1

Yes, really it’s FreeDOS running Windows 386 Enhanced mode. For real.

perditionc posted this over on the freedos list:

Hello everyone,

So it took me a bit longer than I planned, but below is the
information needed to reproduce and links to sources.  (Be kind, I
know that the code needs more work.)

To see it in action, from installing FreeDOS & Windows to running I
posted an updated the video (about 4 minutes, sped up some stuff and
cut some scenes down but its originally a single recording from first
boot until the end)
Steps:
download boot disk - http://server2.fdos.org/tests/fdos2043w.img
contains:
    kernel *** requires patches, see below for source
    command.com (FreeCOM)
    fdisk
    format
    sys
    share
    edit

have available Windows 3.1 install media (*** not provided ***)

create a virtual machine (or have a compatible real computer)
example has a 200MB hard drive with 32MB of memory and otherwise
virtual box's Win 3.1 default settings.

boot FreeDOS floppy
fdisk
    create a primary partition, don't use FAT32, use all available
space, ensure active
reboot so kernel see new partition
format
    format the C: drive and set label as desired
fdisk /MBR
    install master boot record so hard drive is bootable
sys C:
    install system boot record and files to C: partition
    copies kernel.sys and command.com to C:
copy share.com c:
copy EDIT.* C:
    so have available after install Windows
Optional: take out (disconnect virtual) floppy from drive and reboot,
ensure hard drive boots
Optional: create a CONFIG.SYS and AUTOEXEC.BAT so not prompted with
date and time
Install Windows
    put in first Windows floppy and run SETUP
    follow prompts until complete, allow it to modify CONFIG.SYS and
AUTOEXEC.BAT
Optional: edit AUTOEXEC.BAT to load SHARE.COM
    (if you do not do this step, you must remember to do so before
starting Windows)
Edit C:\WINDOWS\SYSTEM.INI   (adjust based on actual installation and
editor of choice)
    find [386Enh] section, at bottom add line:
    InDOSPolling=TRUE
    save file
win
    start Windows, will be in Enhanced mode if supported
Source:
Kernel patches - http://server2.fdos.org/tests/kernel-win3-patch.diff
rest of sources (kernel, FreeCOM, format, fdisk, sys, share, edit) -
https://github.com/fdos

Credits:
Bart, Tom, and others who have improved the FreeDOS kernel to where it is today
All the other FreeDOS developers, especially for FreeCOM, FDISK,
FORMAT, and EDIT
And Eric who's original research helped with the initial
implementation of the necessary patches a decade ago
(https://web.archive.org/web/20061001224249/http://www.coli.uni-saarland.de/~eric/stuff/soft/specials/win3.x-dosext-freedos-notes.txt)

I will be working on improving the code, specifically the critical
section handling and hopefully remove the need for the InDOSPolling
flag being set as well.

Enjoy,
Jeremy

And sure enough I was able to reproduce Windows 3.1 from the binary. I haven’t looked at patching/building yet.

Turning off virtual memory let’s FreeDos run in a Window!

Even more amazing to me BattleTech 3025 can run CGA mode in a Window too!

I should add that VMWare player didn’t work, nor did later versions of Qemu either. I had much better luck with my mutated Qemu 0.90 fork thing. ISA Cirrus card for sure!

Being able to run Windows 3.1 in 386 Enhanced mode has been one of those holy grails of compatibility. It’s great to see this in action!

I should add that Windows/386 and Windows 3.0 don’t work. 386 needs some versioning set, and 3.0 is convinced that the memory is too fragmented or that C: is really A:. Also Win32s doesn’t work either, but still Sim City, Excel and Word run fine!

As a follow up, 3.11 for workgroups or not doesn’t work either.

Today marks 20 years of FreeDOS!

From the original announcement:

A few months ago, I posted articles relating to starting a public
domain version of DOS.  The general support for this at the time was
strong, and many people agreed with the statement, “start writing!”
So, I have…

And how does it measure up?  Well the current release version is v1.1 and I tested it in both Qemu and VMWare Player.  First the installation process is SLOW.  Extraordinarily slow.  I really have no idea why, but 10+ minute installs in either environment were the best I could do.  The one thing I did do on installation was to disable a FAT32 drive, defaulting to the older FAT16 file-system.  Why? well because ..

Stacker 4 on FreeDOS

Stacker 4 on FreeDOS

Once installed, I thought I’d torture the environment, and install Stacker 4.0.  The installation went ok (I modified my system to boot up with option #3 as the default (Load FreeDOS including XMGR XMS-memory driver).  The installation went smooth, I setup a 300MB compressed drive, rebooted and the drive was not available.  I think this was because MS-DOS uses a config.sys file, and FreeDOS uses fdconfig.sys.  Although at the same time the autoexec.bat file was not modified as I had requested.  So I ran ‘config.exe’ and it walked me though additions to the c:\stacker.ini and what needed to be added to the (fd)config.sys (device=c:\stacker\stacker.com).  I did that, and rebooted, and I had my compressed D drive.

Then I installed DOOM v1.1 onto the compressed drive, and it runs perfectly fine! (is a screen shot really necessary?)  Seeing that DOS4G/W works (I also tested Descent, and Wolf4GW).  Oddly enough Wolf3d just hangs at a black screen, and Descent runs too fast although I think both issues are more specific to the games running on Qemu/VMWare than FreeDOS.  And if you want to skip the lengthy install, you can download my stock VMDK right here.

Seeing that 32bit DOS extenders seem OK, I thought I’d try TradeWars 2002 with it’s 16bit DPMI version, and it ran fine as well.

TradeWars on FreeDOS

TradeWars on FreeDOS

Now when it came to multitasking, Windows 3.0 won’t work outside of realmode.  Windows 3.1 however will run in standard mode.  386 Enhanced mode still doesn’t work correctly (is that even an issue)… So to use this for a BBS you’d need a network and some nodes… maybe fun for another day.  Excel 3.0c works under Windows 3.1 Standard mode, while Word 2.0c does not.

Another weird thing is that the FreeDOS partitioning program (fdisk) chooses a NON-DOS partition type by default, so if you were expecting to dualboot between MS-DOS and FreeDOS I think you need to install MS-DOS first, although I guess in the age of virtual machines does it matter that much?

For basic MS-DOS program compatibility it seems pretty much there, even with weird stuff like stacker.