Live data from Hacker News

Apple’s Darwin OS and XNU Kernel Deep Dive

tansanrao.com

21–30 of 186 posts

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

#21

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…

1) We are talking about the late 90s, well before Ubuntu, where Desktop Linux was pretty poor in terms of features and polish. 2) Apple had no money or time to invest in rewriting NeXTStep for a completely new kernel they had no experience in. Especially when so many of the dev team was involved in sorting out Apple's engineering and tech strategy as well as all the features needed to make it more Mac like. 3) Apple…

> Apple had no money or time to invest in rewriting NeXTStep for a completely new kernel they had no experience in.

And even if they had had the money and time, Avie Tevanian¹ was a principal designer and engineer of Mach². There was no NeXTSTEP-based path where the Mach-derived XNU would not be at the core of Apple's new OS family.

¹ https://en.wikipedia.org/wiki/Avie_Tevanian ² https://en.wikipedia.org/wiki/Mach_(kernel)

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

#22

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…

Back in the days when Apple acquired NeXT, Linux was undergoing lots of development and wasn't well established. Linux being a monolithic kernel didn't offer the levels of compartmentalization that Mach did.

As things now stand, FreeBSD represents many of the benefits of Darwin and the open source nature of Linux. If you seek a more secure environment without Apple's increasing levels of lock-in, then FreeBSD (and the other BSDs) merit consideration for deployment.

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

#23
post #13
post #6

> Mach’s virtual memory (VM) system was influential beyond the project – it was adopted by 4.4BSD and later FreeBSD as their memory management subsystem. …and NetBSD[0], OpenBSD[1], but apparently not DragonFly BSD[2]. [0] https://netbsd.org/docs/kernel/uvm.html [1] https://man.openbsd.org/OpenBSD-3.0/uvm.9 [2] https://www.dragonflybsd.org/mailarchive/kernel/2011-04/msg0...

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/Features176.html

[4] https://en.wikipedia.org/wiki/Vkernel

[5] https://en.wikipedia.org/wiki/HAMMER_(file_system)

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

#24

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…

Interestingly enough, Apple did contribute to porting Linux to PowerPC Macs in the mid-1990s under the MkLinux project, which started in 1996 before Apple’s purchase of NeXT later that year:

https://en.m.wikipedia.org/wiki/MkLinux

I don’t think there was any work done on bringing the Macintosh GUI and application ecosystem to Linux. However, until the purchase of NeXT, Apple already had the Macintosh environment running on top of Unix via A/UX (for 68k Macs) and later the Macintosh Application Environment for Solaris and HP-UX; the latter ran Mac OS as a Unix process. If I remember correctly, the work Apple did for creating the Macintosh Application Environment laid the groundwork for Rhapsody’s Blue Box, which later became Mac OS X’s Classic environment. It is definitely possible to imagine the Macintosh Application Environment being ported to MkLinux. The modern FOSS BSDs were also available in 1996, since this was after the settlement of the lawsuit affecting the BSDs.

Of course, running the classic Mac OS as a process on top of Linux, FreeBSD, BeOS, Windows NT, or some other contemporary OS was not a viable consumer desktop OS strategy in the mid 1990s, since this required workstation-level resources at a time when Apple was still supporting 68k Macs (Mac OS 8 ran on some 68030 and 68040 machines). This idea would’ve been more viable in the G3/G4 era, and by the 2000s it would have be feasible to give each classic Macintosh program its own Mac OS process running on top of a modern OS, but I don’t think Apple would have made it past 1998 without Jobs’ return, not to mention that the NeXT purchase brought other important components to the Mac such as Cocoa, IOKit, Quartz (the successor to Display PostScript) and other now-fundamental technologies.

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

#25

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

IIRC that was something they had been working on, but it got axed when ZFS changed hands and licensing became potentially thorny. My memory may be failing me though.

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

#26

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…

Back in the days when Apple acquired NeXT, Linux was undergoing lots of development and wasn't well established. Linux being a monolithic kernel didn't offer the levels of compartmentalization that Mach did. As things now stand, FreeBSD represents many of the benefits of Darwin and the open source nature of Linux. If you seek a more secure environment without Apple's increasing levels of lock-in, then FreeBSD (and th…

[dead]

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

#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...

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

#28

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

Around the time of Snow Leopard, it was rumored. I assume the Oracle buyout of Sun around the same time had a big part in killing that particular idea.

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

#29
post #24

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…

Interestingly enough, Apple did contribute to porting Linux to PowerPC Macs in the mid-1990s under the MkLinux project, which started in 1996 before Apple’s purchase of NeXT later that year: https://en.m.wikipedia.org/wiki/MkLinux I don’t think there was any work done on bringing the Macintosh GUI and application ecosystem to Linux. However, until the purchase of NeXT, Apple already had the Macintosh environment runn…

> I don’t think there was any work done on bringing the Macintosh GUI and application ecosystem to Linux.

QTML (which became the foundation of the Carbon API) was OS agnostic. The Windows versions of QuickTime and iTunes used QTML, and in an alternate universe Apple could've empowered developers to bring Mac OS apps to Windows and Linux with a more mature version of that technology.

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

#30
post #5

I’ve been wanting to understand Darwin at this depth for a long time. Great read!

Mac OS X Internals by Singh is one of my favorite books, such a great in depth examination of Mac OS X circa 10.4. I really wish there was an updated version. Edit: I see it's even cited at the end of this article. Truly a source for the (macOS) ages.

Jonathan Levin’s three part series “*OS Internals” is that update, but they stopped working on and writing about Darwin around Catalina.
Post reply on HN