Live data from Hacker News

Apple’s Darwin OS and XNU Kernel Deep Dive

tansanrao.com

31–40 of 186 posts

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#31

Whenever I see the Darwin kernel brought into the discussion I can't help but wonder how different things could have been if Apple had just forked Linux and ran their OS services on top of that. Especially when I think about how committed they are to Darwin it really paints a poor image in my mind. The loss that open source suffers from that, and the time and money Apple has to dedicate to this with a disproportionat…

Diverse systems are more resilient. It's probably a good thing for IT in a general sense, even if it's not the most efficient

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#32
post #20

Couldn't Apple have used ZFS instead of inventing APFS? Maybe modifying it to use less physical memory?

Supporting ZFS in a UNIX kernel requires excessively extensive modifications to the design and implementation of the VMM, namely: 1. Integration of the kernel's VM with ZFS's adaptive replacement cache which runs in user space – memory pressure cooperation, page accounting and unified memory management. It also requires extensive VM modifications to support ZFS's controlled page eviction, fine-grained dirty page trac…

> Supporting ZFS in a UNIX kernel requires excessively extensive modifications to the design and implementation of the VMM, namely:

FYI: Apple did a bunch of that work. They ported ZFS to OSX shortly after it was open sourced. With with only support landing in 10.5. With it being listed as an upcoming feature in 10.6.

But something happened and they abandoned it. The rumour is a sun exec let the cat out of the bag about it being the next main filesystem for osx (ie not just support for non root drives) and this annoyed Jobs so much he canned the whole project.

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#33
The article states that "pager daemons" that manage swap files runs in user space, and the kernel memory can also get swapped out, but never explained how a user space daemon swaps out kernel memory. Do they have hard-coded exceptions for special daemons, or use special system calls? Where can I find out more details about the user space memory management specifically?

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#34
post #23
post #13

Earlier quoted context omitted.

Sadly, that is not entirely correct. Whilst all three BSDs (386BSD, FreeBSD, and NetBSD; there was no OpenBSD in the beginning) did inherit the legacy Mach 2.5-style design, it did not live on in FreeBSD, whose core team started pretty quickly replacing all remaining vestiges of the Mach VM[0] with a complete, modern, and highly performant rewrite of the entire VM. FreeBSD 4 had none of the original Mach code left in…

> I am not sure whether DragonBSD is dead or alive today at all. Oof, yeah.[0][1]. I hope they're doing alright - technically fascinating, and charming as they march to the beat of their own accordion.[2][3][4][5] [0] https://www.dragonflybsd.org/release64/ [1] https://gitweb.dragonflybsd.org/dragonfly.git [2] https://www.dragonflybsd.org/mailarchive/kernel/2012-03/msg0... [3] http://www.bsdnewsletter.com/2007/02/Fea…

The last release being «Version 6.4.0 released 2022 12 30», links from 2007 and 2012 do not lend much assurance that the project is still alive in 2025 – compared to other similar projects.

Also note that HAMMER (the previous design) and HAMMER2 (the current design, since 2018) are two distinct, incompatible file system designs. I am not sure what is the value of mentioning the previous and abandoned design in the this context.

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#35

Whenever I see the Darwin kernel brought into the discussion I can't help but wonder how different things could have been if Apple had just forked Linux and ran their OS services on top of that. Especially when I think about how committed they are to Darwin it really paints a poor image in my mind. The loss that open source suffers from that, and the time and money Apple has to dedicate to this with a disproportionat…

Based on how often they pull in updated bits from FreeBSD (pretty much never), an Apple fork of Linux would be more or less Linux 2.4 today.

I don't know what the loss that open source suffers is in this context?

I don't think Apple would need to spend less time or money on their kernel grafted ontop of Linux 2.4 vs their kernel grafted on top of FreeBSD 4.4

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#36

