Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Updated MS-DOS source code blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpar committed Aug 18, 2019
1 parent 49f07c7 commit 9b59eac
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 58 deletions.
85 changes: 43 additions & 42 deletions _posts/2018-11-21-building-ms-dos-2x-source-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The [PCjs Disk Library](/disks/pcx86/) now includes a snapshot of the [MS-DOS 1.
from Microsoft's [September 28, 2018 re-release](https://blogs.msdn.microsoft.com/commandline/2018/09/28/re-open-sourcing-ms-dos-1-25-and-2-0/)
of MS-DOS source files on [GitHub](https://github.com/microsoft/ms-dos), along with a
[pre-configured machine](/disks/pcx86/dos/microsoft/2.00/#ms-dos-source-build-machine) ready to build the MS-DOS 2.x sources.
A similar machine (without the PCjs debugger) is provided [below](https://www.pcjs.org/blog/2018/11/21/#ms-dos-source-build-machine).
A similar machine is provided [below](/blog/2018/11/21/#ms-dos-source-build-machine).

Attempting to build the sources raises several questions, including:

Expand All @@ -36,18 +36,20 @@ you'd get the impression that one of those questions had already been answered:

Not so fast.

For reasons unknown, the Computer History Museum decided not to share the precise contents of the diskettes in
its possession. Instead, they released a ZIP archive that aggregated the contents of the MS-DOS 2.x diskettes into
two folders, `v20object` and `v20source`, with no clear indication which files came from which disk, why some files
were renamed (and what the original names were), and what (if anything) was omitted.
For reasons unknown, the Computer History Museum decided not to share the precise contents of the diskettes in its possession.
Instead, they released a ZIP archive that aggregated the contents of the MS-DOS 2.00 diskettes (pictured above) into two
folders, `v20object` and `v20source`, with no clear indication which files came from which disk, why some files were renamed,
what the original file names and timestamps were, and what (if anything) was omitted.

And it isn't entirely correct to describe those files as the source code for "MS-DOS 2.00". The 2.00 files from the
OEM diskettes pictured above are primarily *binary* files, not source code. The rest of the source files are actually
from a much later snapshot of source code, used to build MS-DOS 2.11, so at best, the collection should be referred to as
"MS-DOS 2.x".

To add to the confusion, some [WordStar 3.20](/disks/pcx86/apps/other/wordstar/3.20/) binary files were included in the
`v20source` folder, completely unrelated to MS-DOS--and also completely useless, since the main executable, `WS.COM`, was not
included.

Finally, it isn't entirely correct to describe these files as the source code for "MS-DOS 2.0". It's actually a much later
snapshot of source code, used to build MS-DOS 2.11, so at best, the collection should be referred to as "MS-DOS 2.x".

And Microsoft's re-release on [GitHub](https://github.com/microsoft/ms-dos) changed nothing and clarified nothing -- except
that all the files can now be used according to a more relaxed [MIT License](https://en.wikipedia.org/wiki/MIT_License).

Expand All @@ -57,7 +59,7 @@ code contains the string "Ver 2.10"? Were these sources modified *after* work o

On the other hand, an inspection of CHKDSK.COM in the [COMPAQ MS-DOS 2.11](/disks/pcx86/dos/compaq/2.11/) distribution ALSO
shows the string "Ver 2.30", and in fact, the CHKDSK.COM from COMPAQ MS-DOS 2.11 matches the
[CHKDSK.COM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/built/CHKDSK)
[CHKDSK.COM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/built/CHKDSK)
built from the MS-DOS 2.x sources *perfectly*.

Go figure.
Expand Down Expand Up @@ -119,39 +121,36 @@ something built, and since MASM 4.00 included some other handy tools, like MAKE.

As I explained on the [Microsoft MS-DOS 2.00](/disks/pcx86/dos/microsoft/2.00/) page, I decided to organize all
the source files into folders that corresponded to their respective binaries, along with makefiles where appropriate
(eg, [MSDOS.MAK](https://github.com/jeffpar/pcjs-demo-disks/blob/master/pcx86/dos/microsoft/2.00/src/MSDOS/MSDOS.MAK)).
Also, in the [INC](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/INC) folder,
(eg, [MSDOS.MAK](https://github.com/jeffpar/pcjs-demo-disks/blob/master/pcx86/dos/microsoft/2.11/src/MSDOS/MSDOS.MAK)).
Also, in the [INC](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/INC) folder,
`DOSMAC.211` was copied to `DOSMAC.ASM`, and `DOSSYM.211` was copied to `DOSSYM.ASM`, since the rest of the sources
are for MS-DOS 2.11 as well.

- [CHKDSK](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/CHKDSK)
- [COMMAND](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/COMMAND)
- [DEBUG](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/DEBUG)
- [DISKCOPY](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/DISKCOPY)
- [DOCS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/DOCS)
- [DRIVERS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/DRIVERS)
- [EDLIN](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/EDLIN)
- [EXE2BIN](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/EXE2BIN)
- [FC](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/FC)
- [FIND](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/FIND)
- [FORMAT](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/FORMAT)
- [INC](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/INC)
- [IO](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/IO)
- [MORE](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/MORE)
- [MSDOS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/MSDOS)
- [PRINT](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/PRINT)
- [PROFIL](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/PROFIL)
- [RECOVER](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/RECOVER)
- [SORT](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/SORT)
- [SYS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/SYS)

Then the [MSDOS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/MSDOS)
- [CHKDSK](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/CHKDSK)
- [COMMAND](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/COMMAND)
- [DEBUG](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/DEBUG)
- [DISKCOPY](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/DISKCOPY)
- [EDLIN](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/EDLIN)
- [EXE2BIN](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/EXE2BIN)
- [FC](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/FC)
- [FIND](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/FIND)
- [FORMAT](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/FORMAT)
- [INC](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/INC)
- [IO](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/IO)
- [MORE](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/MORE)
- [MSDOS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/MSDOS)
- [PRINT](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/PRINT)
- [RECOVER](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/RECOVER)
- [SORT](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/SORT)
- [SYS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/SYS)

Then the [MSDOS](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/MSDOS)
folder was supplemented with reconstructed
[IO.ASM](https://demo-disks.pcjs.org/pcx86/dos/microsoft/2.00/src/MSDOS/IO.ASM) and
[IO2.ASM](https://demo-disks.pcjs.org/pcx86/dos/microsoft/2.00/src/MSDOS/IO2.ASM) files from
[IO.ASM](https://demo-disks.pcjs.org/pcx86/dos/microsoft/2.11/src/MSDOS/IO.ASM) and
[IO2.ASM](https://demo-disks.pcjs.org/pcx86/dos/microsoft/2.11/src/MSDOS/IO2.ASM) files from
[John Elliott](http://www.seasip.info/DOS/).

The resulting files, along with a [MK.BAT](https://github.com/jeffpar/pcjs-demo-disks/blob/master/pcx86/dos/microsoft/2.00/src/MK.BAT)
The resulting files, along with a [MK.BAT](https://github.com/jeffpar/pcjs-demo-disks/blob/master/pcx86/dos/microsoft/2.11/src/MK.BAT)
batch file, were installed in the machine below on drive D. Drive C contains a bootable copy of PC DOS 2.00, along with
Microsoft MASM 4.00 and other assorted tools.

Expand All @@ -162,7 +161,7 @@ folder; to build all the folders, use `MK ALL`.
folder with symbols **OEMIBM** and **VER200** defined. Over time, I would like to use those symbols to
tweak the generated code, in order to produce binaries that match a particular original release.

[DOSSYM.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/INC/DOSSYM.ASM) has been
[DOSSYM.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/INC/DOSSYM.ASM) has been
modified to check for "OEM" and "VER" symbols, and to display messages indicating the current build selection, alerting
you that the resulting binaries may differ from those produced by the original source code snapshot.

Expand All @@ -177,12 +176,12 @@ However, you will sometimes see these messages:
VERSION 2.00 selected

which means that another file, such as
[COMSW.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/COMMAND/COMSW.ASM) or
[STDSW.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/MSDOS/STDSW.ASM),
[COMSW.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/COMMAND/COMSW.ASM) or
[STDSW.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/MSDOS/STDSW.ASM),
defined **IBM** before including
[DOSSYM.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/INC/DOSSYM.ASM).
[DOSSYM.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/INC/DOSSYM.ASM).
And sometimes a file will set **IBM** itself, such as
[GETSET.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/src/MSDOS/GETSET.ASM).
[GETSET.ASM](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/src/MSDOS/GETSET.ASM).
The "pre-selected" messages help you catch any build discrepancies due to these oddities.

Other files have been modified as well, but only to eliminate extraneous characters (eg, multiple EOF characters)
Expand All @@ -197,9 +196,11 @@ or click the *Speed* button below until it's running at speed that you prefer (a

In addition, all the build products (**OBJ**, **EXE**, **COM**, **LST**, and **MAP** files) from a successful
`MK ALL` command have already been saved in the [pcjs-disks](https://github.com/jeffpar/pcjs-demo-disks) repository, in the
[/pcx86/dos/microsoft/2.00/built](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.00/built)
[/pcx86/dos/microsoft/2.11/built](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/built)
folder.

This machine is also available with the [PCjs Debugger](/disks/pcx86/dos/microsoft/2.00/debugger/).

{% include machine.html id="ibm5160" %}

*[@jeffpar](https://jeffpar.com)*
Expand Down
35 changes: 19 additions & 16 deletions disks/pcx86/dos/microsoft/2.00/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ machines:
B:
name: None
autoStart: true
autoType: $date\r$time\rD:\rMODE COM1:9600,N,8,1\r
autoType: $date\r$time\rD:\r
---

Microsoft MS-DOS 2.00
Expand All @@ -38,14 +38,15 @@ Instead, they released a ZIP archive that aggregated the contents of the MS-DOS
folders, `v20object` and `v20source`, with no clear indication which files came from which disk, why some files were renamed,
what the original file names and timestamps were, and what (if anything) was omitted.

And it isn't entirely correct to describe those files as the source code for "MS-DOS 2.00". The 2.00 files from the
OEM diskettes pictured above are primarily *binary* files, not source code. The rest of the source files are actually
from a much later snapshot of source code, used to build MS-DOS 2.11, so at best, the collection should be referred to as
"MS-DOS 2.x".

To add to the confusion, some [WordStar 3.20](/disks/pcx86/apps/other/wordstar/3.20/) binary files were included in the
`v20source` folder, completely unrelated to MS-DOS--and also completely useless, since the main executable, `WS.COM`, was not
included.

Finally, it isn't entirely correct to describe these files as the source code for "MS-DOS 2.0". Most of the files are actually
from a much later snapshot of source code, used to build MS-DOS 2.11, so at best, the collection should be referred to as
"MS-DOS 2.x".

### 2018 Update

On September 28, 2018, Microsoft [re-released](https://blogs.msdn.microsoft.com/commandline/2018/09/28/re-open-sourcing-ms-dos-1-25-and-2-0/)
Expand All @@ -60,9 +61,9 @@ by releasing it under an [MIT License](https://en.wikipedia.org/wiki/MIT_License

### 2019 Update

Earlier this year, a PCjs user emailed me a list of the contents of Microsoft's five MS-DOS 2.00 OEM distribution
disks (pictured above). Based on that limited information, I was able to recreate the 5 disks and add them to the PCjs Disk Library.
Directory listings are provided [below](#directory-of-ms-dos-200-oem-disk-1).
Earlier this year, a PCjs user emailed me a list of the contents of Microsoft's MS-DOS 2.00 OEM distribution disks.
Based on that information, I recreated the five disks pictured above and added them to the PCjs Disk Library. Directory
listings are provided [below](#directory-of-ms-dos-200-oem-disk-1).

Now that we know the contents of these disks, it's clear that the Computer History Museum made an even bigger mess than we
originally suspected. All the files on those five disks were copied to either `v20object` or `v20source` folders, which
Expand All @@ -72,8 +73,8 @@ folders as well.

They also duplicated all of the `.DOC` files as `.txt` files, and they appended `_v211` to a few 2.11 source files, presumably
to avoid file name collisions with the 2.00 files -- but why merge them at all? Or were the 2.11 files already renamed, and CHM
mistakenly assumed (or was misinformed) that everything in the second collection was also 2.00? Unless someone from CHM explains,
we can only guess.
mistakenly assumed (or was misinformed) that everything in the second collection was also from 2.00? Unless someone from CHM
explains, we can only guess.

Moreover, the process they used to create the copies altered many of the 2.00 files' timestamps. It seems likely that they
made some sort of intermediate disk image, transferred all the original files to that intermediate image, then mounted the
Expand All @@ -88,10 +89,10 @@ the *current* date is inside or outside of DST, which makes the alteration even
the world observe DST, even within the United States.

As I blogged back in 2017, Daylight Savings Time is a serious obstacle to accurate date and time preservation. And arbitrarily
renaming files with unexplained suffixes or new, more convenient file extensions doesn't help either.
renaming files with unexplained suffixes, or more convenient file extensions, doesn't help either.

I have attempted to correct all the timestamps on the five disks below. Whether the rest of the (2.11) files in CHM's original
archive suffer from similar timestamp alterations is hard to say without more information.
I have attempted to correct all the file names and timestamps on the five disks below. Whether the rest of the (2.11) files in
CHM's original archive suffer from similar timestamp alterations is hard to say without more information.

### Excerpt from README.DOC (Disk 1)

Expand Down Expand Up @@ -389,9 +390,9 @@ these sources? The MASM.EXE that was bundled with this snapshot is dated Feb 1,
The Microsoft MACRO Assembler
Version 1.10, Copyright (C) Microsoft Inc. 1981,82

However, it's rather buggy, so it almost certainly was *not* used. For that matter, it's unclear if this snapshot
of MS-DOS 2.11 represents a finished product or a work-in-progress. Sadly, no one at Microsoft seems interested in
finding or sharing the answers.
However, it's rather buggy, so it almost certainly was *not* used. In fact, we now know that this copy of MASM
was distributed on the 2.00 OEM diskettes, so there's no reason to assume it had anything to do with the 2.11 files.
More information on [The MASM Question](/blog/2018/11/21/#the-masm-question) is in the PCjs blog.

### MS-DOS Source Build Machine

Expand All @@ -405,6 +406,8 @@ In addition, all the build products (**OBJ**, **EXE**, **COM**, **LST**, and **M
[/pcx86/dos/microsoft/2.11/built](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/built)
folder.

This machine is also available with the [PCjs Debugger](/disks/pcx86/dos/microsoft/2.00/debugger/).

{% include machine.html id="ibm5160" %}

The results of running `MK ALL` on the 2.11 sources are shown below:
Expand Down
36 changes: 36 additions & 0 deletions disks/pcx86/dos/microsoft/2.00/debugger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: page
title: Microsoft MS-DOS 2.00 with Debugger
permalink: /disks/pcx86/dos/microsoft/2.00/debugger/
machines:
- id: ibm5160
type: pcx86
config: /devices/pcx86/machine/5160/cga/512kb/debugger/machine.xml
drives: '[{name:"PC-DOS 2.00 w/Tools (10Mb)",type:3,path:"/disks-demo/pcx86/drives/10mb/PCDOS200-C400.json"},{name:"MS-DOS 1.x/2.x Source (10Mb)",type:3,path:"/disks-demo/pcx86/dos/microsoft/2.00/MSDOS-SRC.json"}]'
autoMount:
A:
name: None
B:
name: None
autoStart: true
autoType: $date\r$time\rD:\rMODE COM1:9600,N,8,1\r
---

Microsoft MS-DOS 2.00 with Debugger
-----------------------------------

See [Microsoft MS-DOS 2.00](/disks/pcx86/dos/microsoft/2.00/) for more information about this release.

### MS-DOS Source Build Machine

A quick note about speed: the typical PC in the early 1980s was still a 4.77Mhz 8088-based machine, so it took
a considerable amount of time to assemble all the MS-DOS 2.x sources. If you're impatient, you can load the machine
on this page with a higher speed multiplier (eg, [multiplier=8](https://www.pcjs.org/disks/pcx86/dos/microsoft/2.00/debugger/?multiplier=8))
or click the *Speed* button below until it's running at speed that you prefer (and that your browser supports).

In addition, all the build products (**OBJ**, **EXE**, **COM**, **LST**, and **MAP** files) from a successful
`MK ALL` command have already been saved in the [pcjs-disks](https://github.com/jeffpar/pcjs-demo-disks) repository, in the
[/pcx86/dos/microsoft/2.11/built](https://github.com/jeffpar/pcjs-demo-disks/tree/master/pcx86/dos/microsoft/2.11/built)
folder.

{% include machine.html id="ibm5160" %}

0 comments on commit 9b59eac

Please sign in to comment.