0

Why macOS Became Unix but Never Became Linux

创建时间
Why macOS Became Unix but Never Became Linux
描述
展开

Open Terminal on a Mac and the machine suddenly starts speaking a language familiar to almost anyone who has spent time with Linux.

There is ls.

There is grep.

There is ssh.

There are Unix-style permissions, processes, pipes, signals, sockets, shells, and paths beginning at /.

You can compile C code, start an SSH session, manipulate files with command-line utilities, run servers, and use many of the same development tools you would expect to find on a Linux machine.

Then close Terminal.

The resemblance seems to disappear.

You are back in macOS, with Finder, the Dock, Spotlight, AppKit, Swift, Metal, APFS, Apple Silicon, iCloud, and an operating system whose design and software ecosystem remain unmistakably Apple's.

This creates an interesting historical question.

If Apple transformed the Mac into a Unix system around the turn of the century, why did the Mac not gradually converge with Linux?

Why did two operating systems with so much low-level common ground remain so obviously separate?

The answer begins with an important correction to the question itself.

Apple did not originally set out to turn the Mac into Unix.

Apple set out to save the Mac.

The operating system underneath the original Macintosh was getting old

The original Macintosh appeared in 1984.

Its operating system was built for a very different kind of computer from the machines that would exist a decade later. The first Macintosh had 128 kilobytes of memory. It was designed as a personal computer for one person sitting in front of one machine, running a relatively small collection of programs.

That design produced something extraordinary for its time. The Macintosh made graphical computing approachable in a way few machines had before.

But elegant solutions to one generation's problems can become constraints on the next.

By the 1990s, personal computers were becoming dramatically more capable. Users expected to run many programs at once. Networks and the Internet were becoming central to computing. Applications were larger. Machines contained more memory and increasingly powerful processors.

Classic Mac OS was struggling to grow into this world.

Two missing features were especially important.

One was protected memory.

In a modern operating system, applications generally operate inside protected address spaces. One program should not normally be able to scribble over another program's memory or corrupt the operating system itself.

Classic Mac OS offered much weaker isolation. A sufficiently badly behaved program could damage shared memory and bring down the entire computer.

The second problem was preemptive multitasking.

Classic Mac OS relied heavily on cooperative multitasking. Applications were expected to periodically yield control so that other applications could run.

That arrangement could work surprisingly well when applications behaved themselves.

When they did not, the entire machine could feel as though it had wandered into wet cement.

These were not cosmetic deficiencies that Apple could fix by redesigning a menu or adding another control panel. They concerned the architecture underneath the operating system.

Apple knew this.

For years, it tried to construct a successor.

Apple's attempt to build the future became its own problem

During the 1990s, Apple launched a next-generation operating-system project called Copland.

Copland was supposed to bring modern operating-system features to the Macintosh while preserving the enormous investment users and developers had already made in Mac software.

This was an alluring proposition.

It was also extraordinarily difficult.

Apple was effectively trying to renovate the foundation of a house while keeping everyone living in it, preserving the plumbing, keeping all the furniture in its familiar locations, and promising that nobody's favorite lamp would stop working.

The project expanded.

Requirements multiplied.

Deadlines slipped.

Eventually Copland itself became another problem Apple needed to solve.

By 1996, the project had collapsed, and Apple faced an uncomfortable conclusion: instead of successfully building its next operating system internally, it might need to acquire one from somewhere else.

This was no minor product decision.

The operating system was the foundation of the Macintosh platform. Choosing its replacement meant choosing which ideas, technologies, development tools, and architectural assumptions could shape the Mac for decades.

Apple looked outside the company.

One possibility was BeOS, a modern operating system created by Be Inc., a company founded by former Apple executive Jean-Louis Gassée.

Another possibility came from a company with an unusually complicated relationship to Apple.

It was called NeXT.

And its founder was Steve Jobs.

NeXT had already built much of the future Apple needed

Jobs had founded NeXT after leaving Apple in 1985.

NeXT's computers never became mass-market successes comparable to the Macintosh or Windows PC. But the company had spent years developing a sophisticated operating system called NeXTSTEP, later evolving through OPENSTEP.

Technically, it was impressive.

NeXTSTEP already possessed many of the capabilities Apple desperately wanted: protected memory, preemptive multitasking, strong networking, sophisticated development tools, and an object-oriented application environment.

It also had something else.

