Slashdot Mirror


Microsoft Posts Source Code For MS-DOS and Word For Windows

An anonymous reader writes "Microsoft, along with the Computer History Museum, has posted the source code for MS-DOS 1.1 and 2.0, and Word for Windows 1.1a. It's been a long time coming — DOS 2.0 was released for IBM PCs in 1983, and Word for Windows 1.1a came out in 1990. The museum, with Microsoft's consent, has made the code available for non-commercial use. They've also explained some of the history of this software's development: '[In August, 1980], IBM had already contracted with Microsoft to provide a BASIC interpreter for the PC, so they asked them to investigate also providing the operating system. Microsoft proposed licensing "86-DOS", which had been written by Tim Paterson at Seattle Computer Products (SCP) for their 8086-based computer kit because the 16-bit version of CP/M was late. When SCP signed the licensing deal [7] with Microsoft, they didn't know for sure who the computer manufacturer was. Paterson said "We all had our suspicions that it was IBM that Microsoft was dealing with, but we didn't know for sure." [1] He left SCP to work for Microsoft in 1981. "The first day on the job I walk through the door and 'Hey! It's IBM.'" Microsoft originally licensed 86-DOS in December 1980 for a flat fee of $25,000. By the next summer they recognized the importance of owning it and being able to license it to other companies making IBM-PC clones, so they purchased all rights for an additional $50,000.'"

47 of 224 comments (clear)

  1. Why are they posting old source code? by Anonymous Coward · · Score: 2, Interesting

    Why not DOS 6.22? They're not making a bundle on that, either.

    1. Re:Why are they posting old source code? by counterplex · · Score: 5, Insightful

      I'm not sure that's needed really. Projects like FreeDOS and the like seem to be fine on their own. The DOS 2.0 source code is more of a curiosity, nothing more.

      --
      $x = ($x * 10) % 10 >= 5 ? 1 + int $x : int $x
    2. Re:Why are they posting old source code? by Anonymous Coward · · Score: 5, Funny

      I guess DOS 6.22 is still somewhere part of their Windows 8.1 64 bits system. Releasing that code might give vulns. to current systems. :)

    3. Re:Why are they posting old source code? by Anonymous Coward · · Score: 5, Insightful

      the Computer History Museum

      Because there is historic value in early versions. There is also value in seeing how the apparent problems changed, but where things began is pretty significant.

      Oh, sorry, mod this down, I accidentally thought you might even take the half-second to read the first sentence of the summary before commenting. I forgot where I was for a moment there.

    4. Re:Why are they posting old source code? by SJHillman · · Score: 5, Informative

      To the best of my knowledge, the last version of Windows to actually be based on DOS was Windows ME. 2000, XP and later followed the NT base.

    5. Re:Why are they posting old source code? by Jugalator · · Score: 2

      MS-DOS no longer exists in Windows. I don't think it was compatible with the NT kernel. The "Command Prompt" is confusingly similar though, but I don't think they share code.

      --
      Beware: In C++, your friends can see your privates!
    6. Re:Why are they posting old source code? by dacut · · Score: 4, Insightful

      Why not DOS 6.22? They're not making a bundle on that, either.

      Distributing the source code to a proprietary product has a number of potential legal hurdles. If there are parts of the source which were licensed from another company (as would be the case with MS-DOS and SCP, IBM, Stac, and possibly others), those agreements need to be revisited and you may need to get permission from that company (or its successors) to do so. (I include IBM because, I believe, they took over much of the development for the 4.x series.)

      MS-DOS 2.x might be the latest version they (currently) feel confident in being able to release free of these restrictions.

    7. Re:Why are they posting old source code? by The+MAZZTer · · Score: 2

      It uses the NTVDM, which emulates DOS. Windows doesn't actually run on top of DOS anymore.

    8. Re:Why are they posting old source code? by Hal_Porter · · Score: 5, Insightful

      That doesn't mean that Windows 8 is 'based on Dos' anymore than a Linux box with the Dosbox emulator running Dos apps in a windows is.

      Incidentally in 64 bit Windows there is no NTVDM or support for 16 bit Windows - you can have 16 bit apps running on a 32 bit kernel via a thunking layer (Windows On Windows), or 32 bit apps running on a 64 bit kernel via a thunking layer (WOW64) but you can't have 16 bit apps running on two thunking layers on a 64 bit kernel. Since Microsoft won't support memory above 4GB using PAE on 32 bit Windows you pretty much have to use 64 bit Windows on a machine with more than 4GB. In fact even on a 4GB machine you'll have more usable memory with a 64 bit OS than a 32 bit one - there's a hole under 4GB for PCI memory mapped space. The only way to get access to the memory the hole covers up is to see it about 4GB. With current Microsoft OSs that is only supported on 64 bit OSs. So in the long run most machines are going to come with a 64 bit OS and that means no NTVDM.

      Of course part of it is probably that 16 bit Windows and Dos apps have pretty much ceased to be commercially important. And if you want retro games you've been better off with something like Doxbox than NTVDM for some time.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    9. Re:Why are they posting old source code? by Kalriath · · Score: 2

      That's expressly covered in the Computer History Museum's article - it was confirmed, by a computer forensic engineer no less, that DOS is not copied from CP/M.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    10. Re:Why are they posting old source code? by RightSaidFred99 · · Score: 4, Informative

      Windows, including the most up to date one, still have a 16 bit personality able to run DOS programs. This means there is something there that is able to catch int 21 and process it, as well as allow programs to direct interrupts.

      Modern computing fail. I can run ARM Android binaries on my Windows box, doesn't mean that Windows has Android vulnerabilities or that Android is part of Windows.

    11. Re:Why are they posting old source code? by Anonymous Coward · · Score: 5, Funny

      Jugalator's statement: There's got to be some DOS 6.22 code in there.
      Your response: Windows doesn't actually run on top of DOS anymore.
      My conclusion: You can't read.

    12. Re:Why are they posting old source code? by tlhIngan · · Score: 3, Informative

      Windows, including the most up to date one, still have a 16 bit personality able to run DOS programs. This means there is something there that is able to catch int 21 and process it, as well as allow programs to direct interrupts.

      While it is true that cmd.exe (as well as the black screen dumb terminal that it usually runs in) are not DOS, DOS is certainly still in there, somewhere.

      Nope, 64-bit versions of Windows do not have the 16 bit personality anymore because the CPU cannot run 16-bit code in 64-bit mode. Virtualization programs typically run 16-bit code in a software emulator as it's comparatively very little code before the OS jumps into 32 bit mode or 64 bit mode.

      cmdhost.exe, the command prompt host, is just a program that generates the GUI-less environment for a command line program to operate in (since the concept of stuff like "stdin" and "stdout" aren't applicable). It's not DOS at all, just a program that emulates what used to be called a DOS box by providing various services like clipboard to stdin/stdout, scroll back buffers, mapping text draw commands and cursor control commands, etc.

      Other than that, cmd.exe is a regular 32-bit program making regular Win32 API calls as needed.

    13. Re:Why are they posting old source code? by mcl630 · · Score: 4, Informative

      Dosbox allows you to slow down the emulated DOS environment to make old games run fine.

    14. Re:Why are they posting old source code? by mcl630 · · Score: 3, Informative

      Nothing in the your quote contradicts what I said. I've used DOSBox to play old games. There is a setting to adjust the speed of the emulator.

      In fact I just took a look at one of the config files, the setting is called "cycles" and it is in the "cpu" section of the config.

    15. Re:Why are they posting old source code? by davester666 · · Score: 2

      source code for word is valuable for that crazy docx format which has some things specified like this: "do X like Microsoft Word Y.Z does".

      --
      Sleep your way to a whiter smile...date a dentist!
    16. Re:Why are they posting old source code? by Hal_Porter · · Score: 3, Informative

      In Undocumented Dos they explained that the version of Dos was a "a hacked version of MSDOS ... mostly removing the file system". NTVDM runs real mode Dos programs in V86 mode. So what happens is that when when you make an int 21h call to open a file in a Dos program? You real mode code hits a BOP. A BOP is an illegal opcode. At that point the processor traps (or software emulator on a Risc machine calls out) and you end up running fairly standard user mode protected mode code which handles the file open.

      You can see it here in Reactos

      http://old.reactos.org/wiki/DO...

      In order to implement the DOS "API" (int 21, etc.) we need a way to call Win32 and kernel procedures from the VM thread. This is accomplished in Microsoft's NTVDM by writing a stub 16-bit kernel (ntdos.sys, ntio.sys, ...) that hooks the same interrupts as a 16-bit DOS kernel would, but instead of actually handling these, it executes a special undefined opcode (C4 C4 followed by some more bytes indicating the desired operation) in order to trap back into kernel mode/protected mode (meaning execution will pass through KiTrap6, "INT 06: Invalid Opcode Code (#UD)"). The request is dispatched to the proper VDM and handled in protected mode, and then an iret takes execution back to the instruction after the invalid opcode sequence.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    17. Re:Why are they posting old source code? by hairyfeet · · Score: 2

      What would be nice is if they put out the Win95 or Win98 source code as there is a ton of games that played on win9x that really didn't run anywhere else.

      But I'd say DOS source is pointless except as a curiosity as between DOSBox and FreeDOS we now have DOS that works better than the original by a pretty good clip. After all DOSBox even gives you emulation of the most used hardware and FreeDOS gives you a fully bootable with mouse support for your drive imaging and the like so I don't see a release of MS-DOS really doing anybody much good now, which is probably the point as it gives them a little free positive publicity for just throwing some of their worthless crap out there. Funny how they won't even release DOS under a free license like BSD, what are they afraid companies are gonna start building things with DOS again?

      --
      ACs don't waste your time replying, your posts are never seen by me.
    18. Re:Why are they posting old source code? by Guy+Harris · · Score: 3, Informative

      Do you have a piece of source code to support your claims?

      No. Do you have a piece of source code to prove that NT-family versions of Windows are DOS-based? The "Inside Windows NT" books say that the NT kernel-mode code has a very much non-DOS structure.

      Because unless proven otherwise, Windows is still a crap patchwork.

      An OS can be a "crap patchwork" without being based on DOS.

  2. I'm In Trouble Now by LifesABeach · · Score: 4, Funny

    I told my dad about this post pointing on my Touch Screen; now he's calling my doctor and asking about a Tetanus Shot, and he looks worried?!

  3. True to their genesis by Anna+Merikin · · Score: 2, Insightful

    This short history summary shows that Microsoft's roots are in marketing, not programming. Once they obtained their license from SCP, they were responsible for DOS' development alone, and we eventually got MS-DOS 4.0, 4.01, 4.02.....4.22, 5.0 (( don't remember any bugixes for that one), 6.0, 6.01, 6.02, etc. NB: some of the interim 6.x changes series were for stealing compression technology from a competitor.

    Thier buggy software continued right the 20th century till XP (2001)

    It took them a long time to learn to program, and, now, their marketing is shooting themselves in their feet.

    Long live MS (not.)

    1. Re:True to their genesis by Quila · · Score: 5, Insightful

      This short history summary shows that Microsoft's roots are in marketing, not programming

      No, their roots were in programming. This was their foray into marketing. Anybody who used a Radio Shack Model 100 (or its brethren) knows that Microsoft was capable of developing an excellent product at one point.

    2. Re:True to their genesis by UnknownSoldier · · Score: 5, Funny

      /Oblg. M$ joke

      Windows 95: 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company, that can't stand 1 bit of competition.

    3. Re:True to their genesis by Anna+Merikin · · Score: 4, Interesting

      In the interests of truth, you are right; I left out their contributions to BASIC (I believe it was jointly developed at some point with Apple) and Bill Gates himself did some work on that groundbreaking program, but probably it was others who did most of the programming work with Gates being the bulldog who tried to drive payment for the program, which had gotten into the wild. There are some charming emails from Gates warning users about pirating BASIC circulating om the internet.

      However, their huge success in relicensing seems to have driven their business plan after 1982.

    4. Re:True to their genesis by PPH · · Score: 5, Interesting

      Their roots are in brokering deals. They bought some rights from Patterson and got them cheap by concealing their end customer (IBM). They then hired Patterson and tossed him another $50K for the remaining rights to distribute. $75K altogether. If Patterson had said "No thanks" to the employment offer and hung onto distribution rights, SCP might have done a better job building upon DOS and they'd be the rich people. Microsoft would have gone on to be one of many apps developers in a diverse DOS-based ecosystem.

      Microsoft has always feared the independent developer. They have become adept in killing off potential competition or buying up expertise and burying it somewhere in the Redmond campus.

      --
      Have gnu, will travel.
    5. Re:True to their genesis by Quila · · Score: 2

      Yep, they were good at one point. That Model 100 was the last Microsoft product that Gates' own code went into. Maybe that's it, maybe Gates was a great coder, but a poor manager of coders where quality is concerned.

    6. Re:True to their genesis by Anna+Merikin · · Score: 2

      Yes, I remember. I misspoke. IBM gave a lot of code to MS-DOS (which, when sold by IBM, was called IBM-DOS). So MS was not the sole developer of DOS, and it is possible IBM contributed the buggy parts.

      But if that is so, why was OS/2 (developed FOR IBM BY MS originally) so, well, weird?

    7. Re:True to their genesis by Anonymous Coward · · Score: 2, Interesting

      I thought everyone knew this. There was more history that I remember. When IBM first saw the code M$ had bought from SCP (it was first called QDOS for "Quick and Dirty Operating System), it had 8000 lines of assembly code, and IBM pulled out 6000 lines of bugs, then gave it back to M$. The only reason IBM was so generous was that they didn't want to get caught up in Sherman (Antitrust) Act problems, so they made M$ their beneficiary. Little did they know that their friend and partner would become their fiend and back-stabbing competitor. M$ got caught intentionally breaking their products when run on DrDOS, and had to not just buy "Doublespace" but all of Stac Electronics after M$ stole compression technology from Stac. There were a lot of other things that M$ did later on that gave them a bad name (screwing with IBM over OS/2, Killing Netscape by bundling IE) with Gates lying to the judge "oh noes, its unpossible to remove....(cross fingers), threatening to 'wack Dell' if they tried to offer any computer with Linux bundled instead of windblows, killing FoxPro (and FoxSoft), killing WordPerfect, killing dBase (and Ashton-Tate), killing CorelDraw, killing Borland", but these were early dirty tricks. Later they would move on to ruining standards bodies by rigging elections on their OOXML (a target standard even M$ can't hit), and trying to screw with hardware bootloaders to only accept M$ operating systems. The list goes on and on. There are real reasons why so many people in the industry want them dead. Their mission statement is "mendacium,
      fallere furtum", and translates to "lie, cheat, steal".

    8. Re:True to their genesis by dryeo · · Score: 2

      Not IBM-DOS but PC-DOS.
      OS/2 got a bad start due to IBM trying to keep a promise that it would run on a 286. Getting a 286 to multi-task and run a VDM was not easy. Still OS/2 looked like DOS when you fired it up, with basically the same extra commands as cmd.exe still has, things like start to launch a program in the background. The graphical interface that came with OS/2 1.1 was what Windows 3.x and Win NT 3.x copied though they did remove things like folders in the Program Manager.

      --
      https://en.wikipedia.org/wiki/Inverted_totalitarianism
    9. Re:True to their genesis by CronoCloud · · Score: 2

      killing WordPerfect

      It's not dead yet!

      This is on the shelf at my local Wal-mart:

      http://www.walmart.com/ip/Core...

    10. Re:True to their genesis by 93+Escort+Wagon · · Score: 5, Informative

      Maybe that's it, maybe Gates was a great coder, ...

      Andy Hertzfeld, over at folklore.org, has made some comments regarding how poor Gates' coding skills appeared to be.

      --
      #DeleteChrome
    11. Re:True to their genesis by westlake · · Score: 5, Informative

      This short history summary shows that Microsoft's roots are in marketing, not programming.

      In 1975 there is BASIC for the Altair. In 1976 Microsoft was selling BASIC to Fortune 500 clients. In 1977 it is branching out into FORTRAN, COBOL. and Assembler. In 1978, Microsoft releases Applesoft BASIC.

      [In 1979] Microsoft 8080 BASIC is the first microprocessor product to win the ICP Million Dollar Award. Traditionally dominated by software for mainframe computers, this recognition is indicative of the growth and acceptance of the PC industry.
      June 18, Microsoft announces Microsoft BASIC for the 8086 16-bit microprocessor. This first release of a resident high-level language for use on 16-bit machines marks the beginning of widespread use of these processors.
      [in 1980] Microsoft introduces the Pascal language, develops XENIX (enhanced version of the UNIX operating system), and begins to explore spreadsheet applications. It also releases its first hardware product, the Microsoft SoftCard, which allows Apple II users to run CP/M-80. Microsoft will provide BASIC, FORTRAN, and COBOL languages for the Z-80 SoftCard.

      Microsoft Time Line

      In 1980 Microsoft had a solid track record in development tools for the microcomputer and was well positioned to become a major player in operating systems and applications software in both the business and consumer markets.

    12. Re:True to their genesis by Anna+Merikin · · Score: 2

      I greatly preferred Xtree.

      note: ytree for Linux is a near-perfect clone of xtree for DOS. I still use it.

  4. Re:FreeDOS by Joce640k · · Score: 4, Funny

    FreeDOS isn't done until Lotus won't run.

    Or something.

    --
    No sig today...
  5. Re:Source code for 3.3 was out there long ago.... by SJHillman · · Score: 3, Funny

    I'm trying to find DOS 3.3 on a 5.25" floppy somewhere. Have an old Tandy that has a slightly DOS install on its ancient hard disk that I'm looking to repair. Once I get it running, I plan on keeping it in my office for when people come whining about wanting a new PC.

  6. Fork? by Jugalator · · Score: 2

    Eagerly awaiting the first fork! MS-DOS for Linux? Mac? It can finally happen!

    --
    Beware: In C++, your friends can see your privates!
    1. Re:Fork? by Kalriath · · Score: 2

      Not legally allowed. The license prohibits distributing derivative works - it's for research and educational purposes only (though you can make your own derivative works).

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  7. GitHub Source by Anonymous Coward · · Score: 5, Informative

    Someone posted a mirror to GitHub: https://github.com/Incognito/msdos

  8. Tainting by Jiro · · Score: 3, Interesting

    Doesn't even looking at this source code create a minefield for open source developers? If you look at the source code, Microsoft can scrutinize all your open-source contributions claiming that since you read Microsoft's source code, you can't suddenly forget everything you learned, so all your contributions to open-source software are tainted by your knowledge. It will be impossible to prove otherwise. This may mean that if you look at Microsoft's source code, you are barred for life from working on the Linux kernel or anything even remotely related to operating systems. It could even affect your ability to get a job.

    1. Re:Tainting by ledow · · Score: 5, Informative

      Are you intending to write an antique DOS system in assembler that uses some really, really primitive version of FAT - by the looks of it? Then probably best not to look.

      The other 99.99999% of the planet, however, might find it interesting.

      Personally, I find anything still written in assembler to be totally worthless. If you wanted that, you could have run it through a disassembler at the time of it's release and it's not-much-more work to get to something just as readable.

      Like the original Prince of Persia code dump - only useful for historical reference and to find out how data and data structures were processed in terms of file compatibility etc. (so, long-dead OS and filesystems are pretty worthless, especially when we know almost everything about them already).

      And honestly, from a first glance, it's SUCH basic code that if you were to program any kind of DOS, and needed to be MS-compatible, the only obvious way to do so would be a basically word-for-word re-writing of what they have. There's almost zero room for "invention" or "interpretation" here, so it's mostly uncopyrightable except as a collection of code. Most functions are literally a handful of lines of assembler on well-known data structures that do one quite obvious thing and the necessary - and prescribed by the way the OS works - register / stack shuffling to make it happen.

      If I were on the FreeDOS team, yeah, I wouldn't want to read it. But honestly, the chances are I wouldn't bother - I'd have a much nicer, more modern, easier-to-read, collaboratively-written project that does an awful lot more than these antique DOS's could ever do sitting right in front of me, already written. There's nothing "useful" here, but it buys MS some "open-source" lip-service.

  9. Re:FreeDOS by Kalriath · · Score: 4, Insightful

    Irrelevant. The source code for MS-DOS 1.0 is interesting as a curiousity, a piece of history if you will. It's most assuredly not useful as the basis for any modern work. And FreeDOS is, well, not a piece of history, a curiousity. Hence, FreeDOS is irrelevant to this discussion.

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  10. It's been out there for a while by Aug+Leopold · · Score: 2

    It doesn't seem to be widely known, but the MS-DOS 6.0 source code was leaked at some point. However, if you look it up you will only see posts from late 2006 when it was indexed by google code search. There doesn't seem to be any information on how or when it was originally leaked it seems like for whatever reason it wasn't big news at the time.

  11. Re:The point? by Lehk228 · · Score: 2

    read the summary, or at least the first line of the summary "Microsoft, along with the Computer History Museum"

    --
    Snowden and Manning are heroes.
  12. I found this statement by Tablizer · · Score: 5, Funny

    12700 REM see, 640k is enuf 4 me - BG

  13. Re:Finally something for the Ribbon haters by dfsmith · · Score: 2

    I read "ribbon haters" and thought "hey, there are still people who use typewriters?"

  14. Re:Source code for 3.3 was out there long ago.... by bloodhawk · · Score: 3, Funny

    my Tandy 1000ex most definitely required its DOS to be booted from the floppy drive. was damn frustrating when I was first learning computers and looking through commands, one of the first ones I tried was Format a:, spent the next 2 weeks waiting for a replacement dos disk :-(

  15. Admirable by iamacat · · Score: 2

    I wish more companies would do this, and sooner too. Would your ten year old code really be a serious competition to your current efforts? It can however be priceless for learning, or even support for hobbyists who like tinkering with old gadgets.

    Lets thank Microsoft for doing the right thing and hope its a sign of good things to come from their new leadership. Apple, Novell and Sun - please take notice.