MS-DOS has been Open-Sourced! We Build and Run it!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
no I'm sorry I have no comment on how I secretly Revis my salacious comments in GitHub oh crap I shouldn't have said it was salacious oh crap I certainly shouldn't have said it was me oh crap I certainly shouldn't have said that I checked them into GitHub it's too hot today [Music] hey I'm Dave welcome to my shop I'm Dave plumber a retired operating systems engineer from Microsoft going back to the MS DOS and Windows 95 days today we're going to download the source code to MS DOS from GitHub build it and run it on real Hardware just like I did when I worked there now I know what you're thinking but Dave aren't you a little young to have worked on MS DOS well perhaps you thought that before I stopped coloring my beard a while back but to be fair I did come into Ms Doss later starting out on the last major release 6.2 now I got to work on some cool and meaningful features too like smart Drive CD ROM caching single pass disc copy the new single disc setup and so on I'm also fortunate in that since it was the last major release my code is immortalized in the last MS DOS before we all moved on to Windows 95 the big MS DOS news this month is the open source release of the MS DOS version 4.0 zero code on GitHub and today I'm going to take you through some of that source as we build the entire project using the same compiler and assembler as I did back at Microsoft in 1993 then write a dis image of it using a grease weasel and then boot it on an original IBM PCX to test it our test BC will be rocking the latest Microsoft Mack 10 speed doubler card and an original chrome ball Mouse so you don't want to miss that along the way I'll share some of my own MS DOS stor so let's get started MS DOS was based on something originally called qos for quick and dirty operating system that system was developed by Tim Patterson of Seattle computer products as an operating system for the Intel 886 processors Seattle computer products needed an operating system for their new computer hardware which was based on the then new 886 chip but CPM 86 was delayed in its release qos was Tim Patterson's solution to fill that Gap and he famously developed it in just a few months back in 1980 recognizing the potential for a standardized operating system in the burgeoning PC market Microsoft acquired the rights to qos for 75,000 without disclosing their cont contract with IBM to develop an operating system for the first personal computer Microsoft then hired Patterson to adapt qos into what would become MS DOS or the Microsoft dis operating system when IBM introduced its first personal computer the original IBM PC in 1981 it came with MS DOS as its main operating system sold as PC dos this version was essentially just a rebranded form of MS DOS Microsoft crucially retained the rights to sell Ms Doss to other vendors effectively ensuring its place as the primary Ary operating system vendor in the burgeoning PC market Mark zakowski known Us by his internal email of Mark Z was appointed as the dev manager for MS DOS starting from version two through on to version four his tenure oversaw significant technical advancements in the system version two which was released in 1983 introduced support for the new 10 megabyte hard Diss and was the first to support hierarchical file systems a feature inspired by Unix version 3 came out in 1984 providing support for larger dis formats and networking capabilities which were essential as PCS began to proliferate in business environments and then version four launched in 1988 introduced support for the newly developed Microsoft networks and included a graphical user interface called dos shell reflecting the beginning shift towards more userfriendly interfaces that would be later epitomized by Windows itself these developments under Marx's management were critical as they enhanced Ms Do's capabilities to handle the needs of increasingly complex Computing environments Ms doss's Evolution under Mark Z marked a significant chapter in the history of software laying down the software foundations upon which the PC Revolution would really be built the version of MS DOS that we'll be looking at today 4.00 is not the more common 4.01 that you're likely thinking of when you hear the term MS DOS 4 your confusion is well merited since the naming is more than a little subtle but long story short the 4.0 version was a special multitasking version of MS DOS that had very little commercial success success and as far as I know kind of began and ended with this version the good news is that they both derived from the same MS DOS 3.3 classic foundation so the code is largely the same when Microsoft initially released the MS DOS 1.0 source code a few years back it was still under a restrictive license which made sense given that it was commercial software but as Microsoft continues to embrace open source though we've seen it open up things a lot more and this time around it's using the MIT license the MIT license is unrestricted meaning you can use the software modify it copy it merge it publish it distribute it sulic it even sell it so you could even make your own Doss and go head-to-head with Microsoft about 30 years too late and that's something we'll do today we'll download the source code from GitHub and then set up the same basic Dev environment as I used Back in the Day based around the masm 2 assembler and the C 5.1 compiler now the assembler as you might have guessed translates Assembly Language into object code whereas the C compiler transforms C code directly into object code and then the C and the assembly object are joined together to make the final applications when I joined there are already several newer versions of masm and C available than what we were using but when you're building MS DOS you want the generated code to remain as similar as possible from version div verion and so once we locked onto an assembler and a compiler it was pretty much forever my dog is snoring when I joined the team I was also kind of floored that there was no common Library shared amongst all Ms do code if you were writing an assembler I came in thinking there' be an extensive standard lib of utility and helper functions but it turns out even to do something as Bal is output an integer on the console you were on your own and converting it to aski it was much better if you were in writing it in C but the vast majority of MS DOS is written in pure 86 Assembly Language the code is easy to find online at github.com microsofts dos once we've cloned The Source tree we can have a look at the project structure under the dos v4.0 folder we find a set of folders a few of them are self-explanatory like bios which deals with the hardware and boot which deals with a system startup and CMD which contains all of the MS DOS commands that are not directly built into command.com by the way you'll notice that I always say MS DOS and not Doss that was drilled into me on the team which even included a penalty jar where you had to deposit cash if you made a mistake and just said dos I guess this was to distinguish it from PC dos or maybe just to ensure that the Microsoft branded was always present but I found it a bit odd since no one thought anything other than Microsoft when you said dos I figured they should just take the win but those decisions were made way above my pay grade at the time let's examine a really simple MS DOS command to see what some of the code looks like in the CMD folder we can see all the Standalone Ms do commands that as I said are not otherwise built into the command processor for example Echo is a built-in command but more is a standalone executable one of the first things that more needs to do is to duplicate some file handles and redirect standard err and standard output it does this by calling functions within MS DOS itself which it accomplishes via the int21 assembly instruction what's int21 well whenever int21 is called the system looks at the value of the ah register determine what it is you're asking the system to do each basic operation like opening a file reading a file and so on has a number associated with that function and that number tells the int21 service which one you're asking for and this case we've loaded ah with the value for x dup which tells the system that we want to duplicate the file handle that we're going to pass in in BX the result comes back in the ax register and is stored in BP for safekeeping and that's how you duplicate a file handle in MS DOS in Assembly Language in case the need ever arises for you and we could follow this code just for more step by step for an hour or more probably but there simply isn't time to go through all the code like that today still I wanted to give you a peek at what the code looks like at its most fundamental level all told there are 584 Assembly Language files and 65 C language files back in the day as I recall at least it took about 90 minutes to 2 hours to build MS DOS on my 386 Dev system now I do have a very nice IBM PS2 Model 95 with a 486 here in the shop but I didn't want to do the work on the Vintage Hardware because I wanted fast turnaround as I was trying to get the thing to compile and build and on my M2 Ultra Mac Pro even though the dosbox environment I'll be using is only single-threaded it's still fast enough that I can build the MS DOS product in about 5 minutes to perform the build I simply launch dos box and then map Drive C to point at the source folder on the Mac where the GitHub code lives and in a perfect world you just type and make it the root of the project and MS DOS would pop out the other side but it turns out we do not live in a perfect world more to the point the folks that uploaded the code to GitHub will end up mangling a bit because GitHub translates line feeds and special characters in a way that doesn't work when you then check them back out and try to build them from MS DOS so to get this to work I had to manually edit some files change some lines pass the code through a said filter that remaps special characters and then run Unix to Dos on the files to finish the job I'll try to put a link to some of info about those steps in the video description once I had done that it was then as easy as typing and make in the root and we can watch the build fly on by it cranks on through the azm and C files quickly builds the needed message tables and when everything is finally done we can run a copy. bat script that's included that will dump all the binaries that we need into a final location if we try to test out the new binaries within dosbox however we discover that we get an incorrect dos version error that's because in dosbox we're running the equivalent of MS DOS 5 and the 4.0 binaries aren't going to be directly compatible with version five to run version four binaries we need to be booted into the version 4 command processor we need to boot off a 4.0 disc to do that but we have something of a chicken and egg situation here that I didn't rightly know how to solve so instead I did at kobashi Maru which is to say I cheated a bit when I ran out of options what I wind up doing was taking an original 4.0 dis read it in converted that to a digital dis image and then removed all the files from the image that gave me a completely empty but bootable disc image in other words a blank floppy with the right 4.0 boot sector I then copied all the new binaries that we just built into the image now you might wonder how I did things like writing a 360k image to a 5 and a/4 inch floppy on a modern PC cuz this requires a real 5 and a/4 inch drive but how do you connect it and I know of two possible options the cry flux and the grease weasel both are little boards that you connect to your computer by USB and then to the drive itself with a 34 pin ribbon cable as you would have in the old days that cable of course going from the drive to the board and then through USB to the PC you can read and write dis images to and from floppy discs using the software supplied with whichever one you're using now the cryofx reads writes and stores low-level flux information coming directly off the disc heads so it's the perfect solution for archiving rare and weird media the grease weasel is slightly more pedestrian but a lot easier to use thus when I'm simply reading or writing standard disc formats like IBM PC floppies I use the simpler grease weasel and that's what we'll be doing today one little tangent worth mentioning is the actual drive that we'll be using we're writing a 360k floppy but this is actually a more advanced 1.2 megabyte drive from the IBM at days it seems that internet lore holds that you can't or shouldn't write a 360k floppy and a 1.2 Meg Drive ostensibly because the tracks are finer due to the fact that there are twice as many of them so depending on who you believe you cannot do this but I assure you that it works fine after all the IBM at could read and write both 360k and 1.2 make floppies without a lot of fuss the key is to set the head step to two so that every time the head steps when writing our 40 Track image it only uses every second track that the 80 track drive is actually capable capable of I've done it and for many formats and never had an issue but I think the reality is that even a 40 track drive has excruciatingly thin magnetic track if you've ever tried to set the head alignment on such a drive using an oscilloscope and a screwdriver then you know that it takes only the slightest tiny adjustments so in my mind it's not like the 40 track drives are laying down some fat tracks that the 80 track Drive can't later manage and when you write the image on an 80 track drive it doesn't wind up just drawing a skinny little stripe down the middle of the fat 40 Lane 40 track line it does the whole track just fine now if you want to be completely correct and safe get a 40 track drive for formatting and for writing 40 track images all I'm saying is that the 80 track Drive works fine in my office and with that out of the way and the image complete let's pop it out and take it over to my little Museum area where an original IBM XT sits between an alter and a PS2 this XT has been upgraded with the very rare Microsoft mach 10 board that was donated to the channel by a viewer so it runs at 10 MHz versus the original speed of 4.77 it even features the very first Microsoft mouse that shipped with Windows 1.0 which you can identify from above by its green buttons and From Below by its stainless steel Mouse ball the memory test up to 640k takes about a minute to run and then the system will finally boot our image and as soon as it does I'm going to switch to desktop capture software so that I'm not stuck filming a green CRT for you as soon as our handbuilt MS DOS 4.0 successfully boots it asks for the time and date as specified in the autoexact dobat file we press enter twice and we're at the MS DOS prompt now because the 360k floppy is so tiny there's really only the command processor and some video drivers on this boot dis if I wanted to format the whole system which I don't because it's already running 6.2 from the hard disk I would then insert a second floppy with the format and FIS commands that we built a few minutes ago format the hard drive make it all bootable with sis and then copy all of our commands to the hard drive but if you want to run floppy only on a 3 60k system it's a lot of disc swapping hope you've enjoyed our little Ms a diversion today and if so please remember that I'm mostly in this for the subs and likes so do leave me one of each before you go today and if you're already subscribed to the channel thank you if you have any interest in matters related to or curiosity about the autism spectrum please check out the free sample of my book on Amazon it's everything I know now about living a successful life on the spectrum that I wish I'd known long ago thanks for joining me out here in the shop today in the meantime and in between time hope to see you next time right here and Dave's Garage
Info
Channel: Dave's Garage
Views: 426,262
Rating: undefined out of 5
Keywords: open source, ms-dos, linux, source code, github, open source software, MS-DOS 4, markz, mark zbikowski
Id: BR6F0EdyulA
Channel Id: undefined
Length: 15min 1sec (901 seconds)
Published: Mon May 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.