
The original sources of MS-DOS 1.25 and 2.0 - plurby
https://github.com/Microsoft/MS-DOS
======
6502nerdface
The README for 2.0 contains an interesting apology to OEMs:

> 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). Both the printer echo keys and insert mode
> keys have now been made to toggle. The default prompt (this may also be
> changed by the user with the PROMPT command) has been changed from "A:" to
> "A>". We apologize for any inconveniences these changes may have caused your
> technical publications staff.

So MS-DOS almost had Unix-style file separators and argument switches!

~~~
userbinator
There's even an (undocumented?) int 21h function to get the switch character,
if I remember correctly.

------
0xabe
Microsoft, please release QuickBasic to the world

~~~
themodelplumber
That'd be really cool. Upgrades to QuickBasic would come out pretty fast I'll
bet.

In case it doesn't happen, I have to say FreeBASIC is pretty nice...I was
happy with how easy it was to make a little simulation game and compile it.
Also I haven't tried it out for very long, but Gambas seems pretty neat and
does some kind of web app creation thing now too.

~~~
rnd0
FreeBASIC is pretty cool, qb64 isn't bad either -and might be a shade closer
to the original quickbasic? (I'm not sure as I don't know enough QB arcana to
test).

[https://www.qb64.org/](https://www.qb64.org/)

~~~
codetrotter
There’s also a guy from Finland that wrote his own QuickBasic compiler and is
doing some pretty cool videos on YouTube under the handle Bisqwit, with some
of the videos talking about things he wrote or prototyped using QuickBasic.

[https://bisqwit.iki.fi/source/qbc.html](https://bisqwit.iki.fi/source/qbc.html)

[https://youtu.be/TUa5HJUebEA](https://youtu.be/TUa5HJUebEA)

[https://youtu.be/8x9Ya4izFaE](https://youtu.be/8x9Ya4izFaE)

[https://youtu.be/ZwcFV3KrnQA](https://youtu.be/ZwcFV3KrnQA)

[https://youtu.be/5Da6ZyQJjE0](https://youtu.be/5Da6ZyQJjE0)

[https://www.youtube.com/playlist?list=PL41889A5E9CBD68CF](https://www.youtube.com/playlist?list=PL41889A5E9CBD68CF)

------
scruffyherder
It's MIT licensed too!

[https://github.com/Microsoft/MS-
DOS/blob/master/LICENSE.md](https://github.com/Microsoft/MS-
DOS/blob/master/LICENSE.md)

I was kind of surprised about that!

~~~
rnd0
It is pretty suprising, all things being equal. I'd suggest keeping a close
eye on this issue: [https://github.com/Microsoft/MS-
DOS/issues/2](https://github.com/Microsoft/MS-DOS/issues/2)

------
iguessthislldo
It looks like they set the commit dates to match the release dates:
[https://github.com/Microsoft/MS-
DOS/commits/master](https://github.com/Microsoft/MS-DOS/commits/master)

~~~
userbinator
Interesting. More explanation: [https://hackernoon.com/how-to-hack-github-
kind-of-12b08a46d0...](https://hackernoon.com/how-to-hack-github-kind-
of-12b08a46d02e?gi=6c1136aeb6d5)

It looks like git uses the standard Unix epoch for its internal timestamp
format, and not e.g. a format unable to represent dates before its creation,
but that still means it can't really handle pre-Unix dates:

[https://stackoverflow.com/questions/21787872/is-it-
possible-...](https://stackoverflow.com/questions/21787872/is-it-possible-to-
set-a-git-commit-to-have-a-timestamp-prior-to-1970)

Edit: downvoters, care to explain what I'm wrong about?

~~~
codesnik
I didn't downvote you, but what you say doesn't make much sense.

git is distributed and works offline, this means that nothing could prevent
you from making commit with a "fake" date, you always can change time on your
machine. So there's nothing really hackish in that, and that has nothing to do
with format in which time stored in git internally. And you can have
legitimate uses for "faking" commit date. I'd say repository above is an
example of such a legitimate use.

~~~
tinus_hn
The format Git uses determines the range of dates it can store. If it uses the
normal Unix epoch system 0 means 1-1-1970 so you can’t represent dates before
that.

~~~
theclaw
I thought unix time was a signed integer, so you can go negative all the way
back to 1901:

    
    
      $ perl -e 'print gmtime(-2147483648).""'
      Fri Dec 13 20:45:52 1901

~~~
rusk
It’s more a formality I think. Since recording of atomic time started in the
early 1970s it’s accepted that an atomic second is an actual second back as
far as 1970. No assertion of accuracy is made beyond that. Of course otherwise
you can negative offset as much as you like beyond that but because of physics
and stuff it can’t be treated with the same level of certainty or something.

------
forapurpose
Don't overlook the email by v1.25 (and v2.0?) author Tim Paterson:

[https://github.com/Microsoft/MS-
DOS/blob/master/v1.25/Tim_Pa...](https://github.com/Microsoft/MS-
DOS/blob/master/v1.25/Tim_Paterson_16Dec2013_email.txt)

... or the version history in the v2.0 MSHEAD.ASM file:

[https://github.com/Microsoft/MS-
DOS/blob/master/v2.0/source/...](https://github.com/Microsoft/MS-
DOS/blob/master/v2.0/source/MSHEAD.ASM)

EDIT: Found better version history

~~~
lioeters
Apparently, Tim Paterson worked on MS-DOS up to v1.25 (completed March, 1982).

Source: [http://www.patersontech.com/dos/origins-of-
dos.aspx](http://www.patersontech.com/dos/origins-of-dos.aspx)

------
Theodores
Shocking to think this is where PCs got started. On my first encounters with
MS-DOS I was underwhelmed, the Acorn BBC Micro came with better software and
it was all in ROM. I could not believe that this was serious software.

~~~
rusk
If Cringley is to be believed, the original incarnation was called QDOS, Quick
& Dirty DOS done up by some guy in the valley that didn’t want to pay for
CP/M. Gates licensed it outright for $50k cause he needed something to go to
IBM with ...

------
utopcell
Full assembly. Was this the case all the way up to 6.22 ?

~~~
simcop2387
I bet at least until the whole .com .exe stuff was sorted out. After .exe was
created they finally got more than a single segment in a binary, so they
probably we're using C by then for some things at least. I imagine all the
.com files were ask even at 6.22 though, because of the 64kb limit of them

~~~
Narishma
I'm pretty sure .EXE was supported from the first release.

~~~
simcop2387
Looks like you're probably right,
[https://en.wikipedia.org/wiki/DOS_MZ_executable](https://en.wikipedia.org/wiki/DOS_MZ_executable)

There's at least support in 1.0, but the api changed in 2.0. Though I believe
the few bits of software I've seen from that era, there were fewer .exes (I
suspect for the same language distinction I postulated earlier).

------
theamk
Interesting, all sources of MS-DOS 1.25 is just 12K lines of code, including
comments.

Today, this seems like a pretty small project, and most commercial apps are
significantly bigger.

~~~
ndnxhs
My beta web app probably has more source code than that..

That has me thinking though. I have always wanted to try OS dev but all the
stuff I have read says it will take years to get a system that can print hello
world but surely it can't take that long to write 12k lines.

~~~
stormbrew
An "OS" that just boots and prints hello world would be on the order of tens
to hundreds of lines depending how fancy you want to be and how much you want
to lean on legacy bios support still being a thing.

There are a lot of tutorials out there that'll walk you through quite a bit
more than that in a weekend.

------
gerdesj
Well it has a place, I suppose. For me: I wasted a lot of time and effort
farting around with config.sys and autoexec.bat getting drivers to load etc.

Could I sue for lifetime wasted?

~~~
rangibaby
Messing with SET BLASTER (port 220 IRQ 5 DMA 1) to get sound to work in "Rise
of the Triad" was probably the defining moment of my early PC misadventures.
That and making a boot disk for Dark Forces, and labelling it "boot dick" by
accident (thanks for kicking me in the nuts, mum)

~~~
hnzix
Ludicrous gibs!

~~~
nailer
Dog mode

------
Jaruzel
I'd like to see tiny 80x86 boards (about the size of the Pi Zero) that you
could boot DOS on, with full access to GPIO/SERIAL/PARALLEL etc. I know
arduino exists in this space, but for DOS lovers, little hobbyist boards like
this would be great, and ideal for bootstrapping single purpose apps written
in C.

~~~
jakobdabo
There is the 86Duino borad, based on Vortex86EX SoC.

~~~
Jaruzel
oooh those look interesting. Thanks!

------
giancarlostoro
Wonder if and when we will get closer to seeing existing windows apps open
sourced. It looks like they may be doing clean up of old codebases to release

~~~
userbinator
...or perhaps even Windows itself?

I'm a bit ambivalent about this (and all the "open sourcing" MS has been doing
recently.) On the one hand, it's great to see source code. On the other hand,
everything can be reverse-engineered anyway and it feels like this is a sign
of a "shedding" (for lack of better term) MS --- one that doesn't see software
as having intrinsic commercial value anymore, but instead is turning to
services like Azure and stuffing telemetry in everything to eventually turn
into another adware company for profit, while at the same time hiding that
behind the "but we're open-source too" marketing.

~~~
ksec
I see Windows Kernel as a possible candidate. Or At least some sort of
strategy based around having Open Kernel for Servers / Mobile, and expand .Net
Toolset in Server Space as well as Gaming in Mobile.

~~~
rnd0
I'd be pretty surprised. To be sure that there's no 3rd party crap in it
they'd probably need to re-write it the way they rewrote their C# compiler
which would be both pointless and difficult to justify (to put it mildly) from
a business perspective.

------
brandonmenc
Does anyone remember a particular DOS programming guide that dove deep into
the internals, distributed as textfiles written by a single author on contract
from (I believe) the US Navy?

------
miffe
Why only 2.0, not 6.22?

~~~
milpool
I'd prefer 3.0 - because it was the baseline to DOS applications, it seems.
EverythingTM runs on DOS 3.0.

(I'm using MS-DOS 5.0 on my 386, though.)

~~~
mdip
I'm with you there -- IIRC, the 3.x series was all about hard disks. I'd lean
toward 3.31, though, personally as the "Everything(TM)" item since (I think)
that was the version that shipped with FAT16 (had to hit up Wikipedia and this
was the version that supported partitions over 32MB). I remember, as a kid,
that we had to have 2 partitions on our drive because of the version of DOS
not supporting partitions greater than that size and that this was a problem
for us for a while (how long, not sure, I was young, could have been years but
was probably months), so it seemed like it was a pain point that was overdue
for where software was heading, even then[0].

It was also when I started to feel the age of the 8088 I was running it on and
was the first version of an OS that I wrote something 'difficult' that I
thought was 'really cool' using assembler. I was _very_ young, so _cool had a
wildly different definition than it has today. What I wrote was a TSR
(terminate and stay ready -- something that was almost, but not quite,
entirely unlike a background app) that made a ball-like character bounce
around the screen after a random number of minutes,_ really fast* for a second
(just long enough for you to _maybe_ question what you saw)[1].

It was a horrible pain of C, some assembler, and -- of course the mess of
pirated software that claimed to be something of a compiler and a development
environment but I found most of them were designed to simply return
indecipherable errors (or -- error codes -- sometimes literally just exit
codes), it took me weeks, but it's the reason I stopped begging for a C64,
Mac, Amiga or any of the other platforms that had far more fun things to do
with them at the time.

[0] Some never forget being told '640K is more than you'll ever need' (yes,
partial or misquote, but it's exactly what the guy who sold us that first 8088
told us) -- I'll never forget the _incredible controversy_ that happened when
OS/2 2.1 came out and it was something like ~30MB installed! We had a _FULL_
height 350MB SCSI drive at the time (a cool $1,600 controller, cable,
terminators, drive and all), so I was a little spoiled. I was still _always_
almost full _all the time_ but, hey, what can you do.

[1] I got the idea from a rumor I had heard about a software virus of the time
that did something similar. Mine didn't spread -- it had to be edlin'ed into
the AUTOEXEC.BAT. I named it something non-obvious since my dad was proficient
enough to go snooping around (it may have even been something in the more l33t
CONFIG.SYS).

~~~
mthoms
It's been awhile but didn't TSR stand for _Terminate and Stay Resident_ rather
than _Terminate and Stay Ready_?

Your comment brought back some great memories, thanks :)

~~~
mdip
"Resident" is correct, and I am not :).

Honestly, I think I've always referred to it as Terminate and Stay Ready;
probably something I read in one of those old books that used to adorn the
bookshelf of my parent's office.

Writing it brought back a lot of memories, as well - glad someone enjoyed it!
It's amazing to think that we used to write programs in ways other than "I
don't know how to do this" (performs google search) "I know how to do this
now", but rather had to pour through books, forums (on dial-up BBSes and what
qualified as equivalents in the early Internet days) and acquiring that little
nugget of knowledge felt like it had so much more _value_ , even though the
reality is that the value was the same, it just took a lot more _effort_.

------
Asiasweatworker
There is unlawful leaked MS-DOS 6.0 source code too.

------
Dowwie
Does anyone remember ANSI bombs? One tricked 12 year old me and formatted my
hard drive

~~~
berbec
Ah yes... Mapping space bar to "^Mformat c: /q /y^M". Those were the days...

------
ape4
Could you run this with any current virtual machine?

~~~
rnd0
There's 86box, based on PCEM;
[https://github.com/86Box/86Box/](https://github.com/86Box/86Box/) ...it has
support for several PC/XT/AT models.

If you can get it onto a floppy image, I'm sure it would run it just fine.

~~~
Jaruzel
> _If you can get it onto a floppy image, I 'm sure it would run it just
> fine._

There's a bit of a catch-22 there. Technically, you need to be running DOS X.X
to create a bootable floppy (real or image) of DOS X.X, as to make a disk
bootable you have to type 'SYS A:' from the running DOS to write bootblock
onto the floppy and copy over the current IO.SYS MSDOS.SYS and COMMAND.COM.

So, on say.. a modern machine, with no extra third party tools to create the
empty bootable floppy image, you'd be hard pushed to do this, as the files in
the Repo are just the files and not a floppy image.

~~~
dfox
It is even more complex than that. This source code (and the compiled
binaries) does not contain the PC-specific DOS code, which were supposed to be
written by the OEM (in PC case that probably means IBM). In order to build
bootable DOS out of this you have to link SYSINIT.OBJ and SYSIMES.OBJ and your
hardware interface code into binary (on PC the result of that is IBMIO.COM for
PC-DOS and IO.SYS for MS-DOS for PC) and if you want to boot from floppy you
also have to provide some kind of bootloader.

------
anon49124
Universities and industry groups, esp. security folks, get full source copies
of Windows and more... with big bear-trap, PMITAP NDA's. I have/had a
NT5/Win2k source CD somewhere in my empire of junk.

------
selimnairb
I have tons of nostalgia for DOS having first used it in 1992. However, as
soon as I used Linux in 1994, it was instantly apparent how backward and hard
to use DOS was compared to Unix-like systems. With hardware like Raspberry
Pis, not sure why anyone would want to use DOS on x86 for embedded purposes
today.

