top | item 7466952

Microsoft makes source code for MS-DOS and Word for Windows available to public

756 points| hornokplease | 12 years ago |blogs.technet.com | reply

204 comments

order
[+] mato|12 years ago|reply
This tidbit from the DOS 2.0 README.txt (section 5) is fascinating:

  The user manual contains some significant errors. Most of these are
  due to last minute changes to achieve a greater degree of compatibility
  with IBM's implementation of MS-DOS (PC DOS). This includes the use
  of "\" instead of "/" as the path separator, and "/" instead of "-"
  as the switch character. For transporting of batch files across
  machines, Microsoft encourages the use of "\" and "/" respectively
  in the U.S. market. (See DOSPATCH.TXT for how you can overide this.
  The user guide explains how the end-user can override this in CONFIG.SYS).
Also this, from the documentation for the CharOper system call (that never made it outside of MSFT?) in SYSCALL.txt:

        AL Function
        -- --------
         0 DL, on return, will contain the DOS switch
            character. On most systems this will default to
            '-'.
         1 Set the switch character to the character in DL.
         2 Read the device availability byte into DL. If
            this byte is 0, then devices must be accessed in
            file I/O calls by /dev/device. If this byte is
            non-zero, then the devices are available at every
            node of the directory tree (i.e. CON is the
            console device not the file CON). This byte is
            generally 0.
         3 Set the device availability byte to the value in
            DL.
It looks like we have IBM to blame for '\' and '/' as a path separator/switch character in DOS/Windows, Microsoft originally was using the Xenix '/' and '-' respectively. I knew that Microsoft used Xenix fairly heavily internally but never thought that DOS was quite so influenced by it.
[+] whoopdedo|12 years ago|reply
And to this day we're still barred from creating files or directories named CON, PRN, NUL ... Damn you, IBM
[+] quasque|12 years ago|reply
It's interesting to see the real specification for this system call, as only the device availability subfunctions were widely known outside of Microsoft [1].

I wonder if many other hidden or deprecated functions are present in these releases.

[1] http://www.delorie.com/djgpp/doc/rbinter/id/65/27.html

[+] spodek|12 years ago|reply
Under what license?

Can we view, modify, redistribute?

No one wants to get sued for these things, or being found to violate some end user license agreement with some other Microsoft software.

On the other hand, I'd love to find out that people viewing this code contribute an improvement that no one in Microsoft saw in decades that helps them improve something today, leading them to soften their stance on Free Software and copyright.

We can dream.

[+] bunderbunder|12 years ago|reply
> Under what license? Can we view, modify, redistribute?

Just speaking for myself, I come down pretty firmly in the "Don't know, don't care" camp for both questions.

In a world where FreeDOS exists, there just isn't any practical value to having the source code to MS-DOS 2.0 available under a truly open license. That code's only interesting as a historical exhibit. If all we can do is look at it and go, "Huh, so that's how that worked", that's fine with me.

[+] gnoway|12 years ago|reply
Microsoft Research License.

Yes, Yes, No.

[+] Tobu|12 years ago|reply
For novelty purposes only™

No redistribution and the license can be revoked.

