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.

45 thoughts on “FreeDOS running Windows 3.1

  1. Given that Dosbox can run 3.x in all modes, what is the advantage of FreeDOS? I thought the reason is Dosbox is a virtualized environment (including BIOS) whereas FreeDOS can run on real hardware. What’s the reason for wanting to run FreeDOS under QEMU?

  2. Appears to work alright in 86Box, too!

    Of course, it’s important to follow all of the steps in order -in particular I kind of skipped “fdisk /mbr” (which was vital) and adding share (who needs it? turns out this does). I did a clean install of windows and made sure “share” was running and that InDOSPolling=TRUE was added to system.ini before running win /3 for the first time -but when I did, it was fine.

    Socket 5/Shuttle HOT-543
    Intel Pentium – 100/60
    Microsoft serial mouse
    VGA display
    IDE controller

    Before I added “share” windows would reboot the computer when I ran win /3 -so if that’s happening to folks on 86Box, that’s something to rule out.

    My choice of using 86Box (or VirtualBox, or qemu) instead of DOSBox is intentional. Qemu, and 86Box, are general computing applications (they can run DOS, they can run Linux, they can run NeXT) and for my money (and my time) that’s preferable to an overly-specialized program such as DOSBox.

    Also DOSBox is optimized for games, I’m not a gamer. DOSBox-X is cool (and intended to be used in productivity applications) but I don’t find myself using it all that often either.

  3. I can’t even get it to install past the dos setup, it stops and says cannot run in standard mode and I have used the new kernel and followed your instructions but no dice on real hardware anyway…himem is installed just says cannot run in standard mode when it goes to switch to the GUI part of the installer

  4. JEMM386.EXE, HIMEM.EXE, HIMEMX.EXE, JEMMEX.EXE and EMM386.EXE from freedos and including FDXMS286.SYS and FDXMS.SYS doesn’t cooperative with windows 3.1 / 3.11, that’s because those memory managers doesn’t support GEMMIS.

    • It’s why I was kind of surprised that the shipping himem.sys worked.

      I found source code to an older version of himem.sys turns out Microsoft used to publish it!

      In a way I’d just cut it off to only accept 16MB so you don’t have to worry about DMA. The growing pains of 32bit before PCI was quite painful

      • I’ve always had issues with FreeDOS drivers. There is something “off” with the implementation. That or Microsoft’s implementation didn’t follow standards and everyone tested their stuff against it.

        Prime example is SHSUCDX. It has weird incompatibilities that you might as well just run MSCDEX.

        For memory management, I stuck with Microsoft’s HIMEM/EMM386 or a trusted 3rd party like QEMM or Helix. If your motherboard supports it, an UMB unlocker like The Last Byte or UMBPCI are a good option. In some cases you can actually load HIMEM.SYS high! Many people don’t realize it, but Windows 98SE has an updated HIMEM.SYS that supports more then 64MB and fixes a few bugs.

  5. What in FreeDOS is preventing Windows 3.1x from running? I know Microsoft did some dirty tricks to prevent DR-DOS from running, but FreeDOS should be aware of them. Just drives me nuts that FreeDOS has modern/updated internals, but isn’t compatible with so many things. You are cloning DOS, you should be aiming for 100% compatibility! Yes, that includes running Windows 3.x in all modes.

  6. Ok, i think all is documented already now , including GEMMIS. Novell had the same problems with the digital research’s dr-dos , but novell solves it , freedos must be 100% compatible with DOS(DR or MS it’s same except for some diferences in the DR opearting system) and for a thousand of years the windows 3.1/3.11 support is not on the stable branch. Plus other things memory managers for freedos doesn’t want to cooperate with windows (because the lack of GEMMIS) and today some developers are still thinking … Why this is needed? .

    Ok stupid world , i don’t understand nothing.

  7. Sorry for my two posts but … some utilities of freedos are with incomplete functionality for example there is a CHKDSK.EXE with missing FAT32 support, there is/was a FreeDOS Scandisk which does nothing. There is no BACKUP/RESTORE and , i feel the people has lost the hype and the motivation.

  8. Yes it’s not It IS a define on the C programs called WIN31SUPPORT and there IS another WITHFAT32 for FAT32 support. But FAT32 IS not supported by chkdsk.exe .

Leave a Reply