10 ms·
MS-DOS v1.25 and v2.0 is now open-source (2014)
- outside1234 3y agoJust 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 3y agoI 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.
- deleted 3y ago[deleted]
- nxobject 3y agoIIRC the classic Macintosh for example, even despite the flat memory model, had relocatable code segments to deal with real memory limitations, with a relocatable base + fixed offset jump table. They're not identical situations, but I think Think C had pragmas to delineate segments (although my memory is shaky there).
- pjmlp 3y agoIt had them yes, and was mostly coded in Assembly and Object Pascal.
- torusle 3y agoIt wasn't that bad. You had different memory models back then. If you wanted to keep things easy you just compiled for a memory model in which each pointer was either 16 bit (for code/data smaller than 64kb) or a memory model with far pointers (access to all the memory). There have been mixed memory models and you could go crazy with near and far to break out of the limits of the easy memory models. Most of the time it was just a mater of picking a suitable memory model for your code and forget about near/far though. Not so different than today.
- a_e_k 3y agoYep. The "tiny" model gave you a single 64KB segment shared by both code and data. And the "small" model was the one where there was one 64KB segment each for code and data. IIRC, with the tiny model you could often compile those to .COM files where MS-DOS would pick a free segment, load the file to the 0x100 offset, set all the segment registers to it, set the stack pointer to 0x0, and jump to the start at 0x100. Super simple (not even an executable header)!
- pan69 3y agoC and x86 real-mode works just fine, why would it not? Yes, the segmented model is a bit of a pain but totally doable and it's not just a problem when programming C but also x86 Assembler, Pascal, etc. Even in Q(uick)Basic you won't get around it once you start to do more advanced system things. http://alexfru.narod.ru/os/c16/c16.html http://alexfru.narod.ru/os/c16/c16.html But indeed, we were all glad when the 32bit flat model was introduced with the 386.
- ok123456 3y agoThey 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.
- nottorp 3y agoAlso the first IBM pc had what, 64kb of ram? It makes sense to do hand optimized assembler for that. Segmented architecture has nothing to do with it, there was support for it in any Compiler that targeted the platform. And besides, it was how you did things back then, no surprises there.
- pjmlp 3y agoContrary to urban myths, C was only yet another language during the 1980's, and hardly used outside UNIX.
- giancarlostoro 3y agoI 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.
- magic_hamster 3y agoI 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.
- leni536 3y agoWell, not exactly that, but check out https://github.com/k4zmu2a/SpaceCadetPinball https://github.com/k4zmu2a/SpaceCadetPinball .
- jeffwilcox 3y agoThanks 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]
- chungy 3y agoIt would be neat if Windows 3.x could get open sourced, both the NT and non-NT versions. There's probably a business argument that they're far enough removed from Windows 11 to not be a threat to Microsoft's sale of Windows 11.
- EMIRELADERO 3y agoIsn't Windows itself far enough removed to not be a threat to Microsoft's bottom line these days? Wouldn't be surprised to see modern Windows going open-source or at least source-available in the coming decade.
- blibble 3y agohow generous
- TheRealPomax 3y agothis needs [2019] in the title
- nitwit005 3y agoWhere "now" appears to be 2018.
- giancarlostoro 3y agoProbably when they archived it on GitHub? or setup the git repo
- voytec 3y ago2014. > These are the same files originally shared at the Computer History Museum on March 25th, 2014 [1] and are being (re)published in this repo to make them easier to find. [1] http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/ http://www.computerhistory.org/atchm/microsoft-ms-dos-early-...
- gslin 3y agoMore discussion in https://news.ycombinator.com/item?id=18097661 https://news.ycombinator.com/item?id=18097661 (2018).
- dang 3y agoThanks! Macroexpanded: Microsoft Releases MS-DOS Source Code on GitHub - https://news.ycombinator.com/item?id=18428882 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 https://news.ycombinator.com/item?id=18097661 - Sept 2018 (115 comments) MS-DOS is now Open Source - https://news.ycombinator.com/item?id=7468192 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 https://news.ycombinator.com/item?id=7466952 - March 2014 (204 comments) MS-DOS Source Code Released - https://news.ycombinator.com/item?id=7466826 https://news.ycombinator.com/item?id=7466826 - March 2014 (7 comments)
- chungy 3y agoLet's get MS-DOS 6.22. :)
- anticensor 3y agoAnd Windows XP.
- petercooper 3y agoOr if we need to start the bidding low.. QBasic, perhaps? :)
- speps 3y agoSorry they started even lower actually! GW-BASIC! https://devblogs.microsoft.com/commandline/microsoft-open-sources-gw-basic/ https://devblogs.microsoft.com/commandline/microsoft-open-so...
- petercooper 3y agoHaha, yes! Although I'm being a bit sneaky, because QBasic would also indirectly get us Edit, I think ;-) It'd be interesting to see the code behind the 90s DOS IDEs.
- falalalala 3y agoGw-basic looks a lot like what command.com should have been.
- fuzztester 3y agoKids these days ... billg's very first BASIC, which he wrote on a night flight from Albuguerque to NY, or some such, for the Altair. 'Sbin a few decades, so ah disremember. See Ichbiah's Le Nouveaux Magiciens. Google ichbiah nouveax magiciens And, get off my lawn! Grrr. ;-)
- rasz 3y agoXP or its parts leaked. Surprisingly Win95 codebase never saw the light of day.
- lproven 3y agoFive years ago, yeah, it was.
- Karellen 3y agoNot just "open-source", but actual MIT-licensed (aka Expat-licensed) Free Software: https://github.com/microsoft/MS-DOS/blob/master/LICENSE.md https://github.com/microsoft/MS-DOS/blob/master/LICENSE.md https://directory.fsf.org/wiki/License:Expat https://directory.fsf.org/wiki/License:Expat Huh. Was not expecting that. Nice. Edit: Of course they won't actually mention Free Software, because they don't want to acknowledge Free Software. smh
- paulddraper 3y ago> Of course they won't actually mention Free Software, because they don't want to acknowledge Free Software. What do you want, a love letter?
- RobotToaster 3y agoWell, a few kisses would be nice.
- npongratz 3y agoA sincere apology for the Halloween documents would be good start.
- outside1234 3y ago> actually mention Free Software What would have satisfied you? I mean, MIT is "free software", what else do they need to say?
- deleted 3y ago[deleted]
- chungy 3y agoIt's basically only the GPL family that mentions free software. They're the licenses forged out of the movement itself. Everyone else is just happy to satisfy the spirit of the thing without giving it explicit mention.
- circuit10 3y agoWhat's the difference? The way most people use the term "open source" means the exact same thing as "free software", so I feel like this just being pedantic
- trebligdivad 3y agoAnyone understand why there is Xenix.asm in there?
- layer8 3y agoRead the History section of https://en.wikipedia.org/wiki/Xenix https://en.wikipedia.org/wiki/Xenix. Microsoft planned for evolving MS-DOS into Xenix and added some level of Xenix compatibility in MS-DOS 2.0.
- kjs3 3y agoBecause Microsoft sold Xenix contemporary to early DOS? Some sort of comparability functions, perhaps.
- xeeeeeeeeeeenu 3y agoThose files implement the "new" file handle API, which replaced FCB (File Control Block) from MS-DOS 1.0. It's somewhat inspired by Unix file descriptors. It seems that "Unix" and "Xenix" were often used interchangeably in old Microsoft code. For example, there are 23 occurrences of "Xenix" in the MSVCRT.DLL source code (in the Windows 2003 SDK). This is one of them: crt\stdlib.h:241:_CRTIMP extern int errno; /* XENIX style error number */
- gjsman-1000 3y agoIf 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?
- dragonwriter 3y ago> #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 https://www.law.cornell.edu/uscode/text/17/407
- mschuster91 3y agoDepositing assets is one thing, but the real change would be to deposit sources as well. Say, a book... if it got typeset on a computer, then the full files and fonts have to be deposited as well.
- kjellsbells 3y agoI can just imagine Donald Knuth reading this, running his hands with glee, and starting the next thirty years of his work. Maybe keeping it nice and easy to start with by a six volume discussion of what a file is.
- chungy 3y agoWe 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.
- kjs3 3y agoI 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.
- deleted 3y ago[deleted]
- gigel82 3y agoNow do Windows 2000! We'd need only modern hardware support and a few QoL / security updates and we'd have the perfect OS.
- grishka 3y agoThat's what ReactOS kinda wants to be — it targets Windows Server 2003 compatibility right now. It's still far from a usable state though.
- BryanLegend 3y agoNot gonna lie, a small part of me misses smashing the caps lock key when coding back in the day. :) Example: https://github.com/microsoft/MS-DOS/blob/master/v2.0/source/FORMAT.ASM https://github.com/microsoft/MS-DOS/blob/master/v2.0/source/...
- tibbydudeza 3y agoInt 21H will be eternally fried in my brain.
- tibbydudeza 3y agoI 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.
- sedatk 3y agoAn introductory article about what was new in MS-DOS 2.0 when it was released: https://archive.org/details/computer-design-magazine/page/n111/mode/2up https://archive.org/details/computer-design-magazine/page/n1...
- torusle 3y agoOh, 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.
- EvanAnderson 3y agoAsynchronous 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/DEVDRIV.txt https://github.com/microsoft/MS-DOS/blob/master/v2.0/source/...
- thibaut_barrere 3y agoReminds 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!
- febed 3y agoThis brought back memories of school when some of us cheated on programming exercises by calling up a TSR program with solutions when the teacher was out of sight. Good times.
- oso2k 3y agoI've been looking for TSR & Packet driver coding examples and resources (for a non-keyboard triggered use case). I want to implement a localhost only webserver as either a TSR or Packet Driver.