4 ms·
Ironically, Microsoft's Windows is one of the only big non-Unix operating systems out there. I say ironically, because people seldom bring up the Microsoft eco
by eru 4y ago
Ironically, Microsoft's Windows is one of the only big non-Unix operating systems out there. I say ironically, because people seldom bring up the Microsoft ecosystem as a beacon of adding to diversity.
- frankharv 4y agoDidn't Windows Network stack come from NetBSD? There were many BSD contributions to Windows.. BSD386 was a direct Unix derivative I would argue.
- eru 4y agoOf course, Windows (and especially Windows NT) learned and borrowed from the Unix world. But it retains a distinct personality and lineage.
- smegger001 4y agoCorrect me if i am wrong but isn't the NT design heavily based off of (some would say a rip off of) VMS, Microsoft having poached much of DEC's OS dev team including chief architect David Cuttler.
- seabrookmx 4y agoYes, and DOS inherited things from older DEC operating systems like TOPS10 (which IIRC was the first occurrence of using /forwardslash options on the command line).
- skissane 4y agoMany are under the mistaken impression that DOS got forward slash as an option character from CP/M or from IBM. CP/M denoted options using square brackets, and IBM mainframe operating systems generally indicate options using parenthesises. (The usage of square brackets appears to be a modification of IBM's approach; I'm not sure why Gary Kildall made that change – before creating CP/M, he'd used IBM CP/CMS at the Naval Postgraduate School, which likely influenced both this option style, and also drive letters.) My own reconstruction of what I think happened (this was all before I was born, I'm just making some inferences based on what I know about the topic) – Microsoft was heavily influenced by DEC operating systems (Bill Gates and Paul Allen wrote the first version of Microsoft Basic on a PDP-10). Microsoft didn't like CP/M's native option syntax, so for their development tools for CP/M, they adopted a DEC-style option syntax instead. Since many ISVs used Microsoft's development tools, a lot of third party software on CP/M ended up using the same option syntax too. Tim Paterson at Seattle Computer Products was influenced a lot by Microsoft (even before he worked for them), so QDOS/86-DOS/PC-DOS/MS-DOS ended up with the DEC/Microsoft-style forward slash as an option character. When DOS 2.0 came around, Microsoft wanted to switch it to dash/minus, for better Unix/Xenix compatibility. In support of this, they added a CONFIG.SYS setting SWITCHCHAR= to let you choose between forward slash and dash/minus, and an API (INT 21,37) to get/set that config setting at runtime. However, it was decided that the backward compatibility cost of that change was too great, so they pulled the feature from the documentation (although it still existed in the code; in later DOS versions, they disabled the ability to change it to anything other than forward slash, but the undocumented API to get the setting was never removed.)
- pdpi 4y agoThere is the old joke that, when you increment each letter in VMS, you get WNT.
- smegger001 4y agosimilarly HAL from 2001 Space Odyssey is IBM with each letter decremented by one.
- quonn 4y agoAnd HAL is an important component of WNT.
- jpgvm 4y agoConsidering David Cutler was instrumental in both VMS on the VAX and then eventually Windows NT this isn't so much a rip off as a continuation.
- skissane 4y agoMicrosoft's Unix derivative, Xenix, was a big influence on DOS 2.0, in particular the concept of directories, path name syntax, and replacing the CP/M-derived FCB API for file I/O with Unix-style file handles. That influence endures all the way from DOS 2.0 up to Windows 11. People talk about Windows NT being influenced by OpenVMS, via Dave Cutler – the influence is very obvious in some areas (e.g. asynchronous IO), but path name syntax is one area in which Windows is much more influenced by Unix than by OpenVMS (even considering warts such as drive letters, support for backslash instead of forward slash, and reserved file names such as NUL and CON.)
- pjmlp 4y agoOther influence from OpenVMS is how many of those API surfaces look like, when I looked into OpenVMS documentation for the first time on during my digitial archeology, somehow it felt familiar territory.
- deleted 4y ago[deleted]
- pjmlp 4y agoYes, although it was rewritten on Windows Vista, the NetBSD is no longer part of Windows.
- HeckFeck 4y agoThe Windows XP source tree contained various Unix utilities that were ported to Windows. Eg, Perl, Vim, Vi, wc, cat. Imagine if they made it into the public release.
- pram 4y agoThe hosts file in Windows is still called etc/hosts which I’ve always found amusing ;P
- dboreham 4y agoDo you have a reference for that? I remember that many TCP implementations were derived from the Reno/Tahoe tape source, but I hadn't heard until now that this included NT. Iirc that work was done by or managed by J Allard.
- cesarb 4y agoYeah, I'd say that the network stack on Windows is not an example of a non-Unix design. And there are other bits and pieces here and there that show some Unix influence (like the hierarchical filesystem). But on the whole, one can clearly see that Windows comes from a different heritage.
- a-dub 4y agofun fact: early versions of windows nt included some libraries/runtimes that made it posix compliant. the sockets api was modeled after berkeley and the libc itself is posix compliant to this day, i believe.
- rahoulb 4y agoAs I remember it (and I had no inside knowledge, I was just an application developer who read the docs), NT was supposed to have 3 distinct APIs for interfacing with the kernel: the POSIX subsystem, Win32 for compatibility with Windows and the next-generation OS/2 API. Then IBM and MS fell out and Microsoft put all their resources into Win32.
- skissane 4y agoWindows NT was originally supposed to be "OS/2 3.0". Then IBM and Microsoft broke up. However, Windows NT did actually have those three APIs – the Win32 subsystem (which also incorporated Win16/DOS support), the POSIX subsystem, and the OS/2 subsystem. But the POSIX and OS/2 subsystems were always rather half-baked, and never saw that much use. The OS/2 subsystem was removed in Windows 2000; it only ever supported OS/2 1.x apps, and only character mode unless you purchased a separate graphics mode add-on from Microsoft. The POSIX subsystem was not removed until Windows 8.1, although by then it had changed its name to "Subsystem for Unix-based Applications", and had grown a lot compared to the original NT 3.x POSIX subsystem. WSL is effectively the replacement for the POSIX subsystem, however its implementation is very different (which is true of both WSL1 and WSL2, despite the fact that they are also very different in implementation from each other.)
- a-dub 4y agonotably the actual subsystem wasn't really necessary, if i recall it was some poorly implemented stubs for unix style system services. (think a backend for functions like getpwnam) the important part was the posix api functions that made porting unix daemons that had been written in c/c++ to nt pretty easy. there were some quirks around shared memory/mmap, getpwnam, the sockets api and threading support, but beyond that doing a port was pretty easy. the work there was plugging into the service control and event logging apis. and doing an installshield, that was no fun.
- sanxiyn 4y agoI respect Windows for saying no to a hack that is fork. Fork is just bad design and no software should use it, and thanks to existence of Windows, lots of software avoid use of fork, which is a big plus to software ecosystem as a whole. Thanks to Windows, new operating systems like Fuchsia can also avoid fork.
- lcuff 4y agoI don't know enough to understand why fork is a bad design. Can you say some about what problems there are?
- sanxiyn 4y agoMicrosoft people explained it better than I could, so I link to their explanation: https://www.microsoft.com/en-us/research/publication/a-fork-in-the-road/ https://www.microsoft.com/en-us/research/publication/a-fork-...
- lcuff 4y agoThanks: Very informative.
- sanxiyn 4y agoFor Linux kernel's viewpoint where they are trying something new (io_uring_spawn) due to fork's problems, see https://lwn.net/Articles/908268/ https://lwn.net/Articles/908268/
- oconnor663 4y agoThe paper that sanxiyn linked is a great read. My summary is that forking and multithreading are a terrible mix. You have two bad options: - Duplicate all threads. No one does this because it would be total chaos. If another thread was writing to a file or a socket, parts of those writes might happen twice, etc. - Duplicate only the calling thread. This isn't total chaos, so everyone does this, but this also sucks. Any locks that were held by any other threads will never be released in the new process, so you need to make sure not to touch any locks at all post-fork. But that's a huge restriction, because e.g. malloc() touches locks sometimes. Code that runs post-fork ends up being as restricted as code that runs in signal handlers.