
Microsoft makes source code for MS-DOS and Word for Windows available to public - hornokplease
http://blogs.technet.com/b/microsoft_blog/archive/2014/03/25/microsoft-makes-source-code-for-ms-dos-and-word-for-windows-available-to-public.aspx
======
mato
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
And to this day we're still barred from creating files or directories named
CON, PRN, NUL ... Damn you, IBM

~~~
loevborg
Not just CON but also con.txt, con.js, etc.! Try cloning a git repository with
a file called con.js using msysgit. The result is that, when msysgit tries to
clone the file, the _contents_ of the file `con.js` are printed to stdout,
i.e. to CON.

------
spodek
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.

~~~
RyanZAG
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!

~~~
ct1
MS-DOS is maybe the ugliest operating system I ever had the displeasure of
using.

There's very little to learn from operating system design point of view in
there, and better sources are available under more permissive licenses -- ie
open source licenses.

It looks like a PR stunt to me.

~~~
Theodores
'Operating system' is stretching it. 'Disk Operating System' is one of those
phrases like 'ice creme' that implies 'ice cream'.

MS-DOS was a program that wrote stuff to disk for you, read the keyboard for
you, listened to interrupts for things and showed useful error messages such
as 'Retry, Fail or Abort?'.

There was no networking to speak of, certainly not TCP/IP as we know it, no
user permission things, you couldn't run cron jobs and the list goes on. All
of this normal stuff that an Operating System does was well established on
UNIX boxes, VAXes and, to a certain extent, on the BBC Micro.

~~~
userbinator
An OS doesn't _need_ to have networking, permissions, or anything else. It
just needs to provide a common set of services for applications programs to
use.

Consider that OSs started out as libraries of functions that programs could
call into, which then evolved into job managers, that is where MS-DOS fits.

It's single-tasking, single-address-space, but it already has the concept of
processes, drivers, files. This is still more than some embedded OSs which are
not much more than a threading library.

~~~
wtallis
Really though, wasn't most of DOS just thin abstractions on BIOS interfaces?
What hardware abstractions did it provide other than the filesystem, and what
services other than an ABI allowing you to quit a program without rebooting?

~~~
userbinator
[http://en.wikipedia.org/wiki/MS-DOS_API](http://en.wikipedia.org/wiki/MS-
DOS_API)

Given that it was a _disk_ operating system it's no surprise that the bulk of
the services are disk/filesystem-related, but it also has ones for I/O,
memory, timing, and processes.

------
bovermyer
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
The fact that this was released to the "Computer History Museum" was
apparently missed or not understood by the majority of the audience.

------
ehPReth
Direct(er) links:

