328 points · by geocar · 6y ago · 180 comments
It includes:
> As you might suspect from its name, the virtual machine manager created virtual machines. Inside the first virtual machine ran a copy of Standard mode Windows. ... The other virtual machines each ran a copy of MS-DOS and were responsible for your MS-DOS sessions. ... It’s kind of stunning to realize that Enhanced mode Windows was really a completely new operating system with multiple virtual machines, pre-emptively multi-tasked with virtual memory.
I think it's quite interesting that, on that version of Windows, all the Windows programs were only cooperatively multitasked while all the DOS programs were pre-emptively multitasked.
Umsdos overlaid a POSIX file system on top of an MS-DOS file system, using a scheme somewhat similar to Windows long filenames (but created before that became a feature of Windows). Basically, every directory would have a magic file called --LINUX-.--- that contained POSIX file data, including full filenames and permissions.
I'm using it currently on a 386SX with 8MB of RAM (not to post this, however).
Edit: Ah, this doesn't do the driver bit. But it works pretty well in itself.
There are two ways to read "Windows Subsystem for Linux":
1. This is a subsystem that runs on Windows that enables Linux binaries.
2. This is a subsystem that runs on Linux that enables Windows binaries.
The confusion comes in the fact that when I write those two sentences, I naturally want to write "This is a subsystem FOR Windows..." or "This is a subsystem FOR Linux... ." I had to consciously avoid using "for" in that sentence to highlight the problem.
So when someone who doesn't know what the thing does reads "Windows Subsystem for Linux" they may walk away with the false impression that the subsystem allows Windows binaries to run on Linux. Likewise, what you're seeing now is that people are seeing "DOS Subsystem for Linux" and thinking that this enables you run DOS on Linux.
And of course WSL2 isn't a subsystem anymore, but is stuck with the product name. ¯\_(ツ)_/¯
So the proper name would be "Windows Linux subsystem", but I concede that it does sound really weird (because both Windows and Linux are the same kind of things, they're OSes).
And of course, if it was named "Windows's Subsystem for Linux", there would be much less confusion, but apparently the English for some reason doesn't use the possessive case here (although that's the perfect place for it) and prefer to use the noun as a possessive adjective.
Even WSL1 is not a classic Windows NT subsystem. Its implementation (picoprocesses) is quite different from that of the classic Windows NT subsystems (Win32, OS/2, POSIX/Interix/SFU/SUA). The classic Windows NT subsystems all involve using ntdll.dll to make NT syscalls; WSL1 processes make Linux syscalls and can't actually make NT syscalls or call ntdll. There is nothing technically stopping an OS/2 1.x executable from realising that it is running on NT and start talking to the NT kernel using the normal NT API; by contrast, a Linux executable running under WSL1, even if it detects it is running under WSL1, isn't allowed to talk to the normal NT kernel interfaces.
It does work if you assume it's a shortening of something like "Windows Subsystem for Running Linux Applications (on Windows)"
But I get that naming it is a tricky problem, because even a technically accurate name like "Windows Linux Subsystem" (after the old 'Microsoft POSIX Subsystem' name) is still confusing.
"Windows Subsystem for Linux"
-----
Is the 'windows subsystem' for linux?
or is the 'subsystem for linux' a windows branded feature?
If you asked most people they would probably choose incorrectly.
Linux Subsystem on Windows
Linux Subsystem in Windows
- vs -
Windows Subsystem (for Linux)
is probably closest to WSL1’s intent.
It was a Windows subsystem (the first new one in years), and its goal was to let you run Linux apps.
They used to have a product called Windows Services for UNIX [1] which was, you guessed it, UNIX Services for Windows: NFS, Telnet, cron, rsh, etc.
"Windows' Linux Subsystem" might have been better as well (WLS), using it as a posessive statement, or "Windows' Subsystem of/with Linux" which would keep the same WSL abbreviation.
The suffix "for Linux" strongly implies it's software for use on Linux. It's like the "4j" and "4win" suffixes, implying software built for the Java and Windows environments, respectively.
What's more, Windows or DOS as an adjective of subsystem bind more tightly than "for Linux". So if you were to start dropping parts of the name, you'd drop "for Linux" first. Except you can't, because then it's just the Windows Subsystem.
LSW would have been a much more natural name. In a conversation about Windows subsystems, you could refer to it as the Linux Subsystem. If other operating systems picked up on the idea, they would have their own Linux subsystems, e.g. Linux Subsystem for macOS. If you wanted to check if your OS had anything like it, you could search "is there a Linux subsystem for FreeBSD?" Which might turn up results about the Linux ABI in FreeBSD. Speaking of which, imagine if it had been named the FreeBSD ABI for Linux. What an awful pattern! You can't even repeat the pattern unless both modifiers are proper nouns! Could you have called the VFS Subsystem the "FreeBSD Subsystem for VFS"?
This is why we teach sentence diagramming in elementary school.
Maybe the person who came up with "WSL" wasn't a native English-speaker?
In this case, the context known to the speaker but often missed when trying to "sentence diagram" WSL involves the part "Windows Subsystem". That referent, to which the original author was quite familiar, is invoked in WSL as a single noun in part of the larger noun phrase, and while you could continue to sentence diagram break "Windows Subsystem" into constituent parts here, it is important to remember it as a single connected "atom" to which "for Linux" modifies in the overall noun phrase of "(Windows Subsystem) for Linux". Given that context/referent, the sentence diagram here is unambiguous to the original team/"speaker". It's the audience with much less familiarity with the referent/context in question that has ambiguity problems in trying to "sentence diagram" the noun phrase.
My belief (!!), back then, was that it was intentionally named confusing. Back when it came around, Microsoft was under scrutiny for monopoly behavior. They didn't want Windows to be compatible with Unix in any way; they wanted the world to run Windows (9x, NT) only. That was my belief/theory, as it is now I don't have anything to back it up as it is though. Your theory might equally be viable.
The "problem" is that these products are not what you automatically assume they are!
To illustrate: SFU provided NFS and NIS servers, a cron daemon, a telnet server, and various CLI "utilities" (i.e., standard "services" provided by "UNIX") running on Windows -- not Windows services that run on UNIX!
Once you know that, the "Windows Services for UNIX" name kinda makes sense and helps to understand what the "Windows Subsystem for Linux" and, now, the "DOS Subsystem for Linux" actually are.
---
[0]: https://en.wikipedia.org/wiki/Windows_Services_for_UNIX
Usually, saying "for Linux" or "for Windows" about something means there's a thing that is for (or "to run on") Linux or Windows, not that the thing is "of" Linux or to enable the use of Linux. I appreciate there are two ways to look at the semantics, but the one they picked for WSL seems the least common one to me.
Instead it’s seemingly meant to be parsed inside-out with “subsystem for Linux” as one noun indicating a subsystem that runs Linux apps, and DOS as an adjective describing that noun. Maybe wsl did it to keep the windows brand first? Are there many other “windows subsystems for Y” out there and this is a Microsoft-universe term? I don’t know but it’s very strange.
If the project maintainer is reading, it would be super helpful to put that at the top of your REMADME.md. I'll even send you a PR. FTR it's not your fault the terminology is confusing :-)
Besides, latest WSL is not like that anymore, it's a hypervisor running a VM now.
1. It's for Linux (so Linux is the host).
2. It creates some subsystem that runs DOS (either emulated, virtualized or translated like Wine is doing for Windows on Linux).
That can allow running DOS games on Linux for example, instead of using DOSbox for it.
maybe it could be phrased as "for those who want linux but need to run DOS as their main OS"
What about DOSBox?
On a more serious note, the hack described by the author [0] is quite ingenious.
Yes, that is correct. Windows Subsystem for Linux means it's one of Windows' subsystems which provides linux.
This should be called Linux Subsystem for DOS.
So what's different?
I put inside in quotes because how this actually works is quite amusing (and apparently is actually how Windows 95 also works)
When DSL is first invoked at the command line it boots up the Linux kernel which takes over control of the computer from DOS.
Now here’s the trick: DSL makes use of a processor feature called VM8086 which allows for a 32 bit operating system to run legacy 16 bit code mostly natively. This feature is how early Windows, DOS extenders, etc worked. The Linux kernel also supports VM86, although it is largely undocumented and not really used these days. I think dosemu is the only major user of VM86 on Linux.
DSL then returns to DOS, which has essentially been flipped inside out and is now unknowingly running inside a VM8086 task. Helpfully Linux does not appear to clobber DOS’s memory during its own boot process.
DSL does just enough emulation of hardware like the keyboard to make things work, allowing DOS raw hardware access for everything else. This situation of running two operating systems at the same time on the same hardware is extremely fragile and unsafe of course, but it does seem to work surprisingly well anyway!
- it first, if not yet present, starts Linux, via normal Linux kernel load. It passes over some pointers from DOS into /init arguments so that /init can know about DOS' context when Linux was first loaded
- Linux's /init then uses VM86 [1] to call back into DOS, back to the function that was run in DOS before Linux was loaded (vm86_return). This is a bit of a 'draw the rest of the fucking owl' deal, as it has to actually emulate a lot of DOS/PC behaviour (emulate INB/OUTB, etc). It's basically a small VM, like with KVM, but for 16-bit DOS.
- when DOS wants to run a Linux command, it now uses a special new interrupt (DOSLINUX_INT) to call into the kernel. This in turn triggers a VM86 exit, jumps into the VM86 monitor in /init, executes the command, and pokes the result back into DOS, resuming VM86 emulation.
freedos developers?
people updating HP bios from bootable media
people using intels ssd firmware update tool
You could perhaps argue "inception" since it's Linux running a DOS VM running Linux commands. But the charitable explanation is the author just wanted a convenient environment to do DOS development rather than bare metal (think of it like a Vagrant box).
-Dr. Ian Malcolm
Does it run under WSL?
(I think we're seeing just how confusing the "Subsystem for Linux" naming is. "Foo Subsystem for Linux" sounds like a way to run Foo under Linux, but it's the opposite...)
Indeed.
> a way to run Foo under Linux
"Under" is also confusing since "run X under Y" means the same as "run X on Y" even though it's the opposite analogy.
I suggest everyone stick to "X on Y", e.g. Linux on DOS.
Netware 2 was an 80286 OS. (DOS was an 8086 OS.) https://en.wikipedia.org/wiki/NetWare#NetWare_286_2.x
Normally, Netware took over the whole PC, but if you ran it non-dedicated, it loaded in memory above 1MB (which DOS couldn't use anyway) and then let DOS continue running in a pre-empted box, using the screen and keyboard. So someone could use the console as a DOS PC, while the Netware server ran in the background using the rest of the server's RAM, doing file and print for all the client machines.
It worked really well... the main problem was that the user would often turn off the "PC" when they were done. >_<
More seriously -- this seems to compare well to the old Locus DOS/Merge product: https://en.wikipedia.org/wiki/Merge_(software)
Is there any benefit to DSL [argh, TLA overload, this is not Damn Small Linux] compared to DOSemu?
> A WSL alternative for users who prefer an MS-DOS environment.
Very confusing description. Is it made for Linux? So what does it have to do with WSL which is made for Windows? May be it's a Wine analog for running DOS programs on Linux then or it's actually emulating things like DosBox does?
[0] https://en.m.wikipedia.org/wiki/Unreal_mode
[1] https://github.com/charliesome/doslinux/blob/master/doslinux...
Come to think of it, perhaps you could run Wine to run dos, filemanager/explorer and control panel to emulate the Windows98SE experience.
Altough running Nethack under Minix 2 would be easier.
this project looks really cool. i don't hear a whole lot of people using dos nowadays but for a tinkering around that would be awesome.
hats off to the author. it's amazing one dude could code this.
Windows Subsystem for Linux -> WSL
Linux Subsystem for DOS -> LSD
I like it!
Okay, actually, this is more like VMWare ESX in the 4.0 days. It's kind of, uh, inside out.
Basically it's DOS, which launches Linux via DSL, which then runs a task out of init in vm86 mode that uses KVM to _continue_ the DOS that launched it as if it were the only thing running.
The DOS doesn't know anything has happened, even though the rug has been pulled out from under it, and it is now running in a KVM VM guest. You just can't tell anything is different because all the BIOS/real mode stuff is unchanged.
You get your prompt back when a native Linux binary finishes but it's the linux kernel emulating the DOS session after that first command, until you reboot.
Windows subsystem for linux for DOS. Sounds right