MS-DOS 1.1, 2.0 Source Code Released

In cooperation with the excellent Computer History Museum in Mountain View, Microsoft released the source code to MS-DOS 1.1, MS-DOS 2.0, and Microsoft Word for Windows 1.1a.

Here’s hoping that this is a sign of things to come and Microsoft will also release the source code to historic versions of Windows 1.x, 2.x and 3.x, further versions of MS-DOS—and maybe even OS/2 1.0!

The poor CHM server is currently suffering from a severe overload so actually looking at the goodies will have to wait…

Later: Yes, it’s the real thing. There’s the MS-DOS source code, and even more—someone left in a few WordStar overlay files. Somehow I doubt Microsoft is legally allowed to redistribute files with “COPYRIGHT (C) 1982, MICROPRO INTERNATIONAL” in them… oh well.

The DOS 1.1 source code seems to be a somewhat random collection of files saved by Tim Paterson, as used by SCP.

The 2.0 source code appears to have been taken from a MS-DOS 2.0 OAK… which means no useful IO.SYS source code. On the other hand, there is a smattering of documentation.

All in all, fun stuff!

This entry was posted in DOS, Microsoft, PC history. Bookmark the permalink.

53 Responses to MS-DOS 1.1, 2.0 Source Code Released

  1. me says:

    According to wikipedia, micropro’s ip is owned by houghton mifflin harcourt. Seems probable that microsoft would have gotten permission to release that.

  2. Joshua Rodd says:

    Chances are, the original source code is lost to Microsoft.

    IBM probably still has it.

  3. Yuhong Bao says:

    Yea, wasn’t PC-DOS 1.10 actually MS-DOS 1.25?

  4. Michal Necasek says:

    Actually the WordStar fragments appear to be entirely irrelevant. Just files that happened to be mixed in.

  5. Michal Necasek says:

    Other people may have significant chunks of MS-DOS source code in the form of OAKs etc. And they might stop doing crazy things like deleting them: http://loopcx.blogspot.de/2012/07/360kb-floppies-still-readable-30-years.html

    My bet is that there are one or two ex-Microsoft guys who have something stashed away. Just like Tim Paterson did.

  6. Michal Necasek says:

    According to Tim Paterson’s e-mail included in the archive, “IBM’s DOS 1.1 corresponds to MS-DOS 1.24”. The released source code is for MS-DOS 1.25.

  7. Yuhong Bao says:

    Going to IBM would be a better idea though and would also get the FDISK source code etc…

  8. me says:

    Actually the WordStar fragments appear to be entirely irrelevant. Just files that happened to be mixed in.

    Ah, I didn’t read closely and assumed that those files were file format converters from winword.

  9. dosfan says:

    Note the “DOS 2.0” code is actually MS-DOS 2.11

    Everything is in one directory which certainly isn’t true of later versions of DOS.

    There are no makefiles in the zip though there is a DOSLINK file which gives the order for building MSDOS.SYS and a COMLINK which gives the order for building COMMAND.COM. Perhaps MAKE didn’t exist this far back.

    A couple of files are from IO.SYS are there: SKELIO.ASM (for a specific system) and SYSINIT.ASM

  10. Raijinzrael says:

    @Michal Necasek:

    “Other people may have significant chunks of MS-DOS source code in the form of OAKs etc. And they might stop doing crazy things like deleting them: http://loopcx.blogspot.de/2012/07/360kb-floppies-still-readable-30-years.html

    If the guy and the code is still under NDA, why the fuck did he an entry abut the floppies in his blog? The guy from that blog isn’t stupid, he just has a brain disease.

    Sorry, but i just can’t contain my disappointment, not that bit of story got lost forever.

  11. Michal Necasek says:

    I’d choose kinder words, but I certainly consider destroying historic source code similar to destroying historic works of art. It’s barbaric.

  12. Michal Necasek says:

    Interesting question about MAKE. I’m fairly certain it wasn’t available on the PC back then, or at least not from Microsoft (the make utility on Unix of course existed already). I believe it’s something Microsoft brought over from XENIX, but the question is when.

    In MASM 3.0, there was a “NEW Program Maintenance Utility”. MAKE.EXE was dated August 13, 1984.

    I can say with certainty that the MS-DOS 3.21 OAK from April 1987 did not use makefiles, just random BUILD.BAT batch files. That makes it extremely unlikely that MAKE would have been used for any of the earlier releases.

  13. dosfan says:

    Has anyone tried to build the DOS 2.11 MSDOS.SYS or COMMAND.COM ? I tried with MASM 5.1, 6.00B and JWasm and none of those would accept the old macros used (even with the /Zm switch on 6.00 or JWasm). I also tried the very old MASM 1.1 included in the distribution and that gives an Out of Memory error for the larger files even though I have 631.4K free (running PC DOS 7 in real mode). I also tried allocating huge blocks of memory to reduce free memory in case it got confused by an unexpected amount of free memory and that didn’t help either.

  14. Rich Shealer says:

    @Raijinzrael
    I was really interested in the GW-BASIC OEM kit he mentions as being on those old floppy disks. I have been unable to find any other references to it. Having worked with Canon’s* OEM PC’s in the eighties I was interested in how they adapted GW-BASIC on their non-IBM PC compatible MS-DOS computer. Although I spent more time in their proprietary BASIC on the CPM/86 side.

    * Same as the camera, lens, copier, printer, microelectronics, calculator, typewriter, etc. company.

  15. dosfan says:

    Update: MASM 4.0 works but you have to do some renaming:
    DOSMAC.ASM -> DOSMAC.OLD
    DOSMAC_v211.ASM -> DOSMAC.ASM
    DOSSYM.ASM -> DOSSYM.OLD
    DOSSYM_v211.ASM -> DOSSYM.ASM

    Obviously these aren’t the original filenames as long filenames didn’t exist until Win95 ! Also there seem to be intentional errors introduced to prevent building and of course there is no build BAT files.

    * TDATA.ASM has a bogus 8Ah characters at the start of a few lines.
    * MSCODE.ASM has an extra “>” on line 486.
    * MISC.ASM line 432: ISSPEC should be devid_SPECIAL (INT 29h CON flag)
    * STDIO.ASM includes IO.ASM which is missing and that file contains the code for INT 21h functions 01h-0Ch

    Damn it Microsoft !

  16. Michal Necasek says:

    MASM 3.0 works for me. I was able to produce COMMAND.EXE but haven’t tried it. Seems to need the DOSSYM_v211.ASM include.

    I’ve not been able to build MSDOS.SYS since STDIO.ASM wants IO.ASM which is nowhere to be found. There’s STRIN.ASM which appears to be part of it, but many of the CP/M console I/O calls are missing AFAICS.

  17. Michal Necasek says:

    Interestingly, COMMAND.COM identifies itself as “TeleVideo Personal Computer DOS Vers. 2.11” which makes me wonder where the files really came from.

  18. dosfan says:

    You didn’t get the build errors which I got ? Perhaps MASM 4.0 is too new.

    TDATA.ASM does have an IF IBMVER block which has the string “TeleVideo Personal Computer DOS Version ” and an MSVER block which has “MS-DOS Version ” though I would expect the IBM string to say “The IBM Personal Computer DOS Version “.

    Perhaps they made this change for 2.11 since IBM didn’t want that version as they didn’t care about internationalization at the time.

    Anyway the DOS character I/O function code and the IO.SYS device driver code are missing so this distribution is incomplete.

  19. Michal Necasek says:

    MASM 3.0 complained but the errors weren’t fatal. I’d guess the thing was actually built with MASM 2.something (3.0 is ’84).

    The TeleVideo string makes me wonder if the files came from an OAK shipped to TeleVideo and modified by them. I’d think Microsoft would not be making such changes locally, but who knows.

    I’m not sure IO.SYS is “missing” since the OEM was supposed to supply it (and there’s the “skeltal” implementation). Perhaps IBM maintained their IBMBIO.COM internally? But MSDOS.SYS is definitely incomplete, and that’s a problem.

  20. dosfan says:

    Did you try to assemble MISC.ASM ? The symbol ISSPEC is nowhere to be found but DEVID_SPECIAL is and that seems intentional though pointless since without the character I/O code you definitely can’t build MSDOS.SYS.

    It’s hard to imagine that Microsoft didn’t have the base device driver code for the PC as that was the primary platform and they almost certainly tested everything there first.

  21. Michal Necasek says:

    I don’t think it’s intentional… but it’s evidence that the files are mismatched. In MS-DOS 3.21 OAK, there’s ‘ISSPEC EQU 0010H ; Bit 4- This device is special’ line in DEVSYM.INC. The same flag is called ISIBM in the released source.

    I’m sure Microsoft did have the IBMBIO.COM source, but did they own it and can they release it? And more importantly, do they still have it? The released files could have easily come from someone outside Microsoft, because it’s what was distributed to OEMs.

  22. dosfan says:

    You’re probably right, the date of most of the files is August to October 1983 while DEVSYM.ASM is from October 1982. They probably needed to pickup the 2.11 file like they did with DOSMAC.ASM and DOSSYM.ASM. Anyway they definitely need to supply the missing IO.ASM file to complete MSDOS.SYS.

    They certainly own the later IO.SYS files (MSBIO1, MSBIO2, MSCHAR, MSDISK, etc.) though I would be really surprised if they release the source code for any later versions of DOS. MS releasing any version of Windows is almost certainly not going to happen, particularly 3.x which would expose the AARD code and other badness.

  23. OperDoper says:

    There used to be some torrent containing (a part of the) Windows NT4 and Windows 2000 source. Vetusware has DOS 6.o with sources – it’s the most popular download in OS section:)

  24. usotsuki says:

    I got command.com to roll without issue using the above advice re renaming and stray characters, masm 3 against each file in “comlink”, and from Borland C 3.1, “tlink /t @comlink”. Using MS’s provided masm, link and exe2bin didn’t work right for some reason, but there you have it.

  25. usotsuki says:

    By the way, command.com builds with the Arrowsoft assembler too – which I suppose makes sense, since that’s a MASM 3.0 clone. Also the Turbo C++ 1.01 linker is sufficient.

  26. Raúl Gutiérrez Sanz says:

    I don’t think the guy is going to destroy the diskettes. Probably he started to receive messages asking for a copy and he just wanted to stop it. For sure he would like to test if they survive 35 years, 40 years…

  27. Michal Necasek says:

    Illegally leaked and distributed source code is unfortunately not very helpful for serious and/or academic research.

  28. Raijinzrael says:

    @Raúl Gutiérrez Sanz:

    In any case, why say to world that you have such importat piece of history, but then say that you will not share it with the world? Is like if you come to the world showing that you have the cure for cancer, with proof and all the shit, but then you say “But i’ll keep it for me and only for me, you guys can keep dying forever fools”.

    If really NDA still applies to him, better that he wouldn’t say any word about those disks, period.

  29. usotsuki says:

    I’ve successfully got all the userland commands to roll using Arrowsoft and TLINK, though I haven’t tested them thoroughly.

    This just leaves trying to get something usable out of the msdos.sys sources, and perhaps to fill in any other gaps in the source. I have a 2.11 msdos.sys somewhere since I had a Tandy HX with a DOS 2.11 boot disk and make sure to keep those things as much as I can – maybe such a thing could reveal what we’re missing.

  30. dosfan says:

    Does anyone have contact info for Len Shustek at the Computer History Museum ? I looked all over their website and couldn’t find any contact info for individual people there. It would be simpler to just inform him of the omissions and ask if Microsoft could provide the missing files.

    IO.SYS:
    PC device driver code is missing. The stuff (HRDDRV.ASM and SKELIO.ASM) for the Altos ACS-86C isn’t useful.
    Note the SYSINIT code (SYSINIT.ASM and SYSIMES.ASM) which processes CONFIG.SYS is present.

    MSDOS.SYS:
    IO.ASM is missing (included by STDIO.ASM for the character I/O functions)
    DEVSYM.ASM from 2.11 is needed (#define ISSPEC 10h)

    Everything else seems complete and builds.

  31. Richard Wells says:

    I imagine it would be possible to leave a comment at the CHM blog to inform them about such issues. But if the small parts of source wanted are owned by someone other than MS, the wait could be quite long. IBM XT specific material was most likely written and copyrighted by our three letter friend.

  32. dosfan says:

    I suppose it’s possible that IBM owns the PC-specific IBMBIO code which existed prior to the JDA with Microsoft. This is likely why the source code for stuff like COMP and FDISK aren’t present. Microsoft definitely owns all of the DOS kernel code (IBMDOS.COM/MSDOS.SYS). I’m pretty sure by DOS 3.2 Microsoft owned that IBMBIO.COM/IO.SYS code as well since the source code for that was part of the DOS OEM Adapation Kit (OAK).

  33. Michal Necasek says:

    I think getting in touch with the CHM is worth a shot. Anyone trying?

    The PC specific IO.SYS may be a problem for DOS 2.x. It’s quite conceivable Microsoft didn’t own it. On the other hand, they must have owned all the MSDOS.SYS bits. The real issue seems to be that the files are clearly part of some kind of DOS 2.x OAK, even though it wasn’t called OAK back then (see v20object\README.DOC), but it’s not the complete package.

    And as dosfan says, Microsoft definitely owned IO.SYS for the later versions, since it was distributed starting (probably) with the MS-DOS 3.2 OAK. (Just to recap, DOS 3.2 was when Microsoft started selling their “packaged product” MS-DOS, more or less equivalent to PC DOS. The earlier versions needed a lot more effort on the OEMs’ part.)

  34. dosfan says:

    I would contact them if I knew who to contact. They have a contact page at http://www.computerhistory.org/contact/ but none of the email topics listed seem appropriate for this. They don’t have direct contact info for people who work there.

    I’m also curious as to whether Microsoft would even consider releasing the source code to DOS 3.21 ? After that things get complicated at DOS 3.3 and 4.0 were done by IBM (and DOS 3.31 was done by Compaq) though development reverted back to Microsoft with DOS 5.0 and after that PC DOS and MS-DOS were developed separately (though MS-DOS 6.0 and PC DOS 6.1 are based upon the same codebase).

  35. usotsuki says:

    Something’s making SORT not work with “Insufficient memory” but afaict anything else I rolled appears to work fine. Kinda funny using MS code built in non-MS tools. xD

    Haven’t tried the obvious solution of “build it with masm, link it with the DOS linker” yet.

    As I cut my MS-DOS teeth on PC DOS 3.20, getting code for 3.2x would be about the bee’s knees, but it might be too new, or it might already be entangled with the Blue Behemoth (I suspect that there was a small Grand Reunification sometime in the 3.1 dev cycle, and we know there was a much bigger one in 3.2; as you’ve no doubt noticed there’s a lot less difference between MS-DOS 3.2 and PC DOS 3.2, than previous versions, and it’s pretty much “Microsoft has FC, RAMDRIVE and GWBASIC; IBM has COMP, VDISK and BASIC(A)”.)

  36. dosfan says:

    usotsuki,

    You probably need to change the MAXALLOC field in the EXE header from FFFF to 0001. EXEHDR or EXEMOD will do this.

    There are minor differences between PC DOS 3.2 and MS-DOS 3.2 because IBM wanted certain things. As of DOS 5.0 these differences were eliminated since by that time (1991) pretty much all PCs were fully IBM compatible. Also as a result of the JDA between MS and IBM, MS got all of the IBM utilities and with 5.0, PC DOS and MS-DOS had the same files (differing only in copyright text and of course the filenames IBMBIO.COM/IBMDOS.COM instead of IO.SYS/MSDOS.SYS). VDISK.SYS was eliminated in favor of RAMDRIVE.SYS as RAMDRIVE could use XMS whereas VDISK used INT 15h function 87h to access extended memory.

  37. Michal Necasek says:

    FYI, in MS-DOS 3.21, after linking SORT the following is run: exemod sort.exe /max 1 /min 1

  38. Michal Necasek says:

    So I checked my MS-DOS 3.21 OAK… and the IO.SYS is very interesting. It’s all written by Microsoft (the usual suspects like Aaron Reynolds or Mark Zbikowski) and the revision history goes back to at least May 1983, clearly the DOS 2.x days. The copyright message which is not usually printed is “Copyright 1981,82 Microsoft Corp.”

    There’s no sign of an IBM copyright and Microsoft clearly had enough rights to distribute the source code to OEMs back in the day. Hmm.

  39. usotsuki says:

    Thanks. Good thing I had exemod lying around, as now SORT works. Which means everything in that package but the kernel rolls and seems to function.

  40. usotsuki says:

    My build of FORMAT goes absolutely wacky, but then, it’s not really much use without being customized to begin with.

    I wish I had these level of results from the 1.25 sources.

  41. JoeSnow says:

    “Michal Necasek says:
    March 26, 2014 at 12:07 pm
    I’d choose kinder words, but I certainly consider destroying historic source code similar to destroying historic works of art. It’s barbaric.”

    Exactly what business is it of yours what someone does with their own property? And who are you to decide that something should preserved?

  42. Michal Necasek says:

    If you’re trying to police what others say about other people’s words and actions, good luck with that… but just two points:

    One, if the person in possession of the historic DOS OAK considered it their property, they would not have worried about a NDA. So that rather invalidates your point.

    Two, if the owner of the Mona Lisa painting decided to destroy it, they would have the legal right to do it and I certainly wouldn’t get to decide whether they can do it or not. But I could still call it barbaric, and neither you nor they would get to decide whether I say that or not. Is that too hard to accept?

  43. dosfan says:

    Most of the 1.1 source code will not assemble because there are no segments declared, presumably because the code is so old it predates the use of assembler segment directives. MSDOS.ASM will build if you use MASM STDDOS.ASM; (STDDOS.ASM defines some symbols and includes MSDOS.ASM) and COMMAND.ASM also builds.

  44. Michal Necasek says:

    Great article! Very interesting to see historic source code subjected to modern analysis.

    However, I have to correct one error. The ANSI C standard did exist at the time (1991). It was officially published in 1989 after being in the works for a number of years, and Microsoft was in fact one of the early adopters, incorporating most ANSI C features in Microsoft C 5.0 (1987).

    That said, yes, MS Word 1.1 uses pre-standard K&R style, possibly to keep the code portable to the Mac, or possibly out of inertia.

    As for the undefined behavior, it would be fair to add that although it’s extremely poor style, it’s technically not a “bug” because the compiler(s) they used did have known and deterministic behavior.

  45. Yuhong Bao says:

    Or because ANSI C was new (remember 1.0 was released in late 1989).

  46. Michal Necasek says:

    There’s no “ANSI C 1.0”, at least not if you talk to anyone who knows anything about it. There’s C89.

    And again, even though the standard was officially released in 1989, drafts had been available for years and had not changed significantly in the last 2-3 years before publication.

    Microsoft’s OS/2 Presentation Manager SDK included ANSI C header files (using ANSI C function prototypes, not K&R style) in 1987, hence a pure K&R compiler simply wouldn’t work. The Windows SDKs were admittedly a bit behind.

    Here’s a quote from a Microsoft C 5.0 manual from May 1987: “Microsoft Corporation is actively involved in the development of the ANSI (American National Standards Institute) standard for the C language; this version of Microsoft C attempts to anticipate and conform to the forthcoming standard.”

    Even Microsoft C 4.0 (1986) “increased support for the developing ANSI standard”, although that version was too old to be truly close to C89.

    At any rate, ANSI C was anything but new in 1991, and Microsoft’s own compilers were one of the early adopters. Nothing like Microsoft’s C compilers and C99 🙂

  47. Yuhong Bao says:

    I mean Word for Windows 1.0 was released in late 1989.

  48. Dhruv says:

    Please post the MS-DOS 1.0 Source code….

  49. Michal Necasek says:

    Why? Is it no longer available from the CHM?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.