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.
Can it run Windows 3.0 in enhanced mode?
I used it to run Windows 3.0 in real mode in a DOS prompt, in a window
sadly 3.0 neither runs in enhanced or standard mode. But 3.1 can run all 3.
Are you sure?
“…Windows 3.1 dropped real mode support and required a minimum of a 286 PC with 1 MB…”
from: https://en.wikipedia.org/wiki/Windows_3.1x
I remember that running “win /r” on 3.1, it states that real mode is not available.
You are right I was thinking 3.0.
Anyway with the freedos patch it’ll run standard and enhanced. Only real mode works with 3.0
Not quite what you’re asking -but I’ve been playing with this in 86Box and haven’t been able to get either win386 or windows 3.0 to work with this version of FreeDOS. The only one I can get working is windows 3.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?
there is no advantage, other than I don’t want to boot natively at the moment. It’s certainly not about being practical more so that FreeDOS couldn’t run Windows 3.1 prior, and now it can.
It can’t run it with as standalone app in 386 mode. It needs a real copy of DOS and BOOT emulation mode. Basically the same than running it on QEMU.
I’m using DosBox 0.74, and it runs 3.0, 3.1 and 3.11 in 386 enhanced mode fine, without a real copy of DOS. I didn’t patch it and don’t remember any special config requirements. I don’t have it running Windows/386 though.
As far as I know it does currently need a real copy of DOS to run Windows 95, although since it can run 3.x in enhanced mode, there’s no obvious technical reason why this support couldn’t be added. As has been discussed on this blog before, that’s basically what Merge/Win4Lin was (a DOS translation layer capable of running 9x on UNIX/Linux without needing full VM virtualization.)
Does DOSBox support the virtual 86 mode? With it can you run Win 3.0 in real mode inside a DOS window?
Yes it does!
https://virtuallyfun.com/wordpress/2017/12/29/dosbox-0-74-can-run-windows-3-0-3-1-in-386-enhanced-mode/
I was quite surprised myself!
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.
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
If you are on real hardware the old Microsoft drivers are going to have issues with far too much memory. You’ll need an alternative driver, I guess the JEMM stuff?
im using himemx now from freedos… 128mb system but yeah keeps stopping at that point I might try install on another system
himemx didn’t work for me… although with 128MB in Qemu the himem.sys for Windows 3.1 runs with the max of 64MB of ram.
ok I had better luck with this:
DEVICE=C:\HIMEMX.EXE /NUMHANDLES=128 /MAX=8192 /METHOD:BIOS
You can try ramping up the memory if it actually works… I think 256MB is the absolute max?
Interestingly enough himemx.exe doesn’t permit FreeDOS to run in 386 enhanced mode. Not that it’s a practical thing in 2021.. lol
why not use JEMMX instead?
YAY! this worked!!!
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.
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.
the diff to enable it, has a bunch of stub calls, but it’s basically to acknowledge the Windows startup process.
There is also an extensive critique of the diff, perhaps its why it was never done as it’s not ‘pure’. :shrug:
There was nothing ‘pure’ about MS-DOS to begin with! Well besides pure chaos.
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.
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.
Well, it’s now merged on to the stable branch of the freedos kernel 🙂
that’s great news!
looks like it was here?
23 days ago. … I mean it’s still great!
I Hope there is no needs for InDOSPollingMode=true on system.ini
hi i did the steps with freedos 1.3 and i cant get win3.1 Enhanced to run i have to use /s to start windows
what emulation?
I just re-set it up and had it running once I re-read the instructions about loading share & InDOSPolling. Even with a 4MB permanent swap file and 8MB of ram.
The kernel of freedos 1.3 is not compiled with Windows 3.1 support
Oh I’d been using the one I’d linked to. I didn’t realize that they didn’t ship anything with it in by default.
There’s supposed to be a way to add it as a compile-time option ..something in config.bat, I think? I haven’t been able to get 1.3’s kernel to load win /3 consistently, though.
I have found a link that explains how to achieve this
https://danielectra.github.io/blog/windows-31-on-freedos
The parameter to compile IS /DWIN31SUPPORT
could you update the file needed for this to freedos 1.3? i would love to run windows on freedos.
I guess I’ll have to learn how to build freedos as I get the impression it’s not on by default?
I’m knee deep in the Darwin at the moment, I’ll see what I can do.
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 .
any update on a compiled version of win3.1 support i tried it myself but can figure out how.
I’d been enjoying dos 4 which runs windows fine
Tell this to Jeremy David which is the developer making this happen. Maybe he can view dos 4 Code to make Windows work on freedos kernel.