News for hackers. Stuff that matters.
Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @03:52AM (#27758503)
The roadmap as presented by Apple at WWDC 2019 was that after an userspace replacement for a kernel subsystem gets presented, there is one year deprecation until it gets removed from the kernel on the following OS release.

So there is one year to try out what might still be missing and give respective feedback.

The long term roadmap is that macOS will eventually be much more microkernel like.

Re:macOS extensions are moving away from the kernel by AshamedCaptain on Wednesday July 07, 2021 @05:15AM (#27759049)
I am quite sure that we have been other this several times in HN.

The fact that they're no longer going to allow loading of 3rd party kernel modules (a pure political decision) does not a make a microkernel (which is an architectural style).

The kernel is still going to be big and monolithic (it contains the entire BSD kernel in the same address space!), and they're still going to be loading Apple-authorized kernel modules (500MiB of them, according to the article) in the same address space.

Re:macOS extensions are moving away from the kernel by Others on Wednesday July 07, 2021 @12:20PM (#27762842)
How is removing 3rd party kernel modules a “pure political decision”. Do you really believe there are no technical/security factors behind this choice?
Re:macOS extensions are moving away from the kernel by AshamedCaptain on Wednesday July 07, 2021 @06:10PM (#27766302)
What I mean is that it involves a policy setting, but little to no technical change. You cannot create a microkernel just because you declare 3rd party extensions to be banned. In order to classify yourself as a certain architecture you actually need that architecture first.
Re:macOS extensions are moving away from the kernel by jjtheblunt on Wednesday July 07, 2021 @12:48PM (#27763163)
It's an engineering decision : buggy kernel extensions bring down the OS.
Re:macOS extensions are moving away from the kernel by mbreese on Wednesday July 07, 2021 @01:50PM (#27763865)
Agreed. Given the number of times I personally reported a buggy (IT mandated) firewall for crashing my system, I am extremely happy that they moved extensions out of the kernel. The extension makers who wrote poor quality code have only themselves to blame for the situation.

Using a USB network adapter (requires for Ethernet on a MacBook) would bring down my system every time the firewall was running. And the stacktraces all included their calls.

I’m sure Apple, like me, got tired of getting reports about a few known bad actors.

Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @05:23AM (#27759111)
As you wish, I am no longer going to debate the pedantic meaning of pure microkernel ideology.

I rather be happy for the improvements in the long term roadmap and overall outcome for the eco-system.

Re:macOS extensions are moving away from the kernel by AshamedCaptain on Wednesday July 07, 2021 @05:40AM (#27759209)
"Pedantic"?

If you just consider disallowing 3rd party modules to be a "microkernel" all while the kernel itself still loads most if not all (approved) drivers such as PCI bus, storage devices or filesystems in the same address space, then _all_ current major operating systems are "microkernels".

Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @07:34AM (#27759859)
From all pratical purposes for a third party driver writer persona, the only path forward are user space drivers.

What you call a kernel like that?

Re:macOS extensions are moving away from the kernel by Bjartr on Wednesday July 07, 2021 @08:46AM (#27760469)
Non-extensible?

Locked?

"A kernel that only allows user-space third party drivers"?

That this style doesn't have a nifty name isn't a good reason to weaken the established definition of microkernel just so it does.

Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @09:39AM (#27760979)
It is kind of hard to implement a mikrokernel without any kind of drivers on the kernel.

So, then it becomes a balancing act how many are allowed the priviledge to be part of the main act.

Re:macOS extensions are moving away from the kernel by AshamedCaptain on Wednesday July 07, 2021 @09:57AM (#27761165)
> It is kind of hard to implement a mikrokernel without any kind of drivers on the kernel.

Well, that is kinda the point of a microkernel (or at least one of the points).

Sure, you're not going to have a kernel whatsoever without say an CPU/MMU driver in the same address space. Maybe a driver for the timer.

But when you have graphics, sound, storage, USB controllers, filesystems, networking and most of a BSD kernel (providing all the syscalls) in the same address space, now that is not a microkernel by any definition of the word.

XNU is called an "hybrid" kernel in part because in the original design the BSD parts implementing most of the actual system could have been spun off as a separate process (similar to Windows NT's original design), which would have been an actual microkernel, but in practice they were just stuck together in the same process, making it a monolithic kernel in all but name (just like in Windows).

> So, then it becomes a balancing act how many are allowed the priviledge to be part of the main act.

Yes.

Re:macOS extensions are moving away from the kernel by Nursie on Wednesday July 07, 2021 @07:36AM (#27759874)
Tivoised?
Re:macOS extensions are moving away from the kernel by ksec on Wednesday July 07, 2021 @09:05AM (#27760665)
I was under the impression Apple intend to move those ( including their own ) outside as well with NetworkKit and DriverKit?

Which is what pjmlp implies, once they are out, isn't it microkernel?

Re:macOS extensions are moving away from the kernel by AshamedCaptain on Wednesday July 07, 2021 @09:54AM (#27761141)
But they do not plan to move their own out, which is the point. That would require significant rearchitecture.
Re:macOS extensions are moving away from the kernel by robertlagrant on Wednesday July 07, 2021 @06:43AM (#27759513)
> As you wish, I am no longer going to debate the pedantic meaning of pure microkernel ideology.

This isn't pedantic, nor is it ideology. If you're acquiescing, do it graciously and please refrain from name calling.

Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @07:34AM (#27759857)
What a sensible world we live on nowadays, that wasn't name calling in any sense.

From all purposes from a third party driver writer persona, the only path forward are user space drivers.

What you call a kernel like that?

Re:macOS extensions are moving away from the kernel by robertlagrant on Wednesday July 07, 2021 @07:36AM (#27759869)
> What a sensible world we live on nowadays

This is basically calling me silly, just as you were calling the previous person ideological and a pedant. If you cut out this commentary that would be great.

Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @08:39AM (#27760404)
You are the one playing the victim here, I am not attacking anyone.
Re:macOS extensions are moving away from the kernel by robertlagrant on Thursday July 08, 2021 @05:54AM (#27769994)
I don't feel victimised; I didn't mention you attacking anyone. I'm just requesting removing the noise to boost the signal.
Re:macOS extensions are moving away from the kernel by tinus_hn on Wednesday July 07, 2021 @06:09AM (#27759359)
It’s not about pedantry; whatever rules you define for a micro kernel it shouldn’t be rules for thee but not for me
Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @07:33AM (#27759853)
From all purposes from a third party driver writer persona, the only path forward are user space drivers.

What you call a kernel like that?

Re:macOS extensions are moving away from the kernel by vimacs2 on Wednesday July 07, 2021 @11:58AM (#27762572)
A restrictive monolith kernel?
Re:macOS extensions are moving away from the kernel by jen20 on Wednesday July 07, 2021 @09:02AM (#27760623)
> The kernel is still going to be big and monolithic (it contains the entire BSD kernel in the same address space!)

macOS does not use “the” BSD kernel (it’s not even obvious what your assertion even means since there are many members of the BSD family, each with their own kernel - none of which macOS uses).

Re:macOS extensions are moving away from the kernel by AlotOfReading on Wednesday July 07, 2021 @10:03AM (#27761232)
I'd assume they're talking about XNU, which ultimately derives from "the" original Berkeley distribution like all of the other BSDs.
Re:macOS extensions are moving away from the kernel by tyingq on Wednesday July 07, 2021 @12:40PM (#27763076)
Large parts of XNU come from both 4.3BSD and FreeBSD.
Re:macOS extensions are moving away from the kernel by cpach on Wednesday July 07, 2021 @03:58AM (#27758548)
Cool! Very interesting development given how bad reputation microkernels had for a while. (I’m thinking of Linux vs Minix/Hurd.)
Re:macOS extensions are moving away from the kernel by zibzab on Wednesday July 07, 2021 @04:14AM (#27758663)
FYI, Linux userspace drivers were introduced in 2006-2007 and improved multiple times over the years. Some of my filesystem & networking drivers run in usersapce.

The monolithic vs microkernel debate was pretty clueless at times. Core Linux is smaller than dito hurd when configured with similar functionality.

OSX mach has always been a hybrid kernel. In a sense Linux is too but you can also configure it as a mostly-monolithic thing, and most seem to prefer that.

Re:macOS extensions are moving away from the kernel by creshal on Wednesday July 07, 2021 @04:26AM (#27758727)
Some of the userspace drivers are even shared between OSX and Linux, via FUSE.
Re:macOS extensions are moving away from the kernel by roblabla on Wednesday July 07, 2021 @06:03AM (#27759335)
Another example would be userspace network drivers that directly talk to the network card. Those tend to be much more performant than using the kernel driver due to avoiding the need to context switch from userspace to kernelspace.
Re:macOS extensions are moving away from the kernel by MayeulC on Wednesday July 07, 2021 @12:47PM (#27763151)
Aren't we making userspace/kernel space communication a lot more efficient with io-uring, though?

Likewise, eBPF allows userspace programs to perform some work inside kernel space to reduce syscalls.

I wonder if io-uring won't be a starting point for a "microkernelization" of Linux. It seems really effective as a message-passing interface.

Re:macOS extensions are moving away from the kernel by pjmlp on Thursday July 08, 2021 @03:22AM (#27769169)
Look at Android' Project Treble, that is what Google has done, just with Android IPC instead of io-uring.
Re:macOS extensions are moving away from the kernel by zibzab on Wednesday July 07, 2021 @10:45AM (#27761689)
Is that really true in pratice (excluding unikernels, of course)?
Re:macOS extensions are moving away from the kernel by pjmlp on Wednesday July 07, 2021 @04:55AM (#27758898)
Since Android 8, Linux is a kind of pseudo-microkernel, as all drivers are required to be Treble based, and traditional Linux drivers are considered legacy on the platform.

https://source.android.com/devices/architecture/hal-types

The Switch (yes the games console) uses a microkernel.

QNX an OS for human critical scenarios is a microkernel.

Finally, when arguing Linux vs Minix/Hurd, think of the irony of running Linux on top of a cloud hypervisor, with an endless load of Kubernetes or Docker loads.

Re:macOS extensions are moving away from the kernel by SlowRobotAhead on Wednesday July 07, 2021 @11:49PM (#27768286)
> QNX an OS for human critical scenarios is a microkernel.

Hmm, Never thought about a stated OS focus like that. Off to look it up. Good mention

Re:macOS extensions are moving away from the kernel by pjmlp on Thursday July 08, 2021 @03:23AM (#27769175)
Search for high integrity computing, that is the industry term.
Re:macOS extensions are moving away from the kernel by kzrdude on Wednesday July 07, 2021 @04:05AM (#27758603)
macOS (Mac OS X lineage) was always based on mach (a microkernel) which made it a hybrid kernel: https://en.wikipedia.org/wiki/XNU
Re:macOS extensions are moving away from the kernel by tzs on Wednesday July 07, 2021 @09:56AM (#27761160)
At the time of the Linux vs. Minix debate, on pretty much every performance measure that Linus said monolithic kernels were better at the microkernel QNX was totally wiping the floor with Linux.