
One Windows Kernel - MikusR
https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/One-Windows-Kernel/ba-p/267142
======
detuur
>The most amazing aspect of all this is that the core of Windows, its kernel,
remains virtually unchanged on all these architectures and SKUs.

Is that really such an exciting concept? Maybe I have a poor understanding,
but I've been under the impression that nearly every competing kernel (Linux,
Darwin, *BSD) is exactly like that. The only situation where I can imagine a
slight departure is Solaris and its SPARC architecture, where SPARC had
certain features to specifically to tie in with the kernel but I'm sure it
still compiled to foreign architectures from the same codebase.

~~~
ChuckMcM
Well it is an exciting concept but it isn't as you point out unique.

It was fairly clear in the 80's and 90's there were two 'streams' of systems
programmers, those who started at mainframes and mini-computers and were
making things work on smaller and smaller versions of those machines, and
those who started at the ROM monitor or DOS level type machine and made things
work on larger and larger versions of those machines.

It was stark how differently the two 'types' of people approached operating
system problems.

Windows "crossed over" from being more of a monitor type interface to being an
executive interface with Windows NT at the hands of a former VAX software
architect (which was firmly in the mainframe getting smaller path), and that
cross over happened for the masses when Microsoft merged the NT kernel with
the Window "old tech" kernel in Windows XP as I recall. By the time Windows 7
came around it was pretty much unified for life and has evolved since then.

If all you knew were Microsoft OSes, then yes it is an amazing journey. If
however you had already been experiencing systems like UNIX that ran on
everything from mainframes to PDP-11/70's you would not have been quite so
surprised.

~~~
smacktoward
That's the core irony of the PC revolution. PCs started out with the explicit
goal of being something different than mainframes and minis. But when people
started networking them together, the only way to keep them viable was to
essentially _turn them into_ mainframes and minis, just in different shaped
boxes. So we've gotten to live through 20 years of PC vendors reinventing
things that big-iron users had access to long ago.

~~~
derefr
(The original idea behind) PCs continued to exist long after networking, in
the form of video game consoles. A Gameboy Advance isn't all that different
from an Apple II or an IBM-compatible PC running DOS: both focus on running
one executable and giving it complete control over banging bits toward "rich"
I/O devices, where instead of abstractions over ugly low-level interfaces, the
peripherals have been designed with nice ABIs that _are_ their canonical APIs
(and, until the ARM era, the CPUs themselves were also designed such that
their ISA, as written in macro-assembler, _was_ the canonical "high-level"
language.)

Of course, eventually game consoles became networked too...

~~~
AnIdiotOnTheNet
I think it was Casey Muratori who made the argument that we could return to
having nice ABIs that are canonical APIs, and still have more than one program
running via hardware virtualization features. Then any OS would just be like a
hypervisor managing all of the OS-less VMs that, from their perspective, are
interacting directly with hardware. It was an interesting idea.

~~~
derefr
Heck, you can get away with that today, by just creating a virtualization
platform like Xen, but with much more carefully-thought-out exposed virtio
hypercalls; and then writing unikernels against that interface.

Though, from another perspective, this model is exactly what the
"transitional" era of game consoles did. The Nintendo Wii U, for example,
normally [i.e. during a game] has a unikernel running across two "application
processor" cores, that sees those as the only cores and has direct ownership
of the peripherals; but then the OS [running on a third, separate, low-power
core that the game VM has no knowledge of] can, at any time, force the game VM
into the background with an interrupt, whereupon it must relinquish one of its
two cores, some memory, and not touch the peripherals at all until the OS says
it's okay; and then the OS can use the borrowed high-power application core,
memory, and peripheral-hardware ownership to temporarily foreground an OS
modal GUI, like a game manual or a web browser or an instant message.

Sadly, this was all abstracted, for the game developer, behind an HLL [that
is, C] SDK—which is sadly a "requirement" in the modern era, given that devs
are going to be porting their games to/from PCs.

------
tialaramex
This seems like it's essentially confessing to something we already knew. Back
at the turn of the century Microsoft liked to claim that Windows Server and
the ordinary client NT were different in some important way beyond just the
branding and price. People would even try to argue that Linux couldn't be a
"real" desktop OS because it lacked some kind of secret sauce not found in a
server OS... Hackers eventually found out how to tell a client NT kernel to
behave exactly like Server, because of course they are the same kernel, duh.

Microsoft's reaction was to stop selling the two next to each other. There is
no Windows 10 Server and Windows Server 2019 doesn't have a client version. So
the exact same thing continues, but now there IS no equivalent product to
prove the point that they're identical bar branding and price.

~~~
dblohm7
> Hackers eventually found out how to tell a client NT kernel to behave
> exactly like Server

It was Mark Russinovich who did it with a utility called NTTune. Now he's the
CTO of Azure!

~~~
abainbridge
You mean Mark Russunovich the sci-fi author: [https://www.amazon.co.uk/Rogue-
Code-Jeff-Aiken-Russinovich/d...](https://www.amazon.co.uk/Rogue-Code-Jeff-
Aiken-Russinovich/dp/1250035376/ref=sr_1_5)

