Archives
- April 2025
- March 2025
- February 2025
- January 2025
- December 2024
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- January 2011
- November 2010
- October 2010
- August 2010
- July 2010
How to make sure your program doesn’t run on Windows 95
For Christmas, I bought myself the book The Old New Thing by Raymond Chen, a long-time Microsoft programmer. The purchase was spurred by discovering, through Google Books, an excerpt of a riveting description of how various software titles abused the DPMI specification (and often common sense, too) in ways that made it difficult to run such software under Windows 95.
When I was nearly done reading my copy of the book, I realized that the protected mode programming treatise wasn’t there. Back to Google, I checked that my memory wasn’t deceiving me—yep, still there on Google Books. But for some odd reason, there are no page numbers in the excerpts of The Old New Thing that show up on Google Books, so I could not cross check with my printed copy. After a few more searches, I concluded that there are two appendixes which were probably never printed and only exist in electronic form.
Luckily, once I knew what to search for, Google found PDF versions of both: Tales of Application Compatibility and How to Ensure That Your Program Does Not Run Under Windows 95 . The latter is what I’d been looking for, but I’m not sorry that I bought the book. It’s worth reading.
Now, on to Appendix B: How to ensure a DOS program isn’t Windows 95 compatible. I found the insistence on calling DOS extenders "MS-DOS extenders" jarring—they were never limited to MS-DOS and worked just fine with PC DOS as well as DR-DOS/Novell DOS. No one called them MS-DOS extenders except apparently Microsoft (and even then only sometimes).
The author’s surprise that game vendors didn’t care that their games didn’t run under Windows 95 was a surprise (and a source of amusement) to me. I remember that era well. A gamer with a 4MB system could either run Windows 95 or a game requiring 4MB RAM, but not both. Same for 8MB systems and games requiring 8MB. Furthermore, games were essentially real-time software and any intrusion from a multitasking OS such as Windows 95 was highly unwelcome. Game companies didn’t want users to run their DOS games under Windows 95 because that just created problems. That’s why so many games came with utilities to create game-specific DOS boot disks. Yes, it was a cop-out, but it was a sensible solution.
Chen’s discussion of interrupt flag mismanagement is fascinating, but the target of his ire is misplaced. Sure, application developers were amazingly creative in breaking DPMI rules, but whose fault is it that POPF (and IRET) in some situations doesn’t restore the interrupt flag and cannot be trapped? Hint: The perpetrator’s name is five letters long, starts with I. The apps were intended to run under DOS, and they did. It’s silly that they wouldn’t run under protected-mode operating systems due to minor and easily preventable issues, but that was the reality of the marketplace.
The description of memory mismanagement is quite scary. The code in certain applications (especially games) was anywhere between misguided, broken, and outright insane. Clearly, many of the early 1990s games had been written by kids who didn’t quite know what they were doing.
The code snippet on page 39 immediately caught my attention because using RETF 2 to return from an interrupt handler is scary. It’s not necessarily wrong, just scary—because the programmer must be very very sure that only the flags which the caller expects to be modified may change, and the rest must stay the same. Unexpectedly changing e.g. the caller’s direction flag is great fun and leads to hard to find bugs.
While most of the appendix is specific to moving DOS programs into the Windows 95 environment, the section dealing with interrupts and timing is relevant for virtualization as well. "Jerky" time and back to back interrupts are typical in virtualized environments. That also applies to unnaturally fast keyboard input and device drivers which assume that interrupts from their device will always arrive after some finite period of time.
The epilogue of the appendix is lovely. And I do wonder who Publisher 3 was…
10 Responses to How to make sure your program doesn’t run on Windows 95
“I found the insistence on calling DOS extenders "MS-DOS extenders" jarring”
There was likely a movement within MS to replace references to “DOS” with “MS-DOS” around 1991. History: Back in the pre-5.0 days, OEMs were allowed to call their adaptation of MS-DOS names like “Compaq DOS”. Then DR-DOS was created which was not based on MS-DOS code, hence references to “DOS” were substituted with MS-DOS at around the 5.0 timeframe.
Searching for “EMS driver is not VCPI compliant.” suggests that it’s Origin. The DOS versions of WC3, WC4, Privateer and Strike Commander all had precise requirements and wouldn’t work in Windows.
Oh yeah, that sounds right. I was never a big Wing Commander fan, but I very clearly remember that Ultima VII (otherwise a brilliant Origin title) used a homemade DOS extender which could not even tolerate VCPI (goodbye EMM386/QEMM/386MAX), yet the game required some insane amount of free conventional memory. Voodoo Memory Manager it was called, and it must have been by far the worst DOS extender ever used in a commercially successful game. The other Origin games may well have used variations of the aptly named Voodoo Memory Manager.
In fact, from https://groups.google.com/group/alt.fan.bill-gates/msg/17c2f8873be131fc?hl=en :
“I work in a group where you get fined a quarter if you say
“dos” instead of “msdos””
What is fun is that the continued prevalence of DOS and Windows 3.x probably helped this situation last as long as it did, and that of course was partly caused by MS itself turning OS/2 2.x into an entire fiasco.
I agree that Chen’s target of his ire is misplaced but to his defense I do understand his irritation considering that the IF flag management has been clearly described in DPMI document:
http://www.tenberry.com/dpmi/02.html#03
And let’s not forget applications that were using unreal mode – those always required “restart to dos “option.
I did some digging and apparently Voodoo Manager is in fact unreal mode stub and not DOS Extender: http://wiki.ultimacodex.com/wiki/Voodoo_Memory_Manager
Unreal mode also called flat real mode or voodoo makes a lot more sense for the manager name. So the Chen comment isn’t about Ultima VII but the developer could be Origin anyway.
Usage or unreal mode also explains why it was non compatible with memory managers and dos extenders and why it needed so much memory below 640kb.
Usage of unreal mode doesn’t explain why it used so much conventional memory, only that it needed more than 640KB for data and for whatever reasons (probably performance) they didn’t want to use a more standard method to achieve this (EMS, XMS move block, VCPI or a DOS extender). I would guess they still used XMS to allocate the required extended memory so as to not step on other software and then just got the address of the extended memory block and directly accessed it.
An aside: why was this more commonly called “unreal mode” instead of “big real mode” or “flat real mode” ? The latter two terms are more proper terms as you’re setting the big bit in the descriptor to enable flat 4GB access. The term “unreal mode” is kind of silly.
I agree that unreal mode does not (or should not) automatically imply high conventional usage. I suspect it was just lack of forward planning and the conventional memory usage slowly snowballed to dangerously close to 640K, and there was no easy way to move anything out (as there would be with a real DOS extender).
The term “unreal mode” is both a pun and a nice expression of the fact that according to Intel, no such thing exists. It’s also shorter–always a plus.
I guess the reason for using interchangeably terms unreal mode, flat real mode and big real mode (and voodoo mode sometimes) comes from the fact that the same idea came from different people about the same time in pre internet days. So everyone came up with different name for the same invention. Unreal mode name has been pretty popular with demo coders, other names (except Voodoo) were popular with system/application programmers. On the other hand DOS 5 A Developer Guide book does not use any name for this mode when describing the idea (see chapter 18: Accessing 4 GB in real mode).
However I agree that flat real mode makes a lot more sense form programmer perspective but since Intel never confirm officially this mode usage of “unreal” word makes sens and play nicely with real mode memory addressing concept.
Last but not least I’m still interested who are the developers mentioned in the book.
This site uses Akismet to reduce spam. Learn how your comment data is processed.