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

28 of 224 comments (clear)

  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. 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?!

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

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

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

    Or something.

    --
    No sig today...
  6. 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.

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

  8. GitHub Source by Anonymous Coward · · Score: 5, Informative

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

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

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

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

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

  13. 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.
  14. 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.

  15. 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;
  16. 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".
  17. 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.

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

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

  20. I found this statement by Tablizer · · Score: 5, Funny

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

  21. 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
  22. 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.

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

  24. 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 :-(

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

  26. 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;
  27. 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.