That Azure stuff is just his hobby.

------
SEJeff

        Windows is one of the most versatile and flexible operating systems out there, running on a variety of machine architectures and available in multiple SKUs.
    

Linux, BSD, Darwin... You support a dozen architectures? How adorable.
_condescendingly pats head_

~~~
cyphar
> You support a dozen architectures?

And they only support four (x86, amd64, ARM, ARM64)! This is quite a cute
thing to mention after saying you're "one of the most versatile and flexible
operating systems". Ignoring the obviously qualifying language of "one of the
most", I would argue it is still false -- virtually every mainstream operating
system I can think of supports more architectures than this. Here is my
quickly-put-together list:

    
    
        * Linux: 25.
        * MINIX: 15.
        * OpenBSD: 13.
        * FreeBSD: 7.
        * Windows: 4.
        * illumos: 3 (with arm* in development).
        * Darwin: 2.
    

_What an achievement._ Now -- don't get me wrong, Windows has done a lot of
things, but they have set the parameters of this comparison and they don't
fare well in it (even if you get past the qualifying language over a
comparison that they decided to make).

~~~
gaius
_they only support four (x86, amd64, ARM, ARM64)_

To be fair, NT shipped on x86, PPC, Alpha and MIPS. There was a never-released
version for SPARC. It was originally developed on the i860. Wasn’t later
Windows also available on Itanium too?

MS cut down on their list of supported CPUs for commercial, not technical
reasons.

~~~
cyphar
Linux also supported more architectures in the past that I haven't included in
my count (same for the BSDs too). If you updated the count with all
architectures ever supported by the platform then I have doubts that it would
change the ordering significantly.

------
Sharlin
I wonder what it would cost to purchase an Oracle license for that 1792 core
instance.

~~~
teddyh
The answer is: Whatever amount of money which Oracle’s sales and customer
research teams determines that you can barely afford to pay.

~~~
TimTheTinker
It seems to me like Oracle has figured out a sort of secret formula for making
a lot of money through shrewd business practices while managing to avoid the
public hatred Microsoft and IBM attracted when they did likewise.

Perhaps because they market to business leaders who could stand to lose a lot
if Oracle unleashed the legal hounds?

~~~
jake_the_third
> Perhaps because they market to business leaders who could stand to lose a
> lot if Oracle unleashed the legal hounds?

I think so. But that doesn't seem like it's going to remain a viable business
model for too long. Those who are forced by their bosses to work with Oracle
today, are going to be the bosses of tomorrow. I personally know a company
where anything oracle is explicitly blacklisted because of this reason.

Eventually, Oracle is going to run out of their oblivious- executive-type
customers. (inc. govs)

~~~
ibejoeb
>Eventually, Oracle is going to run out of their oblivious- executive-type
customers

Perhaps some are oblivious, but not in general. At some point, when one gets
busy enough, convenience and reliability trump bargains.

I know I can replace the backlight on my macbook, but I'm still going to the
Apple Store. I know I can save 15¢/gallon at a gas station a mile away, but is
it really worth the time and energy to do it at that price? That's why I buy
Oracle and just about everything else.

~~~
TimTheTinker
> convenience and reliability

Modern cloud hosting usually provides all of the above you need. Is a
PostgreSQL DB in Azure really any less reliable or convenient than an Oracle
DB? Perhaps if you’re already heavily invested in and comfortable with Oracle,
but I don’t think so otherwise.

~~~
grumpydba
Oracle still runs circles around postgres for high availability, backups and
management tools. However most big companies are slowly migrating all their
small Oracle instances to pg. I happen to work in one of those companies who's
had enough with Oracle's outrageous pricing schemes and audit threats.

~~~
_asummers
What do you mean by audit threats? I’ve never had the misfortune of working
with Oracle software besides Java.

~~~
grumpydba
"Buy our new cloud offering or we run a license audit now as our contract
permits" You have to find a way to give good cloud numbers for Larry!

------
urda
The Windows Kernel is an insane engineering feet by itself, so getting to see
how the inner components mesh in articles like these always fascinates me.

------
zeptomu
So ... how long until Windows becomes just a Linux distribution similar to
Android? 8 years? Sooner, later?

~~~
pjmlp
Windows is most likely to become another mainframe like OS, with its multiple
execution personalties than yet another a Linux distribution.

Just like IBM i, IBM z, ClearPath are their own thing, and can also run Aix,
Windows and GNU/Linux on top.

------
mschuster91
Is it possible to "backport" the Kernel (and other parts, such as the WSL,
with it) to Windows 7?

I'd like to have a modern Windows, but with the "classic" UI and no forced
ads/bloatware/crapware. And yeah I am aware of W10 LTSB but it's not legally
available for 99% of users.

edit: Looks like the post attracted a bit of a flamewar. Originally, I just
wanted to know if this was technically feasible or not.

~~~
21
Same old story.

When XP came out, people were moaning that it looks like shit and how they
wanted the XP kernel, but the 2000 look.

When Vista came out, same thing again, all that Aero looks like shit, disable
it so that it looks like XP classic.

