top | item 24555689

DOS Subsystem for Linux

328 points| geocar | 5 years ago |github.com | reply

180 comments

order
[+] tbodt|5 years ago|reply
Since it's not entirely clear: this works by loading a Linux kernel into unused memory, saving the current state of DOS, turning over control of the computer to Linux, then having the init process start a new that uses the vm86 system call to resume execution of DOS.
[+] userbinator|5 years ago|reply
That is actually not far from how the kernel of the Win9x series (and also Win3.x on a 386) is structured --- a "hypervisor"-like kernel runs DOS and Win32 applications in "virtual machines" using the V86 mode of the processor. In Win386/9x, that kernel is known as VMM32. In this case, it's the Linux kernel. It's very interesting to see these "chimeric" OSs appear.
[+] derekp7|5 years ago|reply
If I recall correctly, there was at one time a Linux boot loader that ran from DOS, which could make use of DOS device drivers. I recall using Yggdrasil Linux which had an option to boot this way, which used the DOS driver for my SCSI card and CDROM drive to make it available under Linux.
[+] bitwize|5 years ago|reply
That was LOADLIN. When coupled with a Linux filesystem called umsdos, it allowed you to boot Linux without repartitioning your disk or clobbering your MBR. Fun times.

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.

[+] incanus77|5 years ago|reply
Still is: http://distro.ibiblio.org/baslinux/

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.

[+] Narishma|5 years ago|reply
I used to use that when I had a sound card that was not supported in Linux. I would load the drivers from DOS which provided Sound Blaster compatibility, then boot Linux from there.
[+] mixmastamyk|5 years ago|reply
Netware servers used to use DOS as a bootloader too.
[+] plus|5 years ago|reply
There are a ton of comments here that seem to be misunderstanding what this software is. This creates a WSL-like environment on a DOS host system. It does not create a DOS environment on a Linux host. I'm not sure where this misunderstanding even comes from; the name is perfectly analogous to WSL.
[+] iherbig|5 years ago|reply
I would imagine it's because WSL is a terribly confusing name itself for a lot of people.

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.

[+] rcoveson|5 years ago|reply
They're both phrased unnaturally, IMO.

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"?

[+] jlgaddis|5 years ago|reply
The poor naming convention goes back ~20 years or so to (at least) "Windows Services for UNIX" (SFU) [0]. The naming was not intuitive then and it still isn't today.

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

[+] petercooper|5 years ago|reply
I know what it means and what way round it is now due to repetition, but WSL struck me as a weird name and confused me at first.

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.

[+] gravitas|5 years ago|reply
Grammatically, I read the title and thought "yes! finally a way to run those Dell firmware updaters instead of using FreeDOS boot sticks" and then read the comments to find out it's backwards in nature. The phrase is "bad English" in a colloquial sense.
[+] ogre_codes|5 years ago|reply
Next up is Microsoft's browser: Windows Subsystem for HTML
[+] mattnewton|5 years ago|reply
It’s because the WSL is confusing and doesn’t follow english naming conventions. “X subsystem for y” reads left to right as X is an adjective describing the subsystem, and for seems to indicate y is the platform that X subsystem is for.

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.

[+] freedomben|5 years ago|reply
Indeed, this confused me as a Linux user who hasn't used Windows in over a decade (and therefore is unfamiliar with the terminology). Thank you. I was reading this as a potential DOS Box alternative to run on Fedora.

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 :-)

[+] shmerl|5 years ago|reply
Why not compare it with Wine instead?

Besides, latest WSL is not like that anymore, it's a hypervisor running a VM now.

[+] shmerl|5 years ago|reply
It says "DOS subsystem for Linux". The way I'm reading it:

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.

[+] jjgreen|5 years ago|reply
"WSL" is Windows Subsystem for Linux is obviously from the old Services for Unix used to bait-and-switch people to NT, and the grammar in the latter is irrelevant, the meaning of "SFU" is clear.
[+] dboreham|5 years ago|reply
The misunderstanding comes from choosing a name for it that stongly implies it is not the thing that it is.
[+] antihero|5 years ago|reply
Would prefer me some LSD to be honest.
[+] m463|5 years ago|reply
Maybe it's wishful thinking that the embracing and extending can be recursively embraced. :)
[+] em-bee|5 years ago|reply
i think the confusion comes from the phrase "for those who prefer a DOS environment".

