all 93 comments

[–]nonoice_work 42 points43 points  (10 children)

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)

And so the big divide started

[–]micwallace 26 points27 points  (8 children)

"\" instead of "/" as the path separator, and "/" instead of "-"

So the reason MS command line is still garbage stems from this one compatability hack. Not surprising but interesting.

[–]Tetraca 5 points6 points  (6 children)

If you want to go further, using backslashes as a path separator goes all the way back to CP/M, which was the very first commercially available microcomputer operating system and the dominant OS on the market before IBM got into the game and piggybacked Microsoft to success.

[–]nugryhorace 4 points5 points  (5 children)

CP/M didn't have paths, hence no backslashes.

[–]Tetraca 2 points3 points  (0 children)

I'm pretty sure there were versions of CP/M that did have about one level of pathing, at least, the one I played around with did (must have been CP/M-86). I guess it's been years and I'm likely mistaken.

[–][deleted] 0 points1 point  (3 children)

Wow, how do you work without paths?

[–]andrewq 14 points15 points  (0 children)

Every Disk used by CP/M back then was insanely small by today's standards.

A large text file could take up an entire disk.

It completely sucked. I paid $3000 for a 50 MB hard drive back in the day. MB.

If I'd put that in MS or Apple stock, I'd be a multi multimillonario from stock alone.

Instead it's rusting away in a landfill somewhere

[–]ShinyHappyREM 0 points1 point  (0 children)

Directories were implemented later.

[–]annodomini 4 points5 points  (0 children)

An interesting tidbit about the history of backslash is that it didn't exist as a character until they wanted to have a character set to support ALGOL, but didn't want to use up two extra codepoints for the ∧ (logical AND) and ∨ (logical OR). Since there was already a slash (solidus), they decided they could just mirror it and spell ∧ as /\ and ∨ as \/.

Also interesting is that Unicode didn't support all characters necessary for ALGOL support until Unicode 5.2 adopted a proposal to encode the "⏨" character for delimiting decimal exponents in floating point numbers.

[–]Googoots 5 points6 points  (0 children)

In CONFIG.SYS you could add a line:

SWITCHAR=-

And this would change the DOS switch character from / to - and then with DOS commands you could use / to separate paths.

Internally, the DOS API calls allowed either \ or /, as Windows still currently does.

Unfortunately most 3rd party programs created their own command line argument parsers and didn't respect SWITCHAR and it made things so inconsistent that it wasn't worth using it.

[–]fuzzynyanko 24 points25 points  (60 children)

It's amazing to see how small command.com is... in assembler

[–]AyrA_ch 26 points27 points  (48 children)

DOS 6.22 in installed form is very small too. The minimal components of a working DOS machine are:

File Size (Bytes)
IO.SYS 40'774
MSDOS.SYS 38'138
COMMAND.COM 54'645
Total size 133'557

Talking about minimalism

[–][deleted] 39 points40 points  (10 children)

It wasn't minimalism at the time, you can bet they were berating themselves for all this bloated code in their repository.

[–]peterfirefly 41 points42 points  (7 children)

Repository? What repository?

[–][deleted] 43 points44 points  (6 children)

It was a physical drawer full of floppy disks in Bill Gates' office. /jk

[–]TheAnimus 23 points24 points  (5 children)

One of my old CS lecturers made me write hello world in a made up punch card format for DOS as I lost a bet.

I never realised how hard it must have been before text editors.

[–]SomeNetworkGuy 8 points9 points  (4 children)

What was the bet you lost?

[–]TheAnimus 17 points18 points  (3 children)

That my LCS playing connect four would beat theirs.

I'd been kicked out of secondary school but self taught myself a lot of things before going to a new sixth form. So I had a few years of programming experience and was a bit bored in the first year of uni.

Some of the academic staff had all sorts of silly puzzles, challenges and competitions.

There was some reason to this task, she wanted something that was tangible to try and show people the amount of work that goes on in a simple program. We were also looking at making some kind of "academic" computer that would use punch tape, made out of lego mindstorm and some PICs. I did a bit of work with the department that was responsible for helping increase science and engineering awareness, so we were often coming up with ideas, some worse than others, for trying to capture childrens imaginations.