Underneath its graphical interface was an operating-system architecture derived from Mach and BSD Unix.

That ancestry matters.

Mach began as an operating-system research project at Carnegie Mellon University. Among other things, it provided abstractions for tasks, threads, virtual memory, and interprocess communication.

BSD, or the Berkeley Software Distribution, descended from the Unix work done at the University of California, Berkeley. It contributed much of the recognizable Unix environment: networking, processes, filesystems, command-line facilities, system calls, and APIs familiar to Unix programmers.

NeXT combined these worlds.

When Apple purchased NeXT at the end of 1996, therefore, it acquired much more than Steve Jobs and a collection of development tools.

It acquired the technological ancestor of its future operating system.

Apple initially developed this technology under the name Rhapsody. Eventually it evolved into Mac OS X.

When Mac OS X 10.0 shipped on March 24, 2001, it looked like a radical new Macintosh operating system.

Underneath, however, it was also a descendant of NeXTSTEP.

And that meant the Mac had acquired Unix roots.

So did Apple choose Unix, or did Unix come along with NeXT?

The answer is both.

There is an alternate history in which Apple bought a different company and inherited a completely different technological foundation.

In that sense, Unix arrived on the Mac partly because Apple chose NeXT as the solution to its operating-system crisis.

Apple did not spend the early 1990s following a grand strategy called Turn Macintosh Into a Unix Workstation.

It needed a modern operating system.

NeXT had one.

NeXT's operating system happened to be built on Unix-derived technology.

But describing the Unix foundation as an accidental passenger would go too far.

Once Apple had this architecture, its advantages were obvious enough that the company deliberately embraced them.

Unix represented decades of accumulated operating-system engineering.

Apple no longer needed to invent its own answer to every problem involving processes, networking, permissions, virtual memory, command-line tools, and standard programming interfaces.

It could build on a mature technological tradition.

When Apple introduced Mac OS X, it actively promoted this Unix foundation rather than hiding it. Apple described the new operating system as combining the Macintosh experience with an open-source, Unix-based foundation called Darwin.

At the center of the new operating system was Darwin.

Darwin is the Unix world underneath macOS

Darwin is the open-source core upon which Mac OS X, and later macOS, was built.

Its kernel is called XNU.

The name itself is a recursive joke: X is Not Unix.

This becomes slightly funny given how central XNU later became to one of the world's most widespread families of Unix-based operating systems.

XNU is not simply a copy of a traditional BSD kernel, nor is it a pure implementation of Mach.

It combines technologies from both.

Mach contributes important low-level mechanisms involving memory management, scheduling, threads, and interprocess communication.

The BSD side supplies much of the Unix process model, networking stack, filesystem infrastructure, security model, and standard interfaces programmers expect from a Unix-like system.

Apple also built its own technologies around them, including I/O Kit for device drivers.

The result was not FreeBSD wearing an Apple logo.

It was a new Apple operating system assembled partly from technologies that had already spent years evolving elsewhere.

A simplified family tree looks something like this:

                    Unix
                      |
             Berkeley Unix / BSD
                      |
                BSD descendants
                      |
                   FreeBSD
                      |
                      +------+
                             |
Mach --------------------> Darwin / XNU
                             |
                         Mac OS X
                             |
                           macOS

NeXTSTEP belongs inside this story as the crucial intermediate ancestor through which the Mach-and-BSD architecture reached Apple.

Linux belongs on another branch.

Linux is not the Unix underneath the Mac

This is where the family tree becomes easy to misread.

Linux and macOS resemble each other because both belong to the broader Unix tradition.

But macOS is not based on Linux.

Linux itself appeared in 1991, when Linus Torvalds began developing a new Unix-like kernel.

It did not descend from the source code of the original Unix in the way BSD historically did. Instead, Linux implemented many of the same concepts and interfaces and eventually became the kernel at the center of operating systems commonly called Linux distributions.

So there are two different histories unfolding.

One leads through BSD, Mach, NeXT, Darwin, and macOS.

Another leads through the Linux kernel, the GNU project, and the enormous ecosystem of Linux distributions and software surrounding them.

They meet constantly at the level of standards and ideas.

They do not merge into the same operating system.

That is why a Linux user can open Terminal on macOS and feel strangely at home.

Both worlds know about processes.

Both understand Unix permissions.

Both have pipes and signals.

Both use familiar networking concepts.