maybe it could be phrased as "for those who want linux but need to run DOS as their main OS"

[+] xpressvideoz|5 years ago|reply
Yeah, I got that too. It was clear that the name was a parody of WSL.
[+] gabereiser|5 years ago|reply
I've been fielding these questions all day. Saying the same thing. It's for "DOS" so you can run _bash_. Ok? People got all excited for Prince of Persia... smh. +1
[+] maple3142|5 years ago|reply
Just wondering. Since "Windows subsystem for Linux" is running Linux on Windows, shouldn't it be named "Linux subsystem for DOS"?
[+] dguaraglia|5 years ago|reply
This used to be the best way to try Linux before live CDs became a thing. The first Linux distro I ever used (DragonLinux) was 'installed' by unzipping an 8mb zip file and running a BAT file. You could 'uninstall' it by deleting the directory it created next time you booted into DOS.
[+] phendrenad2|5 years ago|reply
So does this run DOS on Windows? Or DOS on Linux? Or Linux on DOS? Or DOS on Linux on Windows? Would be nice if there were an explanation in the README.
[+] smogcutter|5 years ago|reply
“Your scientists were so preoccupied with whether or not they could, they never stopped to ask if they should.”

-Dr. Ian Malcolm

[+] panpanna|5 years ago|reply
I guess someone had to ask this...

Does it run under WSL?

[+] kentonv|5 years ago|reply
Well, no... WSL runs Linux inside Windows. DSL runs Linux inside DOS. So there's no stacking that makes sense here.

(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...)

[+] lproven|5 years ago|reply
So this is basically the equivalent of a non-dedicated Netware 2.x server, then?

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?

[+] Zardoz84|5 years ago|reply
This remember the days when I started SuSE Linux 5.1 with loadlin
[+] shmerl|5 years ago|reply
> DOS Subsystem for Linux

> 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?

[+] kencausey|5 years ago|reply
Note: if you edit the post before the time limit passes you can fix the casing of Dos.
[+] shirro|5 years ago|reply
Many years ago we used to run loadlin under dos to load linux and dosemu under linux to run dos. And by many I mean before Windows 95. And ofcourse if you wanted the worst of both worlds there was cygwin.
[+] baumatron|5 years ago|reply
For those unfamiliar, confused, or otherwise opposed to the naming of the Windows Subsystem for Linux, I would highly suggest reading chapter 2 of Windows Internals: Seventh Edition, which describes how Windows supported POSIX and OS/2 through its "subsystem" model, and how WSL fits into that model and what additional changes were required. The naming of "Windows Subsystem for Linux" makes perfect sense in this Windows OS centric context.
[+] fsiefken|5 years ago|reply
So I would love to know if I could run Win98SE/ME and SSH into the native running Linux with this. Perhaps I'd actually prefer that over running Windows10 with WSL2. One problem would be modern browser support for Win98SE so I would need to use an Windows X client to start the linux based browser.

Come to think of it, perhaps you could run Wine to run dos, filemanager/explorer and control panel to emulate the Windows98SE experience.

[+] anthk|5 years ago|reply
It could be useful for DOS users who want to run Nethack 3.6.6 under Linux.

Altough running Nethack under Minix 2 would be easier.

[+] thrownaway954|5 years ago|reply
i saw a youtube video the other day entitled "why learn asm in 2020", i guess for doing something like this.

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.

[+] necovek|5 years ago|reply
In a way, DOS was a perfect platform to learn tinkering with. .COM files were basically pure machine code, and DOS would execute them directly.
[+] Noxmiles|5 years ago|reply
If you take the abbreviation style from Microsoft...

Windows Subsystem for Linux -> WSL

Linux Subsystem for DOS -> LSD

I like it!

[+] basementcat|5 years ago|reply
Great news! When people complain about my code I can just say I wrote it on LSD.
[+] merlinscholz|5 years ago|reply
Except that it's the DOS Sybsystem for Linux, not the other way around
[+] anonymousisme|5 years ago|reply
I love this! It exemplifies the absurdity of making Linux a subsystem of Windows (a far less powerful OS) by doing the same thing with DOS!