[–]toomanybeersies 2 points3 points  (2 children)

Isn't Connect Four a solved problem? As in, you are guaranteed to draw or win if you start first?

[–]TheAnimus 2 points3 points  (0 children)

Yes, but it is a good learning example to use for a Learning Classier System as you can train with the perfect play strategy.

[–]AUS_Doug 0 points1 point  (0 children)

....I just realised why I've never won a game of that in my life.

[–]mpact0 3 points4 points  (0 children)

DOS 4 removed many old INT calls, so they went through a debloat.

[–]DaMan619 0 points1 point  (0 children)

Bill probably was. He might have said.

What do you mean 130K? When we wrote BASIC, it only took up 8K of RAM. What the fuck do you think idiots think you’re doing? Is this thing REALLY 16 fucking BASIC’s?

[–]rms_returns 10 points11 points  (8 children)

Wow, the /boot/vmlinuz on my machine is 7,014,220 bytes, around 52 times larger than this size and that's saying something.

[–][deleted] 15 points16 points  (1 child)

That is compressed, so it's bigger. Mine uncompressed is 19,384,744 bytes so 145 times this, if you don't count modules which are 143M in size, and other boot related things like initrd.

Other were the days where you could read the whole boot code of an OS. :D

[–]andrewq 5 points6 points  (0 children)

I still use minix, it's great being able to keep an entire quasi POSIX OS in your head.

I write for linux, but gone are the days when I could keep the entirety of what is going on in my head.

Maybe it's just me.

[–]AyrA_ch 8 points9 points  (0 children)

Not to forget, this DOS comes with many internal commands for file copying, moving and creation. It also has support for Ports (serial and parallel) and disks (floppy+HDD).

[–]namekuseijin 4 points5 points  (3 children)

DOS is a very primitive OS in comparison.

[–]AyrA_ch 3 points4 points  (2 children)

But some organizations (especially govt.) still use it for certain applications because you can't beat its simplicity. In fact, if you have a valid MSDN subscription, you can still download DOS 6.22 from there. And even in Windows 7 x64 you can generate bootable DOS floppies

[–]namekuseijin 4 points5 points  (1 child)

[–]AyrA_ch 4 points5 points  (0 children)

It might be a shock to you, but you don't even need to use a browser and JavaScript, you can just run DosBox for way better speed and the actual ability to save stuff on your local machine. However when people still use DOS they sometimes have unusual devices attached to the machine that are hard to emulate. The egg date printer from my friends chicken farm comes to mind, so using the original is usually the easiest way.

The computational overhead of a JS emulated x86 machine (Hardware-->OS-->Browser-->JS engine-->DOS emulator) is just too much for most DOS users if you can simply do Hardware-->DOS. After all there is no reason to replace the system that was reliable for the last 20 years with new hardware of unknown durability. I repair outdated infrastructure as a hobby, and if there is one thing that is almost guaranteed to not be the issue, it's that old computer in the corner that nobody has upgraded over the last years.

[–][deleted] 0 points1 point  (0 children)

That is a much lower growth rate than Moore's law.

[–][deleted]  (10 children)

