Skip to content

Instantly share code, notes, and snippets.

@jithinraj
Forked from kconner/macOS Internals.md
Created May 7, 2023 06:57
Show Gist options
  • Save jithinraj/11cafb3c575d997b8078268a7b453e18 to your computer and use it in GitHub Desktop.
Save jithinraj/11cafb3c575d997b8078268a7b453e18 to your computer and use it in GitHub Desktop.
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

  1. Under Highlights, read all the links you're interested in, or
  2. Use "OS X Reviewed" as an index and just read all the reviews end to end. (This is not the fast option, but it inspired me to gather all these highlights.)

In either case, to get the greatest benefits of context and intuition, I recommend that you read in chronological order.

Nearly 15 years ago, I wrote my first review of Mac OS X for a nascent “PC enthusiast’s" website called Ars Technica. Last fall, I wrote my last.

Highlights

These chronologically-ordered highlights jump into the middle of long, paginated articles. Topics often span a few pages, so look for the "Next Page" links.

I've chosen to define the three generations of display layer technology in order to illustrate the most important changes over the years.

The three main "subspecies" of Bundles are Application Packages, Frameworks, and Loadable Bundles.

It has two main responsibilities: Event routing, and composing and displaying on-screen elements.

What may not be so obvious is that Project Builder is built on top of popular open source development tools: everything from gcc, gdb, and cvs to smaller tools like diff.

Mac OS X manages memory very differently than classic Mac OS. The first key to understanding memory usage in Mac OS X is to be understand how a modern virtual memory system works.

Rendezvous enables a local network of devices to configure themselves without the aid of any centralized servers.

It's slightly confusing to think about the window server as an OpenGL application, but that's what it is.

As the Watson FAQ explains, although Apple's new version of Sherlock is a dead-ringer for Watson, there is no formal relationship between the two applications.

Panther includes a new window management feature that effectively increases the size of your screen by shrinking all of your windows temporarily. Following Apple's recent Gallic naming trend, it's called Exposé.

One launch daemon to rule them all.

Mac OS X now includes support for arbitrarily extensible file system metadata.

Spotlight is a system service that accepts a query and returns all file system objects (files and folders) that match the query.

The only thing left for the CPU to do is to send (relatively tiny) drawing commands to the video card through the driver.

This application was called Xray for most of its development life, which explains the icon. It's now called Instruments for reasons that surely involve lawyers.

To be aware of all relevant file system changes, the notification mechanism must exist at the choke point for all local i/o: the kernel. But the kernel is a harsh mistress, filled with draconian latency and memory restrictions.

Core Animation's original name, Layer Kit, reveals a lot about its design. At its heart, Core Animation manages a collection of 2D layers.

"I know I should back up, but I never do. I wouldn't even know how to do something like that anyway." Well, enough of that.

By committing to a Clang/LLVM-powered future, Apple has finally taken complete control of its development platform.

The bottom line is that the optimal number of threads to put in flight at any given time is best determined by a single, globally aware entity.

The new partition is actually considered a different type: Apple_Boot. The Recovery HD volume won't be automatically mounted upon boot and therefore won't appear in the Finder.

Lion further cements the dominance of touch by making all touch-based scrolling work like it does on a touchscreen.

At this point, a little bit of "geek panic" might be setting in.

Whereas Sudden Termination lets an application tell the system when it's okay to terminate it with extreme prejudice, Automatic Termination lets an application tell the system that it's okay to politely ask the program to exit.

A sandboxed application must now include a list of "entitlements" describing exactly what resources it needs in order to do its job.

There is no process that scans the memory image of a running application looking for memory to deallocate. Everything ARC does happens at compile time.

This encryption is completely transparent to all software (including the implementation of HFS+ itself) because it takes place at a layer above the volume format.

Unlike earlier incarnations of autosave, you won't see auto-generated files appearing and disappearing alongside the original document. But the data obviously has to be stored somewhere, so where is it?

Apple provides three different kinds of iCloud data storage APIs, with very little overlap between them in terms of functionality and intended purpose.

Gatekeeper is the latest stop in Apple's long, ongoing journey toward a more secure, worry-free computing experience on the Mac. Once again, iOS is the model.

Even if you have no idea what any of that means, I believe you may still find the table below compelling.

In this mode, the audio and graphics systems remain powered down, but the disk, CPU, and networking hardware are all active.

Labels were introduced way back in System 6 in 1988. Since Apple made both the Finder and the file system, it reserved a place in the file system metadata for what it called “Finder Info.”

By coalescing the work into a contiguous burst of high activity, transitional waste has been cut to a bare minimum, and the amount of idle time has been maximized.

Like the HFS+ compression feature introduced in Snow Leopard, compressed memory trades relatively abundant CPU cycles for decreased disk I/O.

Replacing the existing iCloud document storage is the new iCloud Drive—and I do mean replacing.

Though they are distributed inside an application’s bundle, Extensions are not just applications launched in a special mode. They are separate, purpose-built binaries, with their own containers, code signatures, and entitlements.

When all the dots connect, it really is a neat experience. Now let’s talk about those dots.

Perhaps this mission statement is so grandiose—so preposterous, even—that readers are inclined to gloss over it or dismiss it. But it’s the key to understanding the design of Swift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment