Live data from Hacker News

DOS Subsystem for Linux

github.com

181–182 of 182 posts

Re: DOS Subsystem for Linux

#181
post #23

Earlier quoted context omitted.

No, because this is running Linux on DOS.

Thanks, I thought it is running DOS under Linux before I saw you comments.

It is, actually. It just happens to be the same DOS that was running before Linux was started.

Re: DOS Subsystem for Linux

#182

Earlier quoted context omitted.

> And of course WSL2 isn't a subsystem anymore, but is stuck with the product name 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 sysc…

Aren’t you describing personalities instead of subsystems?

Windows NT user mode code is divided into programs and subsystems.[1][2] Programs are the actual applications/utilities/etc you run. Subsystems are OS components executing in user mode, generally composed of DLLs and server EXEs which expose LPC services (a little bit like Unix daemons).

There are two types of subsystems – environment subsystems (which provide APIs to programs) and integral subsystems which provide services to the environment subsystems. Integral subsystems include the security subsystem (lsass.exe). (Sources are a bit unclear about whether there is one "integral subsystem" composed of multiple parts, or multiple integral subsystems – e.g. are lsass.exe and smss.exe separate integral subsystems, or two subsystems of the integral subsystem???)

There are three environment subsystems in Windows NT – Win32, POSIX and OS/2, although the latter two have been discontinued in newer versions. The design was always open to adding more (e.g. maybe an OpenVMS subsystem) but that never happened in practice. (Win32, despite its name, doesn't just run Win32, it also runs Win16 and DOS; also, in practice the POSIX and OS/2 subsystems were dependent on the Win32 subsystem and borrowed functionality from it, despite in theory being independent of it. csrss.exe, despite having "subsystem" in its name, is not a separate subsystem, but rather the primary LPC server for the Win32 environment subsystem.)

The term "personality" is sometimes used to describe the environment subsystems, but it is not the term the Windows NT developers used. The term "personality" actually comes from Mach. The idea with Mach was that existing operating systems could be ported to run on top of the Mach microkernel through layers called "personalities" which would map the existing OS API to the underlying Mach API. The original CMU Mach team built such a layer for BSD Unix – the BSD personality – and it actually survives in XNU (macOS/iOS/etc), but they never implemented any other personalities. However, IBM's abortive Workplace OS project actually did implement an OS/2 personality for Mach, which could run alongside an AIX personality, so they actually got closer to delivering on CMU's original vision (albeit the whole project was cancelled before being fully released.) Possibly, NT's environment subsystem idea took some influence from the Mach personality concept; plus, outside observers quickly noticed the similarity between NT environment subsystems and Mach personalities, and started using the term "personality" for the former; but it has never been the officially preferred terminology for Windows.

I've never heard anyone call WSL1 an "environment subsystem". Its method of implementation is very different from the classic NT environment subsystems. You might call WSL1 or WSL2 "personalities", but as I said that's never been official Windows terminology.

[1] https://en.wikipedia.org/wiki/Architecture_of_Windows_NT

[2] http://vig.pearsoned.com/samplechapter/0201791064.pdf

Post reply on HN