Now 10 comes out, same story, looks like shit, we want it to look like 7.

You should think deeper to see what drives this desire of yours. I bet that
when Vista came out with the Aero look, you felt like it's shit forced on you,
and you wanted the XP classic look. Now you want the Aero look that you once
hated. Ironic, isn't it?

~~~
kitsunesoba
Win2K to this day remains my favorite Windows release. It was just so clean
and practical. It had its frustrations (setting up a Win2K/WinXP/Win7 system
from scratch was always a task and a half, with all the driver installs and
updates involved) but once you got it set up it was great.

XP/7 aren’t bad but they definitely felt more gimmicky.

~~~
romed
I’m still carrying a Win2K Pro image around in VMware. It runs all the windows
software I need (and this is the right way to choose an operating system IMO)
and if it gets screwed up I can always blow it away and revert to the snapshot
that’s got all the service packs installed.

~~~
kitsunesoba
What software would that be, if you don’t mind my asking? I was under the
impression that Win2K support had been dropped from most software several
years ago.

~~~
romed
EDA and CAD programs. Expensive software but I don’t need the vendors’
“support” so their thoughts on my operating systems are not important to me.

------
andrewstuart
I wish they had the courage to get rid of the registry.

~~~
orf
And replace it with?

~~~
MisterTea
How about a file system? Because that is precisely what the registry is, a
file system in a file. The keys are just paths to a variable which can be a
text or binary file.

And people who suggest SQL or another monstrous abstractions as an
implementation need to take a step back and apply the idea of philosophical
simplicity to their work. I honestly don't understand why people have this
tendency to over engineer simple problems. I suppose it helps during review
time.

~~~
orf
It has a few more types than that[1]. While the registry is not exactly super
elegant and suffers from issues I think it's a pretty simplistic answer to a
complex problem, especially one rooted in history and rife with backwards
compatibility concerns (windows still supports the legacy format used only in
Windows 2000!).

People who sit back and say "replace it with text files/sqlite" don't really
understand it or the problem it solves that well.

Using the actual file system brings in file system concerns - how do you
handle registry transactions or concurrent updates?

1\. [https://msdn.microsoft.com/en-
us/library/windows/desktop/bb7...](https://msdn.microsoft.com/en-
us/library/windows/desktop/bb773476\(v=vs.85\).aspx)

~~~
grumpydba
Well text files work perfectly fine for unix/linux. And the installation
process is infinitely less painful.

~~~
jodrellblank
They don't work perfectly fine.

Random inconsistent locations, random inconsistent rules for inclusions and
imports, Random ill-documented ad-hoc formats, no standard interfaces to
add/remove/set config values, no ability to put ACLS on individual config
entries, basically no way to export and re-import or auto-merge partial
config, without at least screwing up whitespace and comments or risking
duplicates, no ecosystem wide single 'source of truth' pattern.

They work, but they're not nice.

~~~
grumpydba
I've never seen one using acls on registry keys. I have however seen several
config files for the same program with different permissions. Think
.ssh/config or /etc/sshd_config. For your partial config / single source of
trust please refer to ansible.

------
Annatar
"This is a picture of Windows taskmgr running on a pre-release Windows
DataCenter class machine with 896 cores supporting 1792 logical processors and
2TB of RAM!"

Reminds me of an UltraSPARC T5 server with 3072 processors I used to work
on... from five years ago. Old tech, eh?

------
antiwin32
How is it possible to have CPU with 100% of usage and Memory at 0% of usage at
this screenshot (Task Manager showing 1792 logical processors)?

~~~
SteveCoast
It was a 2Tb of RAM machine I think? So 0.49% of that would be 9.8Gb? Plenty
of space and it would still be "0%" used.

~~~
irfanhamid
How come out of 1TB 9GB is 0%?

~~~
saagarjha
Rounding. 0.49% rounds down to 0%.

------
matachuan
C'mon. Not even your own Drawbridge project is supported in Windows...

~~~
pjmlp
Have a look at WSL pico-processes, device guard, and secure kernel support.

------
partycoder
Forgot to add the line count of backdoors and stupid absurd shit like
processing fonts on the kernel rather than userland so people can hack your
896 core machine and mine bitcoin.

~~~
crumbshot
Your claim of backdoors is nonsense of course, but the kernel mode font
handling was indeed a security risk. However on recent releases of Windows,
they changed font parsing to run in a user mode sandbox: see the "Mitigating
font exploits with AppContainer" section of
[https://cloudblogs.microsoft.com/microsoftsecure/2017/01/13/...](https://cloudblogs.microsoft.com/microsoftsecure/2017/01/13/hardening-
windows-10-with-zero-day-exploit-mitigations/)

------
karmenblack
I wish Windows kernel been optimised for a given architecture. It is one of
the examples where "one fits all" doesn't work. Even if Intel or AMD bring
another grounbreaking generation of CPUs - giving mighty 5% increase in
performance - it is all for nothing, because it gets eaten up by Windows
poorly written guts. I don't know what kind of monster machine you need
nowadays to watch YouTube video without audio breaking up or without having to
dedicate one core just to handle the mouse.

