The little-known winstart.bat batch file (devblogs.microsoft.com)

118 points by ingve 5 days ago

EvanAnderson 13 hours ago

The architecture the DOS-based windows line, and particularly the versions that had the virtual machine manager and ran in 32-bit protected mode, is such an interesting crufty archaeological dig. The OS's are bristling with hacks to make things work in resource-constrained environments, all while having ridiculous amounts of compatibility. There's a certain perverse elegance in it.

NT, being a "real" OS (with memory protection, kernel/user separation, access control, etc), seems so much more obvious (and boring) in its design compared to the earlier DOS-based Windows series. The "adults" came in and showed the kids how to make a grown-up operating system.

I don't miss the instability of the older DOS-based Windows OS's, for sure. I wouldn't want to go back there. For their time, though, they really did punch above their weight.

Edit: I didn't mean "adults" in any negative sense. I think MSFT took advantage of an opportunity for some very senior and opinionated talent.

smackeyacky 13 hours ago

I don’t know about that “adults” comment. Microsoft grew their operating system up from a very low base where the “adults” moved theirs down. For most users, windows NT was ridiculous overkill.

At the time most users and businesses didn’t own a PC that could do the virtualisation tricks required by windows 3 (o windows 2 386). A lot of places still had XT class machines right up to the end of the 1980s.

So the Microsoft guys had a pretty complex landscape in which Windows had to operate and they managed a fantastically complicated solution. They were definitely adulting hard during that time.

EvanAnderson 12 hours ago

I didn't mean to imply there was something "less" about the talent creating the DOS-based Windows OS. I think it's a marvel of engineering for economy and constraints.

I think NT was a means to an end (government contracts requiring a "Rainbow book"-qualified OS). It was a long time before the DOS-based Windows OS lost its position as the consumer / business offering. I think that shows MSFT knew what they had in that legacy code and leveraged it for great profit for a long time.

I think the "adults" came in and made a stuffy buttoned-down operating system meant to qualify as a "C2"-compliant OS meant to win contracts. NT doesn't have the hacky charm of the DOS-based Windows versions.

AdieuToLogic 8 hours ago

userbinator 10 hours ago

IMHO it was an architecture far ahead of its time --- basically a hypervisor running existing DOS in VMs, with all hardware passed through by default. If they kept at it instead of abandoning for NT, by e.g. increasing protections for better isolation and reliability, while still passing through where performance mattered, we might've gotten Microsoft's take on Xen.

crazysim 9 hours ago

Would HyperV and Virtualization Based Security be that take? I suppose it’s taken very far on Xbox and VBS is enabled by default on most Windows systems.

cyberax 9 hours ago

It was not a hypervisor, the hardware was not virtualized. They instead used 16-bit code for the OS kernel, simply transitioning between 16 and 32-bit modes.

The 16-bit code was a dead end. It was not re-enterable, so 32-bit code had to take a Win16Mutex on every kernel code.

If you ever debugged DirectX code on Win9x, you'd remember that quite vividly. The LockSurface call that provided direct access to pixels locked this mutex, so a breakpoint in a locked section caused an instant hard deadlock.

That being said, it indeed was a brilliant hack that allowed a featereful GUI to run within 2Mb of RAM with good DOS compatibility.

haileys an hour ago

pjmlp 3 hours ago

In retrospective everything is easy.

jeffrallen 4 hours ago

"Showstopper" is the book that explains this time in Microsoft's history. An excellent read.

tom_ 10 hours ago

If the NT design were as obvious as you suppose, then POSIX systems would work that way too.

EvanAnderson 10 hours ago

The "obviousness" about NT's design I was talking about, compared to the DOS-based Windows versions, were things like a trusted computing base, access control, kernel/user separation, memory protection, etc (stuff the DOS-based Windows versions had little to none of).

POSIX systems have that stuff, too.

userbinator 9 hours ago

pudgywalsh 12 hours ago

> The "adults" came in and showed the kids how to make a grown-up operating system

Oh please — it's easy when you have the luxury of starting from scratch with unlimited budget.

DOS-based Windows had to both retain backwards compatibility with DOS applications and all their quirks and coexist with them at the same time.

The amount of hacks necessary to pull that off is an accomplishment unto itself.

Remember you couldn't really play games on NT-based Windows until Windows XP came out and even then DOS games were pretty much out until DOSbox came along.

Guess those "adults" had to stick with Solitaire and Hearts.

jasonfarnon 11 hours ago

Definitely. I think the way microsoft brought their user base along between 1990 and 2000 from Dos to 32-bit protected mode was beautifully respectful of their users. To me it's the standard for how to change a user's preferences (maybe for social change in general). I just used Dos or win16 apps less and less over the decade and eventually my use dropped to zero. At no time did I feel coerced to leave behind what I already invested in, I just came to appreciate the alternative they were offering (the opposite of a forced OTA update). By the 2000s I could already sense a slight change in tone with how strongly they were pushing those service packs for windows xp.

ahartmetz 12 hours ago

Windows games worked great on Windows 2000! There were officially inofficial packages of DirectX and such - I never had any trouble with them.

I think DOS games also worked.

theevilsharpie 3 hours ago

kridsdale1 12 hours ago

userbinator 10 hours ago

We booted an operating system and then booted another operating system around it, so that the original operating system was now running inside a virtual machine controlled by the second operating system.

Decades later, this was again brought to attention by https://en.wikipedia.org/wiki/Hyperjacking and subsequently Microsoft themselves "reinvented" the concept as a Windows feature: https://learn.microsoft.com/en-us/windows-hardware/design/de...

nonfamous 9 hours ago

Nice little metaphor in the footnote, there:

>>> Think about that: We booted an operating system and then booted another operating system around it, so that the original operating system was now running inside a virtual machine controlled by the second operating system. It’s like leaving your house, walking down the street, and halfway down the block, realizing that you’re now walking inside a movie studio set.

layer8 11 hours ago

Here’s hoping that we’ll have the technology to digitize human brains before Raymond Chen dies.

joshuat 13 hours ago

Always enjoy a Raymond Chen article

kmeisthax 10 hours ago

It's funny how Windows 9x (and the 386-enhanced versions of 3.x) used "VM" to refer to DOS specifically. The legacy of real mode software was so towering even back then that Intel had to build a mode to virtualize those apps specifically, despite x86 not being able to virtualize protected mode kernels until decades later. In what other CPU architecture do you get such specific amount of privilege isolation?

smartmic 5 hours ago

What the heck are "TSR"s? Is this common knowledge?

martijnvds 4 hours ago

DOS programs generally were like command line apps today (but simpler, obviously). They did a thing, then exited. Or they showed their "TUI" (as we'd call it today), and when you told it to exit, you got back to the DOS prompt to start the next program.

TSRs were a special kind of program, that instead of telling DOS "I'm done, here's my memory back", said "I'm done for now, but don't unload me", so their memory stayed allocated/used. And you got your command prompt back immediately to continue your work.

TSRs usually hooked into an interrupt like the keyboard interrupt, intercepting a hotkey to re-activate the program (so you could browse your address book while you were in your (text mode) word processor; "kind-of" multitasking), or they offered a service to other programs (like the mouse and CD-ROM drivers).

There were all kinds of things that ran as TSRs. Virus scanners (hooking into disk write/reads), modem tools (showing "RING" in the corner of the screen when the modem detected an incoming call), note-taking apps, address books, you name it.

rombert 5 hours ago

TSR stands for Terminate and Stay Resident, a distinct behaviour for DOS era programs, which would usually run to completion and exit.

denzil 4 hours ago

To expand upon this - the TSR programs stayed in memory after being loaded. Typical use were drivers, for example mouse driver. It loaded, hooked itself in the interrupt table and then exited back to DOS prompt. And this gave you mouse support for other programs.

Wikipedia has some details, if you are interested: https://en.wikipedia.org/wiki/Terminate-and-stay-resident_pr...

fragmede 12 hours ago

Pictures are worth a thousand words, and oh man those diagrams. I could have used them back then!

1970-01-01 13 hours ago

WINSTART.BAT is just "AUTOEXEC.BAT for Windows"

The extra diagrams to state how it all works were extra.

layer8 11 hours ago

It’s not obvious that what WINSTART.BAT loads wouldn’t be available in DOS prompts started from Windows.

1970-01-01 10 hours ago

I suppose it isn't if you never had it on real hardware. Win32 was well marked as the complete OS takeover for the PC. DOS remained only to boot Windows and as backup OS. If you absolutely needed to jump back to DOS you still could, however you were heavily expected to force your DOS programs to launch and live in their own little DOS environments, much to everyone's chagrin.

aleph_minus_one 33 minutes ago

yellowapple 6 hours ago