DOS/4GW and Protected Mode (2021)
pikuma.com
pikuma.com
There were very likely some hacky TSRs that caused problems, but in my experience most were extremely reliable. We used an off-the-shelf TSR to enhance a motion control system that laser scribed ceramic vacuum checks for silicon wafer fabrication. Those things cost $5k in 1990, and took ~20h of processing, increasing their value to $15k; we wouldn't screw around with something that was inherently "extremely unreliable".
Also wrote a couple of TSRs of my own as a kid learning to program. Sure you could crash the system, as you could with any program, but they were as reliable as anything else.
The only thing special was that you generally didn't want to run two TSRs that naively hooked the same interrupt without chaining properly. But back then we didn't have thousands of mysterious background processes always running in the background. You knew what few programs you had run, so it wasn't really a problem.
stop_clock: All it did was stop the real time clock of the system from counting up when you pressed the alt key and started it again on a 2nd press. However, this was enough to stop the timer of a typing speed program we used in high school. Magically, I was a VERY fast typist. :-)
stay_on: When you pressed a certain key sequence it would start the floppy drive motor and a 2nd press would turn it off. The goal was to speed up floppy accesses by not needing to spin up the motor all the time. Unfortunately, I got up one day to find my floppy drive motor dead. I suspect I forgot to turn off the motor (there was no idle timeout...I was a kid, never even crossed my mind!)
There isn't anything inherently unreliable with TSRs; DOS even provided interrupts for this specific operation (although some malware would not use them).
I think (although not entirely sure) that some mouse drivers were, for example, TSRs.
The problem is that there was a wide range of purposes and implementations, including malware, so the argument is similar to "BTC is mostly used for dirty money, so BTC is inherently criminal".
Eg, things like a calendar tool trying to pop up a reminder mid-game would often not end well.
This froze the windows 95 setup in graphical mode. Although the text prompt appeared for whatever reason the Y/N didn’t work and we could never continue.
So was never able to upgrade that machine.
Programming TSR's as a teen was where I learned to hit ctrl+s every line, at most!
Was kinda hard to debug given the "terminate" part and the tools at the time.
Also, "Fun fact: The original Wolfenstein 3D engine, created by id Software, was developed using pure real mode". Well, that figures... if you still wanted your code to run on 16 bit CPUs (286 and below), you had to use real mode. That's also why, for several years, only the then-"AAA" games like Doom, Duke Nukem 3D or Tomb Raider used DOS extenders. Titles that were less demanding on the hardware (platformers and other 2D games) kept using real mode for quite some time longer.
Actually, I can add a fun fact of my own: when I started in software development in 2000, it was at a company developing Windows applications using Delphi - and at that time they were still keeping up compatibility with Windows 3.1, i.e. compiling in 16 bit mode. They finally switched to 32 bit soon after I joined, and I can't tell you what a relief that was. Although getting rid of the weird hacks in the source code that were made necessary by the constrained memory space of 16 bit applications took some more time...
We did it for 4k intros back in the day: https://www.pouet.net/prod.php?which=289.
One fun optimization trick was the 0x66 prefix: Switching from 16bit to 32bit mode also switched the trade-off in opcode sizes. So in that intro most of the audio code runs in 16bit mode, while the graphics (which is actually not palette but full 32bit color) runs in 32bit mode.
When I tried using my roommate's DOS PC and C compiler I crashed the entire machine so many times. There was no memory protection of any kind. Write something outside the array bounds and you could overwrite critical DOS data structures and lock up the whole machine. Hard reboot so many times.
Then my roommate tried to explain near and far pointers. I never understood it until I looked it up a few years ago. It was all related to the 16-bit vs 32-bit segmented vs flat memory models. Everything just seemed so much easier and faster on the VMS and Unix systems. But the also cost 10 to 100 times as much.
I also thought it was really pathetic that I could only run one program at a time. On the VAX and Unix systems 10 to 200 people could be logged on at the same time all doing there own thing and it was very difficult to accidentally bring down the whole machine.
It all made me NOT want my own PC because DOS/Win 3.1 was so limited. It wasn't until Linux in 1993 that I wanted my own PC.
I was running OS/2 1.2 and 1.3 in 1988-89 and beta versions before that. It only let you run a single DOS box but you could run any number of protected mode OS/2 text and Presentation Manager (PM) GUI programs. These were of the 16-bit (near/far) segmented memory model. In 1992, OS/2 2.0 ran the 32-bit flat mode and multiple DOS boxes in windowed areas of the desktop, as well as Win16 programs.
The company also had developed their software for IBM mainframes, Wang minis, VAX, AIX, HP-UX, and DEC Alpha. Of all of these OS/2 and Windows NT were the most interesting to me as they seemed close to consumer platforms. The experimental NeXT target we dabbled with but never ported to. That was the future that we had to wait many years to be popularized by Apple. Interface Builder seemed so much better than XCode though.
DOS4GW was the flavour that came free with the Watcom compilers. It was very popular with DOS games that let you use the available hardware to the maximum capabilities.
I started on DOS... but one day I bought an AT&T 3B2400 and two veritcal format Televideo terminals at a university salvage sale for $25 (it didn't do Lotus 1-2-3, so the business school didn't want it). That machine was a a true SVR3.2 Unix machine, complete with all the development tools and incredibly good documentation. The 3B2 was a world into itself, and opened my eyes to how limiting DOS was.
* Not 100% if it was 1 meg, but 4gw ultimately removed the run-time allocation cap. If you had X megs, you could allocate X megs with one call. That was truly revolutionary.
The 80286 was a 16-bit processor but had a 24-bit address bus which is what allowed it to access 16MB of RAM. The 8088/8086 were also 16-bit processors but had a 20-bit address bus which limited them to 1MB. The Z80 and 6502 were 8-bit CPUs with 16-bit address buses which limited them to 64KB.
Random anecdote: as a kid, DOS/4GW stood for "DOS for great win(dows)" (which I know makes absolutely no sense).
I guess that other programs would directly communicate with DOS/4GW through a different interface and that's when you can't just replace it with a different extender, but there are other extenders that can fully replace DOS/4GW such as DOS/32.
[1] https://devblogs.microsoft.com/oldnewthing/20071224-00/?p=24...
When my code was written, it had exactly the same delay as other dos extenders.
So I think, it will be better for him to admit this, and give exact source, so will not Streisand effect issues.