* MS-DOS v1.1 and v2.0: [http://www.computerhistory.org/atchm/microsoft-research-lice...](http://www.computerhistory.org/atchm/microsoft-research-license-agreement-msdos-v1-1-v2-0/)

* Word v1.1a: [http://www.computerhistory.org/atchm/microsoft-research-lice...](http://www.computerhistory.org/atchm/microsoft-research-license-agreement-msword-v-1-1a/)

~~~
comboy
503, any mirror?

~~~
ehPReth
Here you go:

* [https://mega.co.nz/#F!jAhUzLCC!2i187wbXL7WUF3587YaMfw](https://mega.co.nz/#F!jAhUzLCC!2i187wbXL7WUF3587YaMfw)

* [http://www.sendspace.com/filegroup/61DF3FLY3Z3pnWTHQMzcRQ](http://www.sendspace.com/filegroup/61DF3FLY3Z3pnWTHQMzcRQ)

SHA-256:

    
    
        ed62a98801f15cf9b7f229e33c7413d1ff9d1e1e91e9aa2468742589b65e156d  msdos.zip
        b424c3c1c1d7083cc74c9b1b77823eb511739c4237cb7a2f1650b75391f43ff6  Word-1.1a-CHM-Distribution.zip

~~~
nolok
Those are not legal, redistribution is not permitted by the license.

~~~
username42
IS it really redistribution or network caching ;-)

------
ehPReth
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
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/](http://www.freedos.org/)

------
selectodude
I wonder if they deleted all the "fucks" out of it. The Win2K source code was
good for a laugh.

~~~
ehPReth
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 .

~~~
not_that_noob
MS-DOS would have been delivered to IBM as code, so they cleaned it up for the
suits. Word on the other hand...

------
dalek2point3
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
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](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.

~~~
dalek2point3
but, but -- you're assuming that what I want to do is build on DOS to do what
DOS did but better. What if I wanted to visualize the code in some interesting
way? What if I wanted to compare the first versions of Linux and DOS and
compare them for their modularity and do a research project on how they
affected productivity in firms? And these are only the use cases that I could
think of while finishing my cup of tea ...

~~~
e1ven
Fair enough, those sound like awesome projects. The difference between the MS
license and most OSS licenses is that this does not include redistribution.

I'm a proponent of OSS, and if MS wanted to release this under MIT that'd be
great.. But I have a hard time thinking of projects that are stopped by the
current license.

My guess is that creating a visualization would be a rather transformative use
of the work - Redistributing your resulting visualization would likely be
firmly in fair use territory.

Comparing the code for modularity is writing an essay. You don't need a
redistribution license for the code to do that.

In any event, I hope they do eventually release using an open license. But as
a fan of the history of our industry, I'm glad they released it at all.

------
lunchbox
Clarification: this is about MS Word 1.1a, which was released in 1990.

~~~
agumonkey
Other notable facts that year :
[https://en.wikipedia.org/wiki/Haskell_(programming_language)...](https://en.wikipedia.org/wiki/Haskell_\(programming_language\)#Haskell_1.0_to_1.4)

~~~
pekk
Literally everything on HN is an opportunity for another Haskell
advertisement.

~~~
agumonkey
I won't disagree, but I realized that even before I got a computer, Haskell
was officially born. It baffles me that this very advanced gem was already
there, yet so few knew.

[http://file.vintageadbrowser.com/l-veh5m82f5jultw.jpg](http://file.vintageadbrowser.com/l-veh5m82f5jultw.jpg)

~~~
roberto56
To this day still few know...

------
steven_pack
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
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
Nop: this is too old so it's pretty much obsolete now

~~~
ptx
But it will nevertheless be under copyright until long after we're all dead,
so if you read it Microsoft could presumably still decide to sue you for
copyright infringement if that ever happens to seem advantageous for them. I
think that's what the parent comment was asking about.

~~~
justin66
> But it will nevertheless be under copyright until long after we're all dead,
> so if you read it Microsoft could presumably still decide to sue you for
> copyright infringement if that ever happens to seem advantageous for them.

You'd have to actually, you know, infringe their copyrights.

It's hard to know if you're one of the many who are confused about copyright,
patent, and trademark but just reading the code doesn't put you on the hook
for anything.

~~~
ptx
Couldn't they pick any piece of code you write that happens to looks similar
to some piece of code in MS-DOS and argue that it is in fact derived from
their code, if it's known that you previously read the MS-DOS code?

Sort of like the "rangeCheck" portion of the Google v. Oracle case.

With patents it doesn't matter whether you read their code or not: you're
screwed in any case. But with copyright the history of the code matters, so it
could matter if you have seen their code before writings yours, I think.

~~~
justin66
> Couldn't they pick any piece of code you write that happens to looks similar
> to some piece of code in MS-DOS and argue that it is in fact derived from
> their code, if it's known that you previously read the MS-DOS code?

You write a lot of MASM code, such that this is actually a risk for you?

Maybe it's possible? I'm not a lawyer but I think at some point early in the
process, in order to move forward, they'd have to convince a judge that they'd
suffered damages as a result of your use of a few lines of their ancient MASM
code. I assume that's where the whole thing would be met with laughter unless,
of course, you've got some truly cunning thing you're going to do with DOS
assembly code and make a million.

All that is before anyone needs to even consider whether the code you borrowed
is trivial in nature such that it's protectable or not protectable via
copyright.

One of the lessons of the Google v. Oracle case: Oracle didn't actually win
anything in damages.

> With patents it doesn't matter whether you read their code or not: you're
> screwed in any case.

Okay, forget the rest and focus on this: you need to familiarize yourself with
the concepts of willful infringement and treble damages. Unlike the rest of
the stuff we're talking about, it actually matters and is not pure paranoia.

If you violate a patent - and realistically, all of us who write any software
are violating someone's patent - you'd better hope you can convince a court
that you did not do so knowingly. How do you do this? Make an effort not to
read any patents, ever. Plausible deniability.

Whether the code you've read is patented or not is actually trivia. Whether
you knew it was covered by a specific patent is important.

~~~
ptx
>> With patents it doesn't matter whether you read their code or not: you're
screwed in any case.

> Okay, forget the rest and focus on this: you need to familiarize yourself
> with the concepts of willful infringement and treble damages.

> [...]

> Whether the code you've read is patented or not is actually trivia. Whether
> you knew it was covered by a specific patent is important.

So we're in agreement then? :) Yes, good point about knowingly infringing a
patent, but, as I said (or meant to say), reading or not reading the _source
code_ has no effect on the patent situation. (But I'm not a lawyer either, so
what do I know.)

------
SixSigma
From Word

    
    
        If dos_ver == "dr dos" then
           Print("error")
           Abort()
        End if

------
bdg
Not having an ability to view the source online was driving me insane.
Hopefully I scratched your itch too.

[https://github.com/Incognito/msdos](https://github.com/Incognito/msdos)

~~~
habith
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.

~~~
bdg
I'm reasonably sure I violated 10 laws since I woke up.

------
DanBC
My "Future Computers MSDOS 2" manual finally has a use!

[http://imgur.com/ejnlHY1](http://imgur.com/ejnlHY1)

[http://imgur.com/7NzGGWO](http://imgur.com/7NzGGWO)

[http://imgur.com/ljOV7XJ](http://imgur.com/ljOV7XJ)

~~~
INTPenis
Manuals were just so awesome in those days. Here's my favorite from when I was
a kid.

[http://imgur.com/aTn6wVh,ry3LXlb](http://imgur.com/aTn6wVh,ry3LXlb)

------
pera
Download link: [http://www.computerhistory.org/atchm/microsoft-research-
lice...](http://www.computerhistory.org/atchm/microsoft-research-license-
agreement-msdos-v1-1-v2-0/)

------
yuhong
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.

~~~
zokier
OS/2 is owned by Serenity/eComStation these days and they seem still to be
doing active development on it:

[http://en.wikipedia.org/wiki/EComStation](http://en.wikipedia.org/wiki/EComStation)

~~~
yuhong
But I think it still contains code owned by MS.

------
Tloewald
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
I don't believe Word for Windows actually writes to the file until you save
it.

~~~
Tloewald
If I recall correctly, Word for Windows 2 had autosave on by default, and
would corrupt Word for Windows files with embedded drawings so that they
became impossible to edit. (Experienced with several files at the time.)

------
yiedyie
Microsoft is against the current, the other story that run here at HN is:
[https://news.ycombinator.com/item?id=7467165](https://news.ycombinator.com/item?id=7467165)

And that's why Microsoft is at a turning point in 2014.

------
bite
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
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".

------
qwerta
Windows source code was available for a long time. My university had access to
Win 2000 and some latter versions. Nobody was interested since most kernel
hackers used BSD and later Linux.

~~~
bananas
This is true. It leaked from Mainsoft a few years back. Was great fun reading
through the NT4 and 2k source. It has also been useful for working out what
the hell goes on inside Win32 on occasion.

~~~
SixSigma
While there was a leak, the source code was available to industry partners and
educational institutions legitimately.

------
malbs
Damn. If only they released Word 2.0. Then I could hack it to work on newer
versions of Windows. It's still the single best word processing package in the
history of this universe.

------
al2o3cr
Meh, I'll be interested when they release the source from the "fuck over DR-
DOS" era. Maybe when the statute of limitations for antitrust expires...

------
WalterBright
I think this is great, and long overdue.

Not only from a historical perspective, but for future people who may need to
run some ancient software in order to extract some ancient data from obsolete
formats.

I sure wish Turtlebeach would open source the software on their Audiotron.
They abandoned it maybe 10 years ago, but it's still far and away the best
standalone media player, but it could seriously use a software update.

------
ilovecookies
Finally the word soure code has been released! I have been waiting so long for
this blessed moment!

Why the ---- does this have 656 upvotes? Microsoft PR campaign anyone?

"Microsoft had under 100 employees and a Microsoft product (MS-DOS) had less
than 300KB". Yeah, that is still alot of employees compared to new software
companies today. And the sourcecode? Well resources for software development
were much scarce back then, both computer and human wise.

------
yuhong
Note on the .doc included in Word for Windows 1.1a source code package: You
will probably have to unblock the old Word file formats before you can open
them in current versions of Word. In Word 2003 SP3 and Word 2007 you have to
manually edit the registry, later versions provide UI for doing it. This won't
work for the Word for MS-DOS files which requires a separate converter.

------
happycube
To split hairs, it's actually DOS 2.11. MSHEAD.ASM has a version history.

~~~
wvenable
I had a handheld PC -- the Atari Portfolio -- that ran that version of DOS.

------
AndreyKarpov
Checking Microsoft Word 1.1a with PVS-Studio. Just for fun.
[http://www.viva64.com/en/b/0245/](http://www.viva64.com/en/b/0245/)

------
shmerl
is it useful for DOSbox?

~~~
logicallee
_Useful_? The next three weeks of HN will be:

MS-DOS cross-compiled to JAVASCRIPT.

MS-DOS running in pure CSS.

Word for Windows as pure HTML 5 (<brainfuck> element).

DOOM RUNNING NATIVELY on NATIVE MS-DOS on a PEBBLE.

~~~
joezydeco
How about 2084 in a TSR utility?

~~~
joezydeco
Whoops, I mean 2048. Big Robotron fan here.

------
sai1511
I think making IE open source will be very interesting....!

~~~
MrZongle2
Maybe in the same way a tour of a sausage factory would be interesting....

~~~
fbeans
Although a sausage factory would be bad, at least each tour would be standard,
and at least visiting that sausage factory wouldn't compromise your security
and your liberty and finally when you get home with your free tour sausages,
at least they'd interact with your saucepan the same way all the other
sausages do.

Perhaps I've taken this meataphor too far?

~~~
MrZongle2
Perhaps. But I was amused. :D

------
yiedyie
I like some of the Microsoft products, but at least if they had been releasing
MS-DOS 6 or 7 and Word 5 that would mean at least a bit of something, but this
...

And all released in the "look but don't touch" licence, I guess they need some
waving cause of the Win 8 fiasco, the 8.1 fiasco and the retiring support for
XP, if it hadn't been for the lucky Win 7, Microsoft would have gone the way
of Nokia.

------
0xdeadbeefbabe
Those MS-DOS 5.0 manuals were sure good.

------
sgt
Well, I had this already - but wouldn't mind a legal copy of the source code
after all these years.

------
rkda
Title's misleading. Should have specified the version of Word they're open
sourcing.

------
ytjohn
This will probably lead to a new RTF exploit...

------
rootuid
lame. License states that one can't host it anywhere. No point to the release.
Too little , too late from the dinosaur.

------
thiagoc
Error 503 Service Unavailable

------
gren
very useful nowaday!

------
zenciadam
Source for MS-DOS has been floating around the internet for about 15 years
now.

I guess they got around to removing all the curse words and comments where the
programmers bash each other.