Both support large portions of the POSIX programming environment.

Many command-line programs can be ported between them with comparatively little effort.

The resemblance is real.

But it mostly tells us that the two systems speak related dialects of a common systems language.

It does not tell us that one is built from the other.

The closer you get to the desktop, the more the resemblance disappears

Imagine an operating system as a tall building.

Down in the basement are mechanisms most users rarely think about:

  • virtual memory
  • processes
  • threads
  • sockets
  • filesystems
  • permissions
  • networking
  • system calls

Unix supplies a powerful vocabulary for solving many of these problems.

Move upward, however, and an operating system begins making much more visible choices.

How are applications constructed?

How does the graphical interface work?

What is the windowing system?

How are applications packaged and distributed?

How are devices configured?

How does the computer sleep and wake?

Which graphics APIs do developers use?

What programming frameworks define a native application?

How closely is the operating system designed around particular hardware?

Here macOS and Linux diverge dramatically.

Modern macOS includes technologies such as Cocoa and AppKit, Swift and Objective-C runtimes, Core Foundation, Core Animation, Metal, APFS, launchd, I/O Kit, Apple's security infrastructure, and extensive integration with Apple hardware and services.

A typical Linux desktop may instead involve technologies such as Wayland, systemd, GTK or Qt, ELF binaries, Mesa, D-Bus, ext4 or Btrfs, and countless components maintained by independent projects.

Even where the two operating systems solve the same problem, they frequently solve it through different software.

Unix gives them common foundations.

It does not dictate the entire building.

Apple never had much reason to make the rest of the building look like Linux

This is the economic piece of the story.

Linux developed through an ecosystem involving thousands of independent contributors, companies, distributions, foundations, universities, and projects.

There is no single company defining what every Linux system must look like from the kernel to the desktop.

Apple's business operates almost in the opposite direction.

Apple's competitive advantage has increasingly depended on controlling the relationship between hardware and software.

The company designs the computer.

It develops the operating system.

It defines the application frameworks.

It controls the major distribution channels.

Today it even designs the processors at the center of the machine.

From Apple's perspective, therefore, adopting proven Unix technology underneath the Mac did not imply that the visible Macintosh environment should become standardized around somebody else's platform.

Quite the opposite.

Unix allowed Apple to standardize parts of the system where differentiation provided relatively little advantage while concentrating its engineering effort on the places where Apple wanted to be different.

One way to describe the strategy is:

standardize the basement; differentiate the penthouse.

Apple did not need a uniquely Apple implementation of every networking primitive simply to prove that it could build one.

It did care enormously about what happened when a user opened a laptop, launched an application, connected a device, rendered graphics, managed files, or moved between Apple products.

The Unix foundation and the Apple experience could therefore coexist without contradiction.

In some ways, they complemented each other.

Open source mattered, but not because Apple could simply harvest Linux

There is another tempting explanation for Apple's decision.

Perhaps Unix gave Apple access to the enormous amount of software being developed for Linux, allowing Apple to absorb that work rather than paying engineers to build equivalent technology.

There is a grain of truth here, but the relationship is more complicated.

Apple absolutely benefited from open-source software and from participating in a wider Unix ecosystem.

Darwin itself was released as open source.

Apple also drew heavily from BSD technology, particularly FreeBSD. Apple's own kernel documentation describes a large portion of Darwin as derived from FreeBSD, alongside Mach and technologies acquired from NeXT.

That can have enormous economic value.

Mature code already exists.

Standards already exist.

Programmers already understand the APIs.

Tools can often be ported instead of recreated.

Bugs and design problems have sometimes been explored for years before Apple ever encounters them.

But this is not the same as saying that macOS was designed to inherit Linux development.

Linux is only one major member of a much larger Unix-like world.

For the operating-system foundation Apple adopted, BSD was the more direct relative.

Licensing also made BSD technology particularly convenient for commercial use.

Many BSD components are distributed under permissive licenses. Those licenses generally allow companies to incorporate and modify the code while distributing larger proprietary systems around it, provided the relevant license requirements are followed.

The Linux kernel, by contrast, is distributed under the GNU General Public License version 2.

That does not mean Apple could not use any GPL software. macOS has historically shipped various programs under GPL licenses.

Nor would using the Linux kernel somehow require every graphical application on a Mac to become open source.

