top | item 37410803

MS-DOS v1.25 and v2.0 is now open-source (2014)

207 points| theycallhermax | 2 years ago |github.com | reply

102 comments

order
[+] EvanAnderson|2 years ago|reply
Asynchronous I/O figures in prominently in Windows NT but I just assumed it wasn't ever thought about in DOS (being single-tasking and single-user). I was really surprised to see[0]:

Each driver in the chain defines two entry points; the strategy routine and the interrupt routine. The 2.0 DOS does not really make use of two entry points (it simply calls strategy, then immediately calls interrupt). This dual entry point scheme is designed to facilitate future multi-tasking versions of MS-DOS. In multi-tasking environments I/O must be asynchronous, to accomplish this the strategy routine will be called to queue (internally) a request and return quickly. It is then the responsibility of the interrupt routine to perform the actual I/O at interrupt time by picking requests off the internal queue (set up by the strategy routine), and process them. When a request is complete, it is flagged as "done" by the interrupt routine. The DOS periodically scans the list of requests looking for ones flagged as done, and "wakes up" the process waiting for the completion of the request.

I didn't realize that kind of forwarding-looking perspective was going into the design of MS-DOS.

[0] https://github.com/microsoft/MS-DOS/blob/master/v2.0/source/...

[+] rep_lodsb|2 years ago|reply
They copied this driver model from UNIX/XENIX. However the way it was implemented in DOS, the interrupt routine had to always return with the "done" flag set, so a driver that was compatible with it wouldn't ever be possible to run asynchronously on a newer version.

There actually was a multitasking version of MS-DOS, but it was only licensed to a few OEM's. These disk images surfaced about 10 years ago:

https://www.pcjs.org/software/pcx86/sys/dos/microsoft/4.0M/

https://www.os2museum.com/wp/multitasking-ms-dos-4-0-lives/

[+] thibaut_barrere|2 years ago|reply
Reminds me of TSR (terminate and stay resident) programs, which felt like magic (I was happy to implement one a long time ago). TSR is an embryo of that in a way!
[+] dezgeg|2 years ago|reply
I wonder how many of such drivers that would in reality only work when those two are called in succession
[+] gslin|2 years ago|reply
[+] dang|2 years ago|reply
Thanks! Macroexpanded:

Microsoft Releases MS-DOS Source Code on GitHub - https://news.ycombinator.com/item?id=18428882 - Nov 2018 (7 comments)

The original sources of MS-DOS 1.25 and 2.0 - https://news.ycombinator.com/item?id=18097661 - Sept 2018 (115 comments)

MS-DOS is now Open Source - https://news.ycombinator.com/item?id=7468192 - March 2014 (3 comments)

Microsoft makes source code for MS-DOS and Word for Windows available to public - https://news.ycombinator.com/item?id=7466952 - March 2014 (204 comments)

MS-DOS Source Code Released - https://news.ycombinator.com/item?id=7466826 - March 2014 (7 comments)

[+] torusle|2 years ago|reply
Oh, nice..

I browsed a little through the code, and found that sort.com used self-modified to change the sorting order:

  ; note! jae is patched to a jbe if file is to be sorted in reverse!
  ;
  CODE_PATCH LABEL BYTE
         JAE     INNER_SORT_LOOP

I committed similar crimes in the 90th as well, but that was just me as a teenager programming stupid games in asm for fun and giggles. Not for commercial software.
[+] chungy|2 years ago|reply
Let's get MS-DOS 6.22. :)
[+] guestbest|2 years ago|reply
I’d say that DOS 3.3 and 5.0 are probably the most desirable for pre-386 intel compatible processors systems
[+] Hrundi|2 years ago|reply
6.22's source code was readily shared by some russians back in 2002 or so, and it was the real deal
[+] sillywalk|2 years ago|reply
Midori would be cool to see as well
[+] gigel82|2 years ago|reply
Now do Windows 2000! We'd need only modern hardware support and a few QoL / security updates and we'd have the perfect OS.
[+] giancarlostoro|2 years ago|reply
I kind of wish Microsoft would make "MicrosoftLegacy" for repos like this one, so we can see all of the old things they've open sourced.

The real thing I wish they could / would open source is that old pinball game.

[+] jeffwilcox|2 years ago|reply
Thanks for the suggestion. We do have a "MicrosoftArchive" organization that we could consider transferring this sort of thing to...

As far as games, and the broader collection of earlier closed source applications: it's incredibly difficult to clear rights if there's third-party intellectual property that was written without the intention of being open, or licensed content, etc. It also takes a bit of an army to clean/review code and comments to get them ready.

[Source: I run our open source office... we help advise internally, but aren't staffed to do nostalgia open sourcing and so need to partner with people and teams who can help]

[+] magic_hamster|2 years ago|reply
I don't think it's theirs to publish. Also, the version bundled with Windows was apparently just a demo. The full game had more tables.
[+] Endy|2 years ago|reply
Unfortunately, Microsoft doesn't own the pinball game - that was a Maxis production, one table from Full Tilt! pinball. Go talk to EA.
[+] issafram|2 years ago|reply
I was under the impression that they don't actually have the code for that pinball game.
[+] outside1234|2 years ago|reply
Just crazy they wrote all of the command line tools in ASM - was that because C would have resulted in binaries that were too large?
[+] asveikau|2 years ago|reply
I don't think C and x86 real mode with segment:offset addresses mix that well. Obviously there were compilers that did it (and then those "near" vs "far" pointers ...), but it's not great.

I think once you got to a flat 32 bit address space and more than 1mb of memory, C starts to make more sense.

[+] ok123456|2 years ago|reply
They wrote a this before they had a good C tool chain. Microsoft didn't have a C compiler until 1985 which was a repackaged version of Lattice C.
[+] pjmlp|2 years ago|reply
Contrary to urban myths, C was only yet another language during the 1980's, and hardly used outside UNIX.
[+] kjs3|2 years ago|reply
I wonder if there are any copies of the "OEM Adaptation Kit" in the wild. Would be neat to be able to get this running on a not-IBM-compatable 8086 machine.
[+] gjsman-1000|2 years ago|reply
If I could pass my ideal version of copyright to the world, this is what I would dream:

1. Copyright is 20-30 years in length, maximum. (We can argue about that.)

2. For computer programs, a copy of all source code, build tools, and final binaries must be supplied in an offline format (maybe a Blu-ray Disc or a few?) to the Library of Congress to store, duplicate, and preserve as needed. This content will then be released on the copyright expiration, and the offline format is meant to render computer hacking ineffective for stealing the work. For software as a service that is continuously improved, new discs must be received yearly.

#2, I think, already has precedent considering the patent system. A patent is meant to describe how to perfectly recreate the patented technology (minus, maybe, a few trade secrets), so why not copyrightable software?

[+] chungy|2 years ago|reply
We do need major copyright reform, and I think even splitting copyright into categories makes sense. Some time-sensitive content, like sports and news broadcasts, might only warrant 4-5 years of copyright protection before becoming public domain. Books and movies may as well enjoy the 20-30 time frame you propose (the original 1790 copyright act offered a maximum of 28 years of protection, if you bought a 14-year extension to the default 14-year term). Software might warrant just 10 years of copyright protection, which is just about the maximum length that corporate support exists for; it could be reasonable to allow for a 10-year extension to an initial 10 years.
[+] aidenn0|2 years ago|reply
I think 20 years with N optional 10 year renewals (where N can be debated[1]). I'd like it to be short enough for the less-profitable works to make archivists jobs easier, but long enough for authors to be able to profit off of commercial adaptations (e.g. the GoT show appeared 15 years after the book was published).

I like #2, but it could be a burden; perhaps only registered works should do it (and registering would be required for renewals).

1: I like 3, which is much shorter than current copyright but significantly longer than you suggest

[+] paulddraper|2 years ago|reply
> a copy of all source code, build tools, and final binaries must be supplied in an offline format (maybe a Blu-ray Disc or a few?) to the Library of Congress to store, duplicate, and preserve as needed

Dude, I just want my turtle to move around on the screen. Now I have to ship Blu-rays to Congress?

[+] dragonwriter|2 years ago|reply
> #2, I think, already has precedent considering the patent system.

Deposit requirement is already part of the copyright system, applying to everything published that is subject to copyright unless exempted by regulation:

https://www.law.cornell.edu/uscode/text/17/407

[+] johannes1234321|2 years ago|reply
#2 may work for old software, but how can this work for contemporary, which even for "on premise" use receives frequent patches and updates? And becomes really tough with modern "cloud" (in broad meaning) software, which is tied to a lot of infrastructure.

And yes, I share the goal! I however don't see a practical way.

[+] Delk|2 years ago|reply
#2 wouldn't work internationally. Of course the US can internally have whatever kind of legislation they want, including whatever requirements for having one's works covered by copyright. But non-US authors or companies (or government organizations) obviously can't be obliged to supply materials to the US Library of Congress.

You could deny them copyright protection for their software within the US if they don't but that wouldn't be exactly popular.

Of course you could still do it purely internally within the US for software whose copyright belongs to US organizations or individuals, and it might achieve some of what you want.

[+] delta_p_delta_x|2 years ago|reply
> Library of Congress

I suppose the US is the only country in the world, and if I release software in Europe, I've got to ship it across the pond...

[+] dave4420|2 years ago|reply
That would effectively force most free software into the public domain?
[+] lproven|2 years ago|reply
Five years ago, yeah, it was.
[+] tibbydudeza|2 years ago|reply
I wish the source code of Netware 286/386 was made available - nobody uses it but it would be interesting to see how they did things.
[+] trebligdivad|2 years ago|reply
Anyone understand why there is Xenix.asm in there?
[+] tibbydudeza|2 years ago|reply
Int 21H will be eternally fried in my brain.