We’ll start our conversation by saying that DOS/4GW is a DOS extender. That means DOS/4GW is a program responsible for adding some useful stuff on top of the vanilla DOS kernel you have installed on your system. And look, I know this does not really answer anything yet, but we’ll get there.
Let’s begin our journey trying to understand why DOS needs extending in the first place.
I definitely remember seeing DOS/4GW a lot when playing MS-DOS games back in the ’90s, but I had entirely forgotten about it. This article is from 2021, and explains what it is, and why it was needed.
This article ended at the most interesting point.
Once the processor is in protected mode, the program can’t just call the real mode DOS API. It needs to interact with DOS through some kind of translation layer. Natively that would mean some gross thunking assembly, which is obviously undesirable, so these runtimes provide that goo and expose a native protected mode API to the program. Which API? Well, it’s convenient to use an environment that development tools exist for, which means things like OS/2 and NT.
The Phar-Lap Lite product bundled with 16 bit Visual C++ is really an OS/2 runtime on DOS. The program you write is an NE (16 bit) OS/2 executable that uses the 16 bit OS/2 character mode API. That’s the version for 286 and above. The MS-DOS stub code at the top of the program loads the runtime, which switches to protected mode and loads the NE part of the program. Once I saw what this was doing, I had to laugh: the compilers this shipped with had officially dropped support for OS/2, and this tool was using them to make OS/2 programs. (It helps that they had the same executable format to 16 bit Windows.)
Phar-Lap TNT is the 386, 32 bit version, which emulated an NT API. These programs are real PE executables, following the same path as above.
Both of these support DLLs, which is partly how they work. The NE/PE executable format requires it. What this means is it’s possible to write a 32 bit NT program that can run on today’s 64 bit systems and also runs on DOS. There’s a few of these floating around, most notably the Visual C++ 1.1 (32 bit) compiler.
I’m not familiar with DOS/4Gw, but looking around it appears to use the LX format (32 bit OS/2.)
This is one of the most interesting things that I have read in a while and I had no idea. Thank you for that.
It seems that the LX/LE file format was used for Windows 95 device drivers as well. Fascinating.
The MS-DOS stub is a weird vestige of the early days of DOS and Windows. Whilst nowadays it’s there largely to print “This program cannot run in DOS mode”, i imagine it was used quite extensively in the 90’s to produce what those in the MacOS ecosystem would call a “fat binary”, ie one executable that ran on multiple platforms.
https://osandamalith.com/2020/07/19/exploring-the-ms-dos-stub/
OS/2 1.x provided two different means of having a program run on both DOS and in OS/2 protected mode. One was the Family API which generated a common executable that ran in the correct mode. The other placed a full sized real mode program instead of a DOS stub alongside of a standard OS/2 protected mode program. IIRC, that was the case for CHKDSK so launching inside the DOS compatibility box would run a DOS CHKDSK modified to handle the changes to FAT caused by extended attributes.
The article only covers the later stages of DOS extenders when the technology was largely standardized and many of the rough edges had been smoothed out. The early DOS extenders did not play well with others. The earliest attempts at a DOS extender by moving DOS applications into protected mode using LOADALL to fix the problems sort of almost worked on some 80286 steppings but improvements to the chip precluded continuing on that path. (I don’t know much about that but the fight between Intel and Digital Research showed up repeatedly in the trades.)
I used DJGPP for DOS programming, which supported 32bit memory addressing very nicely with none of the EMS fidgeting. It also ran under windows DPMI service. My own protected mode code only needed to call BIOS services because it was loaded strait from the boot sector with no other OS present.
Another option was “flat real mode”, which takes advantage of the fact that the CPU doesn’t clear the selector/segment registers right away until you explicitly load new ones. This means that you can leave 32bit selectors in any of the segment registers ie (ES, FS, GS) and it would continue to be accessible even from real mode code. This would largely be compatible with real mode environments as long as they didn’t override your segments. This gave real mode software a very handy window into 32bit address space.
Back in the early to mid 1990s I was starting to play Access Links, a golf simulator where the creators of the game took video cameras to different golf courses and made videos of all the holes on the golf course and then used that to somehow make the graphics as realistic as possible.
I tried multiple different memory extenders on DOS and while I found a combination that sort of worked, I was far from satisfied until the fateful day when I was lucky enough (because of work where the bank I worked at used OS/2 1.2 for different things so I was definitely familiar with OS/2. As it turned out, significantly more familiar that several people that came out to fix the PC that ran the stats for check sorters. I knew how to fix the issue and they didn’t. That’s when I started to realize that I knew more about OS/2 than I thought I did.
Anyway, I was sent an invitation to a presentation for people who worked at companies that already used OS/2 and they showed off OS/2 2.0 beta and that was the first operating system that I ended up LOVING (second was BeOS and later MacOS) to use vs hating a lot (DOS/Windows).
The first thing I tried was DOS/Windows (8-bit/16-bit) that were unreliable in DOS/Windows and they ran –significantly faster– and –significantly more reliably) than when I used them after booting them up in DOS or DOS/Windows (16-bit).
I then tried it at home with games like Links Golf where I could play around with DOS memory settings and suddenly Links Golf and any other DOS game that was memory constrained suddenly ran significantly faster and better with less loading before more of the game could be loaded at the same time.
OS/2 2.0 beta was a revelation for me vs DOS or DOS/Windows which at best sucked big time no matter what DOS extender that I used.
I started buying licenses for OS/2 2.0 for computers at work as soon you could buy them and the number of support calls on those computers dropped –significantly– and my enjoyment of DOS programs at home also jumped –significantly–.
I bought licenses for BeOS and downloaded LOTS of different Linux distributions for but they couldn’t do what OS/2 could. And when the writing was on the wall for OS/2 because WINE was yet to exist to run 32-bit Windows program in OS/2 yet I looked for other OSs and after a while settled on Mac OS X.
Lots of people feel that Windows ’95 killed OS/2 but it was other divisions of IBM that killed OS/2 because they were worried that OS/2 would take money away from them, and since they were so afraid of that happening I’m led to believe that is probably true and that IBM could have been a much more valuable company now if they hadn’t been so short sighted.
Anyway, that is my alternate version of gaming back in the early to late 1990s. Once PlayStation came out as well as Mac versions of games, even if they came out later I didn’t care. All I cared about was that I was having fun at the time. I didn’t compare what my happiness with others because I really didn’t care what people were doing with other OSs. All I cared and still care about is what I’m getting out of games.
And to this day I still haven’t used any Microsoft products at home for anything and I’m EXTREMELY happy playing games and always have been. For those that MUST have the latest games, I feel sorry for you that you have to compare yourself with other people. As long as you do that you will not TRUELY be happy because you are looking externally for happiness and that isn’t where true happiness comes from. It comes from within.
Sabon,
What game titles do you play?
While I personally agree one don’t always need the latest and greatest titles, I wouldn’t over analyze it. What reason is there for us to judge gamers who enjoying playing modern games? I’ve never really been bothered by other people’s entertainment preferences.
I also had an amazing experience with OS/2 back in the day. It was so much more advanced than anything else and it was certainly a much better DOS than DOS. I also agree that IBM did more to kill it than Microsoft did. In fact, they still are. If it were not so expensive, I feel that I would still be trying to use OS/2 somewhere even now and I bet I am not alone. That said, OS/2 has some real architectural flaws compared to modern systems. Even 2.x was still 16 bit in important ways and the ability to freeze out the user by blocking the I/O queue was a fatal flaw. It is amazing that things like the filesystem ( JFS I mean ) would still be acceptably modern. The Workplace Shell has still not been equalled in some ways. Of course, OS/2 ( even the expensive ArcaOS ) is practically unusable these days on modern hardware and with modern software. That is not because it has to be; it is after years of neglect and the inability to extend is meaningfully with IBM continuing to stand in the way. Like most proprietary systems of its day, it is just fading away.
I missed BeOS as I was an early, early Linux convert ( like 1991 ). My first Linux setup used the TWM configuration from the Sun lab at University. I must have dual booted Windows though as I was somewhat of a gamer back then.
So, I do not think we should judge Windows users so harshly. If I was not able to play Starcraft back in the day, I would not have been happy. Not because I was comparing myself to others but simply because I really enjoyed it and I was not aware of another way to get that experience. My computer existed to provide the experiences that I wanted after all. There was a social aspect as well as a few friends and I would regularly play against each other. That was not social pressure–it was just being social. I am sure that all these things have only increased in this day and age ( though the rare gaming I do these days tends to be on older titles that I already know and love which run just fine for me on Linux–including Starcraft of course! ). My son is an avid gamer though and even Steam on Linux just would not be enough for him. He uses Windows and I think that makes sense for him.
I cannot claim to have avoided Microsoft products myself. My work uses Windows and Office and while I use Linux and LibreOffice most of the time, I certainly use Outlook every day and even run Microsoft Edge and Microsoft Teams on Linux. I access Office 365 on Linux ( via web ) fairly often as well, especially OneDrive. For my personal programming projects, I turn to .NET more than anything else ( on Linux usually ). I use Azure both personally and professionally. I do not really boycott any technology companies in general. Instead, I use what makes the most sense for me. That is rarely Windows.
“If it were not so expensive, I feel that I would still be trying to use OS/2 somewhere even now and I bet I am not alone.”
I totally agree with you about the price. However, IBM isn’t the one setting the price. It’s (I don’t remember the company that has the license) the company that has licensed OS/2 from IBM which also has to pay Microsoft because part of the code is from Microsoft. Not the best parts obviously or else Windows ’95 and later versions would have been and still would be better than what Windows is today.
Have you checked out Haiku recently? It has really made strides on newer 64 bit hardware and the full system can run directly from a USB drive without installing it to disk, so you can easily check if it supports your hardware.
Yes I have the same attitude. I used to check eBay for N64 and gamecube games under a certain price, go read the reviews, and then buy them. It worked well and I discovered many fun and unheard-off games.