Whenever I see the Darwin kernel brought into the discussion I can't help but wonder how different things could have been if Apple had just forked Linux and ran their OS services on top of that. Especially when I think about how committed they are to Darwin it really paints a poor image in my mind. The loss that open source suffers from that, and the time and money Apple has to dedicate to this with a disproportionat…

Why would we want more of a monoculture? We've put so many eggs in one basket already. I hope we see more diversity in kernels, not further consolidation.

Taken a different way, it feels similar to suggesting Apple should rebase safari on chromium.

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#37
post #27

Couldn't Apple have used ZFS instead of inventing APFS? Maybe modifying it to use less physical memory?

I remember reading back in 2007-2008 that Apple was interested in bringing ZFS support to Mac OS X, but discussions ended once Oracle purchased Sun. This was a bummer; I would’ve loved ZFS on a Mac. After a cursory Google search, I found this article: https://www.zdnet.com/article/zfs-on-snow-leopard-forget-abo...

There were a couple of (iirc read-only) beta ZFS PKGs from Apple in the 10.5 era: https://macintoshgarden.org/forum/looking-zfs-beta-seeds-ye-...

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#38
post #16

Whenever I see the Darwin kernel brought into the discussion I can't help but wonder how different things could have been if Apple had just forked Linux and ran their OS services on top of that. Especially when I think about how committed they are to Darwin it really paints a poor image in my mind. The loss that open source suffers from that, and the time and money Apple has to dedicate to this with a disproportionat…

There was never a right time for Apple to make such a switch. NeXTSTEP predates Linux, and when it was adapted into Mac OS X, Apple couldn't afford a wholesale kernel replacement project on top of everything else, and Linux in the late 1990s was far from being an obviously superior choice. Once they were a few versions in to OS X and solidly established as the most successful UNIX-like OS for consumer PCs, switching…

Making a switch is one thing, but using Linux from the start for OS X would have made more sense. The only reason that didn't happen is because of Jobs' attachment to his other baby. It wasn't a bad choice, but it was a choice made from vanity and ego over technical merit.

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#39
post #20

Earlier quoted context omitted.

Supporting ZFS in a UNIX kernel requires excessively extensive modifications to the design and implementation of the VMM, namely: 1. Integration of the kernel's VM with ZFS's adaptive replacement cache which runs in user space – memory pressure cooperation, page accounting and unified memory management. It also requires extensive VM modifications to support ZFS's controlled page eviction, fine-grained dirty page trac…

> Supporting ZFS in a UNIX kernel requires excessively extensive modifications to the design and implementation of the VMM, namely: FYI: Apple did a bunch of that work. They ported ZFS to OSX shortly after it was open sourced. With with only support landing in 10.5. With it being listed as an upcoming feature in 10.6. But something happened and they abandoned it. The rumour is a sun exec let the cat out of the bag ab…

> The rumour is a sun exec let the cat out of the bag about it being the next main filesystem for osx (ie not just support for non root drives) and this annoyed Jobs so much he canned the whole project.

Very petty if true.

Re: Apple’s Darwin OS and XNU Kernel Deep Dive

#40
post #16

Earlier quoted context omitted.

There was never a right time for Apple to make such a switch. NeXTSTEP predates Linux, and when it was adapted into Mac OS X, Apple couldn't afford a wholesale kernel replacement project on top of everything else, and Linux in the late 1990s was far from being an obviously superior choice. Once they were a few versions in to OS X and solidly established as the most successful UNIX-like OS for consumer PCs, switching…

Making a switch is one thing, but using Linux from the start for OS X would have made more sense. The only reason that didn't happen is because of Jobs' attachment to his other baby. It wasn't a bad choice, but it was a choice made from vanity and ego over technical merit.

This presumes that Apple brought in Jobs as a decision maker, and NeXTSTEP was attached baggage. At the time, the reverse was true - Apple purchased NeXTSTEP as their future OS, and Jobs came along for the ride. Given the disaster that was Apple's OS initiatives in the 90s, I doubt the Apple board would have bought into a Linux adventure.
Post reply on HN