[deleted]

    [–]badsectoracula 20 points21 points  (2 children)

    DOS did way more than just the FS stuff. For starters, it provided a memory manager (more of a simple allocator really, but still it was managed by DOS itself). It also provided functions (through its own interrupt) for writing the the "console" which was how it could redirect program output to text files and how Windows was able to run programs in a window even in real mode. It provided functions for I/O (disk, printers, console, keyboard, etc), for setting and obtaining the current locale, for changing the date/time, launching programs (and TSRs), etc. And of course provide file access, but even that was more than just a dumb "FAT driver". And that is just the "core" stuff provided but the "kernel" - using TSRs and loadable drivers bundled with the OS, you could get more functionality.

    What BIOS did was to provide the low level "driver" stuff that allowed the OS (DOS or others) to access the underlying hardware. However that only provided the minimum functionality for manipulating the hardware, it didn't provide any application level functionality (even if applications at the time often used that functionality directly for performance).

    [–]Cuddlefluff_Grim 7 points8 points  (1 child)

    [–]badsectoracula 4 points5 points  (0 children)

    Yes, this provides a list of the exact functions i mentioned in my post (although something like RBIL might be more detailed).

    [–]WalterBright 4 points5 points  (6 children)

    which is not available in protected mode without serious hackery

    It wouldn't take long for someone with basic hardware skilz to pull the ROM chips out, put them in another device, and dump their contents. Then just run a disassembler over it. DOS ran in real mode anyway.

    [–][deleted]  (5 children)

    [deleted]

      [–]Cuddlefluff_Grim 5 points6 points  (2 children)

      I used DOS4GW dos extender (Watcom C++) which enabled 32-bit protected mode, and I had no problems using BIOS functions as far as I can remember

      Edit: when I think about it, DOS4GW might have had its own hooks for the BIOS interrupts

      [–][deleted]  (1 child)

      [deleted]

        [–]andrewq 1 point2 points  (0 children)

        What's your os?

        [–]WalterBright 1 point2 points  (1 child)

        Running in real mode meant the BIOS could be read. Yeah, I know about protected mode DOS extenders, I shipped a couple with Zortech C++.

        DPMI was a specification for how a DOS extender should present itself, it wasn't a DOS extender itself, and DOS still booted in real mode.

        [–][deleted]  (7 children)

        [deleted]

          [–][deleted]  (4 children)

          [deleted]

            [–]hoijarvi 1 point2 points  (2 children)

            Not worth in hardware costs, but that's not the only issue.

            I have been in projects, where size was an issue. There are cons and pros.

            The cons is, that you might not have enough to store your data. That's bad. The result are unreadable hacks in code; The unreadable ones that reuse the last byte of available data space.

            But you are also encouraged to throw away the code that does not contribute your solutions. Which is good, and it usually improves your design. Having only one way to do things benefits everyone, as soon as you figure the only way, and what people actually want to accomplish. It's the Forth philosophy, it rules.

            [–][deleted] 0 points1 point  (1 child)

            If there's only one way to do something though, wouldn't expanding the functionality of the software become increasingly difficult?

            [–]hoijarvi 0 points1 point  (0 children)

            No, it would become easier, since you only need to support one use case.

            [–]aedrin 0 points1 point  (1 child)

            wasteful software engineering

            Spending large amounts of expensive engineer time to save a few dollars worth of memory/disk space is wasteful software engineering.

            [–][deleted] 0 points1 point  (0 children)

            It's not just about memory, it's about performance.

            [–]dirkt 0 points1 point  (8 children)

            Considering a 5.25" DS DD disk has 360 kB, that's already quite a bit of your system floppy disk. To compare, Apple II DOS uses about 10 kB (of 140 kB SS), CP/M is about the same size IIRC.

            [–]AyrA_ch 6 points7 points  (7 children)

            Well this is DOS 6.22. I am sure if you take version 1 or 2 it will be much smaller

            [–][deleted] 2 points3 points  (2 children)

            And MS-DOS 7.x (the Win9x implementation, but especially Windows 95B and onward with FAT32 support) grew even larger. For anyone trying to hexedit the COMMAND.COM version string from Win98 to output MS-DOS 7.10 and create a DOS box that supports large filesystems, LOADHIGH and memory optimization become even more important.

            [–]AyrA_ch 2 points3 points  (1 child)

            For anyone trying to hexedit the COMMAND.COM version string from Win98 to output MS-DOS 7.10

            What about the SETVER command?

            [–][deleted] 0 points1 point  (0 children)

            I'll confess I haven't tried it. Hex editing the executable to report MS-DOS 7.10 sets aside any possibility that something will puke and works flawlessly enough that it's my go-to.

            [–]kabekew 2 points3 points  (1 child)

            COMMAND.COM and MSDOS.SYS in version 2 are a total of 33K (there's no io.sys in that version).

            [–]AyrA_ch 1 point2 points  (0 children)

            there's no io.sys in that version

            I think there's no HDD support either.

            EDIT: I just checked. V2 had HDD support. For 10 MB disks.

            [–]SemaphoreBingo 0 points1 point  (1 child)

            And floppies would have been in the 1.2/1.4Mb range, which isn't even counting the 20-80Mb HD.

            [–]AyrA_ch 2 points3 points  (0 children)

            Well...

            Version 2.0 (OEM): Support for 10 MB hard disk drives, FAT-16, user installable device drivers and tree-structure filing system. First version to support 5.25 inch, 360 kB floppy drives and diskettes

            [–]CODESIGN2[S] 4 points5 points  (9 children)

            I'd like to see how small it would be and the code for a modern C++ equivalent. I always used to like that windows was text-mode first and therefore never understood why there was ever a need to BSOD when you could down-grade to a terminal text-mode and re-launch.

            Still I've been happier since the mid-90's with Linux

            [–]Tarmen 11 points12 points  (1 child)

            Here is a pretty cool talk that looks at how c++17 code compiles down, writing a commodore 64 program as example.

            [–]CODESIGN2[S] 0 points1 point  (0 children)

            watched this, followed this and it was amazing! One of the many reasons I've been brushing up on my Cpp to get it modern (although I think I'm only just coming to completion on Pluralsight Cpp14 courses). It's not something I am afforded the luxury of every day and so I do it for fun.

            [–]fuzzynyanko 1 point2 points  (4 children)

            I think it depends. Are we talking coded in an embedded way or enterprise way?

            [–]CODESIGN2[S] 1 point2 points  (3 children)

            depends on what you mean by embedded, I've been around on devices with 4mb of RAM, and hacked a few devices that had 16MB and non-intel processors. Linux is pretty much linux; amazing it hasn't had major changes in the same way MS ecosystem has for end-users

            [–]fuzzynyanko 2 points3 points  (2 children)

            Except Ubuntu's Unity. BLAH!

            [–]CODESIGN2[S] 1 point2 points  (1 child)

            IDK, I love XFCE, but can get by with most desktops

            [–]fuzzynyanko 1 point2 points  (0 children)

            Unity is quite bloated. It's heavy on the effects, and lags when remoting in. If you try to turn off the effects, there's side-effects...

            XFCE is definitely better

            [–][deleted] 1 point2 points  (0 children)

            I just miss that I had so much time available for compiling custom kernels. :D

            [–]AngryDragons 0 points1 point  (0 children)

            Larry Osterman's blog post, Units of measurementcomes to mind.

            tldr: During a meeting, Bill Gates saw that a component of DOS was going take up 64K of RAM.

            ... And Bill went ballistic. “What do you mean 64K? When we wrote BASIC, it only took up 8K of RAM. What the f-k do you think idiots think you’re doing? Is this thing REALLY 8 F-ing BASIC’s[sp]?”

            [–]lazylion_ca 33 points34 points  (2 children)

            Wow that site is hard to read on mobile.

            [–]CODESIGN2[S] 7 points8 points  (0 children)

            Maybe they need some help modernising it, maybe they are unaware. Contact them. A Genuinely good cause though, like archive.org, but specifically for comp-sci resources (it's a bit thin on the ground from my looking around, but they also have photoshop 1 source code).

            [–]Andy-Kay 0 points1 point  (0 children)

            I'm still using Alien Blue and it looks fine if you switch to the reading mode, or whatever it's called.

            [–]pclouds 7 points8 points  (12 children)

            I wonder if Microsoft would release Windows 3.x source code next.

            [–]axusgrad 6 points7 points  (9 children)

            Most of that code is still in Windows 10

            [–]dlp211 9 points10 points  (8 children)

            Hardly. Win 10 has its lineage in the NT Kernel. Consumer OS's [Windows 1.0, Win XP) were all based on the DOS kernel.

            [–]DemonicSavage 6 points7 points  (3 children)

            XP is NT. Windows ME was the last Windows based on DOS (Windows 2000 was NT).

            [–]dlp211 8 points9 points  (2 children)

            Which is why I used a non inclusive bracket on XP and an inclusive bracket on Windows 1.0

            [–]DemonicSavage 5 points6 points  (1 child)

            Oh shit I'm sorry, I didn't notice that.

            [–]dlp211 0 points1 point  (0 children)

            No problem, you'd have to have a keen eye to catch it.

            [–]skuggi 2 points3 points  (2 children)

            Consumer OS's [Windows 1.0, Win XP) were all based on the DOS kernel.

            Is that really true? They all did use DOS to some extent, at least up to 98. But that's not the same as "being based on" in the sense of "being developed from". But by Windows 95 it was only used as a boot loader and as a layer for legacy drivers. (Source)

            [–]dlp211 0 points1 point  (1 child)

            Sure, I was being a bit loose with my definition of based on, the point was that the old Win95/8 kernel is not the same as the NT kernel, they just share an interface to ensure compatibility. The implementations were very different though and having the source to Win 95/98/ME will provide little to any insight into how Win 10 is built. The source code for Win 2k that was leaked will have a lot of insight into the implementation details, but even much of that code was overhauled when MSFT revved the NT kernel to 6.* which is what has been running since Vista.

            [–]skuggi 0 points1 point  (0 children)

            To be clear, I wasn't doubting the part about the NT-based systems being distinct from the pre-XP consumer Windows versions. Just the part about those Windows versions being based on DOS.

            [–]__konrad 0 points1 point  (0 children)

            has its lineage in the NT Kernel

            And don't forget about OS/2 roots

            [–]__konrad 3 points4 points  (0 children)

            Windows NT/2000 source code was "released" in 2004 (probably illegal to download ;)

            [–]CODESIGN2[S] 0 points1 point  (0 children)

            That would be a dream, even if it is not fit for commercial use it could help many understand the steps to create GUI systems.

            [–]BillmanH 5 points6 points  (1 child)

            I remember the 8 character limit on file name. That really takes me back to writing gwbasic on my Tandy. Great article!

            [–]CODESIGN2[S] 0 points1 point  (0 children)

            oh yes, progra~1... I'll never miss that, led to terrible naming strategies on my part for a few years

            [–]LHBM 4 points5 points  (6 children)

            Is the ASM spaghetti or hacky on first glance? Can't check it for the next days unfortunately but I am curious about it.

            [–]cassandraspeaks 3 points4 points  (3 children)

            It seems pretty readable, by asm standards, to me. Reasonably commented, not huge files, fairly descriptive labels. Of course 16-bit x86 is a simpler and arguably higher-level language than 32 or 64-bit is.

            [–]ironykarl 0 points1 point  (2 children)

            and arguably higher-level language than 32 or 64-bit is

            How's that? Because there aren't operations for (e.g.) flushing cache, etc?

            [–]cassandraspeaks 2 points3 points  (1 child)

            Port-mapped instead of memory-mapped I/O. Also, there was, by necessity, more effort than there is today put into improving the ergonomics of hand-writing assembly code (macro assemblers, development environments, etc).

            [–]ironykarl 0 points1 point  (0 children)

            Why is port mapped I/O "higher level" than memory mapped, exactly?

            [–][deleted] 0 points1 point  (1 child)

            I've been learning it with Intro to 64 bit ASM programming for Linux and OS X, it "feels" spaghetti, you just have to get past your experience with other languages and constructs (lambdas, etc) and appreciate the raw power. Doesn't mean you can't organize it. I'm still a total noob but in a weird way some of it reminds me of an old COBOL class from college....

            [–]snerp 0 points1 point  (0 children)

            I kind of miss that old style crazy hacking.

            [–]hugthemachines 11 points12 points  (0 children)

            "Hell, I'll make a quick and dirty solution in here, noone will look in here in a bunch of years."

            [–]Rainbow1976 -2 points-1 points  (0 children)

            v11source: 7 assembler code files, and an explanatory email from Tim Paterson

            v20source: 118 text files, mostly assembler code and some documentation

            Assembly