(also: must be research or education, mustn't be commercial, and you are licensing derivative works to Microsoft somehow)

[+] Gepser|12 years ago|reply
->Under what license?

If you create Derivative Works, you grant to Microsoft a non-exclusive, perpetual, irrevocable, royalty-free, assignable, sublicenseable license to reproduce, distribute, publicly display, modify, use, make, have made, import, and sell such Derivative Works.

[+] elwell|12 years ago|reply
To me, this isn't about useful code, it's about a terrifying journey back in time.
[+] RyanZAG|12 years ago|reply
Not only are you not allowed to distribute it by the license, actually distributing it would get you sued for patent violation. Using anything you find in the code will probably get you sued for patent violation, too.

EDIT: I can just imagine a future lawsuit:

A: Did you read the MS-DOS source code released by Microsoft on XX? We have logs to show you downloaded it.

B: Yes, but that has nothing to do with this lawsuit!

A: Incorrect. The MS-DOS source code you viewed is under Patent ZZ. We believe you used the IP found in the MS-DOS source code to build your flying car.

Judge: Guilty!

[+] bovermyer|12 years ago|reply
I think a lot of people here are missing the point of this.

Microsoft didn't release the source code for these old versions of their software so people could use it, hack on it, and make new versions.

They released it because it's historically interesting.

As someone who is both a developer and a history graduate, I think it's fascinating.

[+] akira2501|12 years ago|reply
The fact that this was released to the "Computer History Museum" was apparently missed or not understood by the majority of the audience.
[+] ehPReth|12 years ago|reply
From ./Opus/asm/formatn.asm in Word v1.1a:

    ; /* Following comment is preserved verbatim for eternity */
    ; /* Rounding becomes a non-existant issue due to brilliant re-thinking */
    ; /* "What a piece of work is man
    ;	How noble in reason
    ;	In form and movement,
    ;	how abject and admirable..."

    ;		 Bill "Shake" Spear [describing Sand Word] */
[+] ChuckMcM|12 years ago|reply
Most if not all of what MS-DOS did has been re-created under FreeDOS. [1] Writing an equivalent to Word 1.1 is also pretty straight forward. So I'm not sure what the fuss is about with regards to licenses, it is a historical artifact, and fun to look at, but kind of useless as a code base to start from.

[1] http://www.freedos.org/

[+] selectodude|12 years ago|reply
I wonder if they deleted all the "fucks" out of it. The Win2K source code was good for a laugh.
[+] ehPReth|12 years ago|reply
Word v1.1a:

    $ grep -ri fuck .
    ./Opus/asm/wordgrep.asm:; BP  is used as always, the other registers are free to fuck with.
    ./Opus/asm/wordgrep.asm:	je	another_fucking_out_of_range_jump
    ./Opus/asm/wordgrep.asm:another_fucking_out_of_range_jump:
MS-DOS v1.1 & v2.0:

    $ grep -ri fuck .
[+] pera|12 years ago|reply

  ;FIND.ASM
  165 badfart proc    far             ;(what a hack!!)
  166         ret
  167 badfart endp
[+] unknown|12 years ago|reply

[deleted]

[+] NAFV_P|12 years ago|reply
May I ask how common is this uncouth behaviour? I do remember this [0] being posted a few months ago, apparently "penguin" is an expletive (what the fuck?).
[+] dalek2point3|12 years ago|reply
just in case someone from MS is reading -- is it also possible to put this code under the public domain or at least under a free license? I'm very worried about the fact that some of this old code, though useless to MS at this moment, will be lost for follow-on use by folks today.
[+] e1ven|12 years ago|reply
This is a cool historical artifact, and I'm glad MS released it.

I don't think there's much to gain in releasing it under a broader license - I would imagine that most programs that would need to expand or otherwise build upon this code would be better served by using one of the modern clones, such as http://en.wikipedia.org/wiki/FreeDOS

They have a modern toolchain, are actively in development, and seem like they would be much easier to add features to, if one found themselves with such a need.

[+] jw2013|12 years ago|reply
You may use, copy, compile, and create Derivative Works of the software, and run the software and Derivative Works on simulators or hardware solely for non-commercial research, experimentation, and educational purposes. Examples of non-commercial uses are teaching, academic research, public demonstrations, and personal experimentation. “Derivative Works” means modifications to the software, in source code or object code form, made by you pursuant to this agreement. You may copy and refer to any documentation provided as part of the software.

You may not distribute or publish the software or Derivative Works.

You may not use or test the software to provide a commercial service unless Microsoft permits you to do so under another agreement.

You may publish and present papers or articles on the results of your research, and while distribution of all or substantial portions of the software is not permitted, you may include in any such publication or presentation an excerpt of up to fifty (50) lines of code for illustration purposes.

[+] nsxwolf|12 years ago|reply
I'd rather start any project on a foundation of at least MS-DOS 5.0.
[+] steven_pack|12 years ago|reply
Fascinating. Now THIS is a museum.

There was obviously scope for personality in the commenting...

  arena_free_next:
    CMP     BYTE PTR DS:[DI],arena_signature_end
                                        ; end of road, Jack?    
    retz                            ; never come back no more
    CALL    arena_next              ; next item in ES/AX carry set if tras
And a nice reminder of the other big players of the day:

  IF      WANG                    ;Are we assembling for WANG?
[+] herokusaki|12 years ago|reply
Pretty cool. One question comes to mind, though: if I ever want to contribute to FreeDOS or LibreOffice should I refrain from reading this code?
[+] pera|12 years ago|reply
Nop: this is too old so it's pretty much obsolete now
[+] SixSigma|12 years ago|reply
From Word

    If dos_ver == "dr dos" then
       Print("error")
       Abort()
    End if
[+] bdg|12 years ago|reply
Not having an ability to view the source online was driving me insane. Hopefully I scratched your itch too.

https://github.com/Incognito/msdos

[+] habith|12 years ago|reply
Third bullet point in the license you presumably agreed to before downloading the source code:

- You may not distribute or publish the software or Derivative Works.

I'm not saying it's a good license, but if you do not agree with or at least intend to follow it then perhaps you should have not downloaded it to begin with.

[+] publicfig|12 years ago|reply
Just so you're aware, I'm not positive that this is allowed under the Microsoft Research License.
[+] Dorian-Marie|12 years ago|reply
I am waiting for people to send Pull Request on that (for \ vs / for instance)
[+] yuhong|12 years ago|reply
What is funny is that MS-DOS 6.0 source code had already been leaked. Granting permission to IBM to make OS/2 source code available would be nice too BTW.
[+] userbinator|12 years ago|reply
MS-DOS 6.0 and a customisation kit for 3.x were the leaks I remember seeing.

MS-DOS 2.x is not so interesting in comparison.

[+] Tloewald|12 years ago|reply
Maybe someone will produce a version of Word for Windows 1.1a that runs on a modern OS, and I'll be able to open and edit documents that have been impossible to open in later versions of Word (of course Word for Windows 2.0 would open the document, convert it to its new format in place, and then crash, so I'd need to find un-borked versions of the documents first).
[+] yuhong|12 years ago|reply
I don't believe Word for Windows actually writes to the file until you save it.
[+] bite|12 years ago|reply
Regardless of the license, I definitely like the direction Microsoft seems to be going in. First they make Microsoft office online free to the public, there's talk about windows mobile one day being free, and now this. All within a rather short amount of time. I don't see myself switching from GNU/Linux any time soon however, but I hope Microsoft will soon realize the potential of Open Source. One company I really appreciate is Adobe, they put a surprising amount of effort into Open Source, and also released Photoshop v1.0.1 source. On a side note; I wonder when Windows' will post their first project on Github.
[+] ciderpunx|12 years ago|reply
In the syscall docs under "C A V E A T P R O G R A M M E R"

  > Certain structures,  constants  and  system  calls  below 
  > are   private   to   the   DOS    and    are    extremely 
  > version-dependent.  They  may  change  at any time at the 
  > implementors' whim.
That pretty much summarises my experience of trying to work with Microsoft products. Arbitrary, undocumented API changes every time the version number changes "at the implementors' whim".