The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: Grant Taylor <gtaylor@tnetconsulting.net>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Groff on Windows (for PDF output)?
Date: Thu, 23 Jul 2020 18:35:06 -0400	[thread overview]
Message-ID: <CAD2gp_RFZNLm4nPaqTB3cr0Z7NK_vaN1FNJbRZp5hLmeg+mEnw@mail.gmail.com> (raw)
In-Reply-To: <fc1cb1af-b642-ee70-f0dd-3ae6fd7b6712@tnetconsulting.net>

[-- Attachment #1: Type: text/plain, Size: 2716 bytes --]

On Thu, Jul 23, 2020 at 4:52 PM Grant Taylor via TUHS <tuhs@minnie.tuhs.org>
wrote:


> Do you have any idea how Windows Subsystem for Linux compares to Cygwin?
>   For this use case and / or in general?
>

Very short version:

First, Windows is a layered OS.  At the bottom is the NT Executive, a
fairly conventional kernel.  Running on top of that is the Win32 subsystem
(note that this name is used for both 32-bit and 64-bit windows).  Peers of
Win32 have existed in the past, notably an OS/2 subsystem and a
Posix-compatible third-party subsystem.

Cygwin is a shim DLL that provides a Posix environment to programs running
in the Win32 layer of Windows.  It is fairly source-code compatible with
Linux.  Cygwin programs and ordinary Windows programs can coexist freely.
In particular, they share the same filesystems, and Cygwin programs
understand both Posix and Windows pathnames (where C: is mapped to
/cygdrive/c).  Most Cygwin APIs are implemented using Win32 APIs, but some
require NT Executive APIs.

WSL version 1 is a Linux kernel emulator running on the NT Executive.  It
is binary-compatible with Linux (but not with 32-bit Linux programs) as a
result, and gets special services from the Executive, including lightweight
processes.  (Win32 processes are very heavyweight, which makes long shell
scripts like ./configure quite slow on Cygwin.)  There is an X server
called Cygwin/X; any other X server for Windows can also be used.

Interoperation allows WSL1 to mount Win32 file systems and exec() Win32
programs (the lightweight process is upgraded to a Win32 process).  WSL1
and Win32 share the same TCP and UDP port space.  Unfortunately, a WSL1
program that tries to invoke a Linux kernel operation not yet supported by
the emulator will crash.  The Linux file system is stored in a dedicated
section of the Win32 file system; files stored there can be read by Win32
programs but not written.  There is no X server, but once again Cygwin/X or
alternatives can be used on the Win32 side.

WSL version 2, which is very new, is an ultra-lightweight VM that can run a
Linux kernel.  This means that all kernel services are automatically
provided.  The filesystem is a virtual disk formatted as ext4, which gives
WSL2 much better local filesystem performance than WSL1.  The same
interoperations exist as for WSL1, except that the VM has a different IP
address from the Win32 system, so ports are not shared.  The filesystems
are fully shared through the 9P2000 (yes!) protocol, allowing Linux to
mount Win32 filesystems and vice versa.  Unfortunately the 9P support is
not exposed to users.

This may indeed be the year of Linux on the (Windows) desktop.

(Comments and corrections always welcome.)

[-- Attachment #2: Type: text/html, Size: 3286 bytes --]

  reply	other threads:[~2020-07-23 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 18:33 Doug McIlroy
2020-07-23 20:51 ` Grant Taylor via TUHS
2020-07-23 22:35   ` John Cowan [this message]
2020-07-24  0:13   ` Clem Cole
2020-07-25 14:45     ` John Cowan
2020-07-25 14:55       ` Clem Cole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD2gp_RFZNLm4nPaqTB3cr0Z7NK_vaN1FNJbRZp5hLmeg+mEnw@mail.gmail.com \
    --to=cowan@ccil.org \
    --cc=gtaylor@tnetconsulting.net \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).