Hacker News new | ask | show | jobs
by yjftsjthsd-h 2218 days ago
So how were these found? Today I guess I'd try running strings on the executable or maybe straight-up opening them in a debugger or disassembler (I assume command-line argument parsing is a very obvious, easy-ish to read block of code right at the start of the program), but I'm not sure how much of that was available (or at widely accessible, at least) back when DOS was a big deal (this list talks about DOS 2.x, which is 1983).
7 comments

debug.com shipped with the original MS-DOS and every subsequent version, so you automatically had a facility to disassemble and/or manipulate any running application essentially. We have easier tools now, but the tools available then were basically on every machine.
> Today I guess I'd try running strings on the executable or maybe straight-up opening them in a debugger or disassembler

Why today? I spent a fair amount of time during my childhood reading through "command.com" in a binary editor (zap-it), mostly for changing error messages to impress girls. It didn't really work, but I learned quite a lot in the process.

I remember using strings in the early 90s on DOS boxen, no recollection of where I got it from though, maybe a coverdisk, I could have implemented it myself, it's relatively trivial.

It's also worth remembering that DOS came with DEBUG, so if you had the time and patience you could dig about in anything

When DOS was a big deal, it was both a big enough deal and a small enough program to be fully dissected, disassembled, studied, documented, patched, outright reimplemented, etc. It's probably harder to find some technical detail about DOS that outsiders didn't figure out.
DOS is small relative to modern OSs, but don't let the binary size (few dozen KB) of the kernel fool you --- being written in Asm, it is very dense code, basically no bytes wasted. There's probably more dead code in a "Hello World" binary compiled with a modern language than there is live code in the DOS kernel.
Sure but it's still tiny. If every single byte of it were a full line in a high level language it would still be still a tiny, fully externally-analyzable program. I don't need to make that kind of theoretical argument, though - the entire late stage of serious DOS software was completely dependent on DOS having been taken apart and understood, bit by individual bit.
> So how were these found?

Example usage for some of them could be discovered by going through the contents of .BAT files written by Microsoft, especially those that were a part of MS-DOS (and later Windows 9x) Setup (installer).

All the built-in commands appeared in plain text in COMMAND.COM, as did all the CONFIG.SYS parameters in IO.SYS. As far as I know there wasn't a UN*X-like strings(1) utility at the time but binary files could still be browsed with third-party tools.

DOS wasn't a very big program. Anyone with some time on their hands could go through the assembly dumps. And there were a lot of curious people with time on their hands.
Debug command.com