But distributing a modified Linux kernel would bring reciprocal source-code obligations for derivative kernel work that do not accompany permissively licensed BSD code in the same way.

For a company intent on tightly controlling its operating-system platform, BSD-derived technology was therefore an unusually comfortable foundation.

Apple could participate in an open-source Unix ecosystem without turning macOS itself into a Linux distribution.

Apple even opened part of the new operating system

In April 2000, before the final release of Mac OS X, Apple released Darwin 1.0 as open source.

This is easy to forget today because most people do not think of Apple as an open-source operating-system company.

But Apple's strategy at the time was quite explicit.

Developers could inspect and contribute to important portions of the system's core, including its Mach and BSD layers.

Then Apple built proprietary layers above Darwin that created the Macintosh experience users actually interacted with.

This produced an unusual arrangement.

The foundations could participate in a broader engineering commons.

The differentiated product remained Apple's.

There was no requirement that Finder become a standard Unix file manager.

There was no requirement that Aqua resemble the graphical environments appearing on Linux.

There was no requirement that Mac developers abandon Apple's application frameworks in favor of whichever toolkit happened to dominate another Unix platform.

Darwin could be open.

The Mac could still be the Mac.

This explains the strange feeling of using a modern Mac

A Mac can sometimes seem to contain two personalities.

One is the polished consumer computer Apple presents to the world.

The other appears when you open Terminal.

Suddenly you can type:

ssh server.example.com

or:

ps aux

or:

chmod +x script.sh

and find yourself interacting with concepts that would be immediately recognizable on a Linux server across the room.

This is not an accidental compatibility layer bolted onto an otherwise unrelated system.

The Unix world really is down there.

But neither is the graphical Mac merely a decorative shell placed on top of Linux.

Its kernel is different.

Its executable format is different.

Its driver architecture is different.

Its native frameworks are different.

Its graphical stack is different.

Its system-management infrastructure is different.

Its development history is different.

macOS and Linux are close enough to recognize each other's ancestry and far enough apart to have become separate civilizations.

The decision became much bigger than the Mac

The most remarkable part of this story is that Apple's operating-system crisis in the 1990s did not merely determine the future of Macintosh computers.

It eventually determined the technological foundation of almost every major computing platform Apple would create.

Mac OS X descended from NeXTSTEP.

The operating system created for the iPhone descended from Mac OS X.

From that lineage came iOS and, eventually, the related operating systems underlying the iPad, Apple Watch, Apple TV, and Apple Vision Pro.

The family tree therefore continued:

NeXTSTEP / OPENSTEP
          |
       Rhapsody
          |
       Mac OS X
          |
        Darwin
       /      \
   macOS      iPhone OS
                 |
                iOS
              /  |  \
        iPadOS watchOS tvOS
                  \
                visionOS

The diagram simplifies a complicated technical history, but the lineage is real.

A decision Apple made while trying to escape an operating-system crisis in the 1990s helped determine the software architecture of devices that would eventually be carried in pockets and worn on wrists around the world.

That makes the NeXT acquisition one of those moments in computing history whose consequences are much easier to see backward than forward.

Unix won without macOS and Linux becoming the same thing

There is a broader lesson hiding inside the story.

Technologies do not always win by turning everything into a single standardized product.

Sometimes they win by becoming the assumptions underneath many different products.

Unix did not need macOS and Linux to converge into one operating system.

Its ideas could spread instead.

Processes.

Pipes.

Hierarchical filesystems.

Permissions.

Sockets.

Shells.

Portable programming interfaces.

Small tools composed together.

The particular implementations changed. Some Unix ideas were modified, replaced, or surrounded by newer abstractions. Different branches of the family tree evolved in different directions.

But the underlying vocabulary proved extraordinarily durable.

That durability is one reason a developer in 2026 can sit in front of a Mac built around an Apple-designed ARM processor, open a terminal, connect to a Linux machine across the Internet, and move between the two environments without experiencing them as completely alien worlds.

The machines are not running the same operating system.

They do not need to be.

They inherited enough of the same intellectual architecture to understand each other.

And that ultimately explains the apparent paradox.

macOS became Unix because Apple needed a modern foundation, found one in NeXT, and discovered that decades of Unix engineering were tremendously useful.

It never became Linux because Linux was never the destination.

The destination was always the Mac.


标签:

评论

0 条评论

登录以加入对话。

还没有人回复。对话开始后,评论会显示在这里。