Why did Microsoft make DOSKEY
a separate command, instead of integrating it with COMMAND.COM
?
I don't think DOSKEY
uses a lot of RAM or was useless in the '80s... Maybe there was another reason not to enable this command automatically?
Retrocomputing Stack Exchange is a question and answer site for vintage-computer hobbyists interested in restoring, preserving, and using the classic computer and gaming systems of yesteryear. It only takes a minute to sign up.
Sign up to join this communityWhy did Microsoft make DOSKEY
a separate command, instead of integrating it with COMMAND.COM
?
I don't think DOSKEY
uses a lot of RAM or was useless in the '80s... Maybe there was another reason not to enable this command automatically?
I can think of a number of reasons:
DOSKEY
isn’t specifically tied to COMMAND.COM
; it provides history for any program which uses the same input functions as COMMAND.COM
, and one could imagine wanting to run DOSKEY
with another command interpreter (although the most popular alternative command interpreter, 4DOS, already included equivalent features);DOSKEY
was introduced late in MS-DOS’s life, in version 5 (1991); since it changed input handling (with its macro support in particular), the MS-DOS developers might have thought that some users wouldn’t want it, or that it could break things (backward compatibility was already very important for Microsoft by that time);The first reason is really sufficient from my point of view: input editing isn’t handled in COMMAND.COM
, so improving it in COMMAND.COM
wouldn’t have made much sense.
It turns out DOSKEY
’s developers forgot one important feature of the DOS input routine (it’s supposed to handle the date change at midnight), so making it optional turned out to have been a good idea!
(There were a number of history-providing TSRs already available then, but that wouldn’t have been a consideration for Microsoft.)
I wrote the DOSKEY that went into DOS5... I think it actually went into the win3.0 box too, but I can't find any evidence for that.
I was the new guy on the team, it was the first project they gave me before I started diving into cleaning up the existing code base. There was a program called DOSKEY that had source code published in one of the magazines. Microsoft wanted to include the functionality (possibly trying to match DR-DOS's added features) but didn't want to risk copyright issues by using the published code.
The published DOSKEY used fixed length 128 byte records in its command history, so it was extremely inefficient. I wrote code to use variable length records in a circular buffer, so it was much more efficient in terms of history size vs. memory usage.
The Macros were my idea if I recall correctly, as we were trying to figure out some "low-cost" feature to throw in. I actually used the macros quite a lot for a couple of years, including parameter substitution.
It was very well written and documented, as it was my "debut" to the DOS team, the first time they had seen my code. During my initial team meeting code review, DavidOls said it showed "a firm hand on the keyboard."
Why was it not integrated into COMMAND.COM? I think it was as others have suggested, to not force the memory usage on people who didn't want it. One of the big goals of the MS-DOS 5 project was reducing "Low 640k footprint". We added some kind of int2f hook to integrate it better into COMMAND.COM, I don't remember why now.
Well, first of all, isn't it best if an OS is configurable for each user the way he needs, instead of packing everything into one bloated package?
Long story short, having a configurable system to be tailored to each job needed is quite an advantage worth paying the price of a few bytes wasted for headers and duplicate code plus a few milliseconds during boot.
The early architecture of COMMAND.COM (based on detailed analysis of DOS 2.1 a long, long time ago) was that a program requesting maximum memory could overwrite all of COMMAND.COM except a tiny portion which would reload from disk on termination.
By the time DOS 5 was released, 1MB RAM was not uncommon, so this motivation had gone.
But Windows 3.0 was released before DOS 5 and Microsoft started pushing for everyone to run Windows all the time, rather than just loading Windows 2.1 runtime for Excel or Pagemaker.
Windows 3.0 loaded on top of DOS, and it was common to open a DOS box or run batch files within it. Any bloat in COMMAND.COM would be loaded multiple times.
So I suggest that integrating functionality to COMMAND.COM would have been an unwise architectural choice in those days.
COMMAND.COM
kept its split architecture, so that’s not really a factor. It’s been documented as such for a long time, in Microsoft’s documentation no less ;-). It was still useful with DOS 5 and later... Also, Windows’ DOS VM goes to great lengths to share memory as far as possible.
Apr 18, 2019 at 14:14