With Mac OS X, Apple is building Unix into the Mac OS, and this has technical, social, and political ramifications for Mac users and the rest of the industry. To understand the implications of this change, let’s take a look this week at the Unix family of operating systems and how they constitute a part of Mac OS X. In the next part of this article, I’ll address how the fusion of these two operating systems will impact not only Mac and Unix users, but the computer industry as a whole.
Unix 101: The History of the Machine — In the beginning (or as far back as we want to go), there was Unix, which was originally developed at AT&T’s Bell Labs. In many ways, Unix grew up in symbiosis with the C programming language, which became an important facet of its underlying philosophy – that programming is good for you. (For more information, see some of the resources provided by Dennis Ritchie, one of the creators of C, as well as an interesting timeline of the history of Unix). In sharp contrast, the Macintosh was revolutionary because of Apple’s concept that computer users could be insulated from the underlying workings of their computers, and not have to be programmers. Apple’s vision of the Mac OS was as a system for managing a computing appliance, whereas Unix was published as a research project with an open invitation to tinkerers.
Over time, various companies and individuals contributed to Unix, each under their own licenses, some of which required payment for use. Several companies, most notably Sun Microsystems, licensed Unix to use as the basis of their own operating systems to run on their own computer hardware. There are now hundreds of derivatives of the original Bell Labs Unix. A crucial point in the development of Unix came when AT&T sued the University of California at Berkeley to halt distribution of Unix systems without paid licenses from AT&T, but the suit failed. After the settlement, Berkeley released the free and redistributable 4.4BSD-Lite (BSD stands for "Berkeley Software Distribution"), which contained no AT&T code and no licensing restrictions. The current BSD flavors of Unix – NetBSD, FreeBSD, OpenBSD, BSDI, and now Apple’s Darwin – are all descendants of BSD-Lite.
During the 1980s, Richard Stallman formed the Free Software Foundation (FSF) to write a completely compatible Unix replacement, free of restrictive licensing requirements. In rejection of these licenses, the FSF created the GNU General Public License (GPL), which requires licensed software to be freely redistributable, and has a "viral" clause requiring that derivative works also be licensed under the GPL, and thus freely available and modifiable. The GNU (which stands for "GNU’s Not Unix") project was highly successful in creating powerful tools, such as the ubiquitous gcc compiler and gzip compression program, now considered standard parts of Unix environments. The GNU operating system kernel, known as Hurd, is still under development.
Linus Torvalds began the Linux project with a similar goal: to develop a free Unix-compatible kernel for Intel PCs, without license encumbrances. To ensure that Linux would be free, it was also licensed under the GPL. An operating system kernel isn’t useful by itself, so Linux distributions combine Linux kernels with other free GNU and non-GNU components to build complete operating systems. Thus the FSF’s goal of a free Unix-like operating system was attained, though not quite as its founders expected.
Linux is generally portrayed as a better, faster, and more stable server alternative to Windows NT/2000. In contrast, BSD Unix rarely crops up in casual conversation, but its users consider it better and more stable than relative newcomer Linux. A number of high-profile Web sites, such as Yahoo and MCI, apparently share this conviction and rely on BSD-backed Web servers.
The Mac OS X Layer Cake — Although Apple is introducing Unix to millions of Mac users through Mac OS X, you don’t need to start memorizing Unix commands to use it (in fact, you’ll have to work to see the Unix command line at all). However, it will be helpful to have a working knowledge of how Unix fits into the inner workings of your Mac.
Think of Mac OS X as a three-layer cake, borrowing its basic recipe from the NeXTstep operating system, leavened with components of Mac OS 9. The lowest level is derived from Carnegie Mellon University’s Mach microkernel research project, which interacts with the hardware and helps different parts of the next level up communicate with one another, and the BSD kernel, which provides facilities such as networking, device drivers, and file systems – HFS+ and UFS (Universal or Unix File System) are included in Mac OS X. Within Darwin, the second level is a fairly standard Unix environment, including tools ranging from the ls program that lists files and the cp program that copies files, to the aforementioned gzip and the Apache Web server. These two layers are available now from Apple, packaged together as the free open source Darwin operating system.
Darwin is a fully capable Unix-like operating system on its own, but it’s limited in comparison to the Mac OS. In particular, Darwin lacks graphics capabilities entirely – in a typical Unix system those would be provided by the X Window System, but Darwin can only display text on the connected monitor. Apple has released Darwin as open source, so people with recent Macs who want to run BSD-style Unix now have another free option (projects such as OpenBSD and NetBSD also support many Macintosh hardware configurations). Darwin has already drawn some attention in the computer industry, but it’s mostly relevant for Mac users, since several mature BSD options for Intel-based PCs already exist. It remains to be seen whether people will actually use Darwin as an independent product, but it may find popularity on slightly older machines or in dedicated server environments.
Confusingly, Apple uses the name Darwin for several related projects which have different releases but the same source code: the self-contained Darwin operating system package and the bottom layer of Mac OS X. Direct access to Unix applications on a Mac OS X system is entirely optional, which makes the system much more palatable for Mac users who prefer to avoid Unix. But double-clicking the Terminal program included in Mac OS X Public Beta invokes a command line, giving full access to Unix functionality, just like logging into a machine running the free Darwin operating system.
The second and third levels of the Mac OS X layer cake, not included in the free Darwin package, are the proprietary code that makes it a Macintosh operating system with a graphical interface: the QuickDraw and Quartz graphic environments that programs use to draw to the screen and the whole set of Application Programming Interfaces (APIs) that enable Macintosh programs (as opposed to Unix programs) to run. The main APIs in Mac OS 9 are collectively called the Macintosh Toolbox. Mac OS X includes a much larger set of overlapping APIs, due to its hybrid Unix/NeXT/Apple heritage.
Classic applications rely on the venerable QuickDraw for display of text and graphics. Carbon applications can use Apple’s new Quartz display engine, but QuickDraw remains available to them as well, and so they’ll probably stick with QuickDraw as long as developers want to provide a single application file that can run under both Mac OS 9 and Mac OS X. Cocoa applications rely entirely on Quartz, which is based on Adobe’s Portable Document Format (PDF), and provides improved capabilities for print and layout. In addition, Mac OS X also provides OpenGL and QuickTime, which may help availability and performance of games and scientific computing software for Macs.
Macintosh programs that can run under Mac OS X come in three main flavors: Carbon, Classic (existing Mac OS 9 programs), and Cocoa. New and updated programs which use Carbon are full-fledged Mac OS X applications and take advantage of Mac OS X’s protected memory and preemptive multitasking. Current programs run under Mac OS 9 within the Classic environment, providing compatibility with existing software. And Cocoa programs rely on a set of APIs originally derived from NeXTstep, so Mac OS X can run NeXTstep-derived programs.
The frosting on this layer cake is a new graphical design for Mac OS X, called Aqua. All Carbon and Cocoa applications in Mac OS X use Aqua, which specifies larger text and buttons, heavy usage of anti-aliased text and transparency, and a new set of design guidelines for windows, menus, and other interface elements. As a result, Mac OS X applications are prettier and livelier, with correspondingly increased demands on processor power and screen size. Specifically, Mac OS X effectively requires a minimum screen resolution of 800 by 600 pixels, while Mac OS 9 was usable at 640 by 480 pixels. (Also see "A Quick Dip into Aqua, the Mac OS X Interface" in TidBITS-513.)
Okay, let’s see if we can put it all together – this diagram may look more like a game of Hack than a layer cake, but it should give you an overview of where everything fits. Remember there’s no graphical environment under BSD Unix in Darwin.
| (Platinum) | (Aqua) | | (Text) |
3 | Classic | Carbon | Cocoa | | BSD Unix |\
+————-+—-+—–+———+ +—–++—–+ \
2 | QuickDraw | Quartz | || (Darwin)
1 | Mach+BSD kernel |/
To continue our analogy, the Mac OS X Public Beta available now includes candles on the cake – user applications (both included with Mac OS X and installed by users), which use either the Platinum (Classic) or Aqua appearance, depending on the APIs to which they’re written. Bundled applications include the Finder/Desktop, Internet Explorer, Mail, Sherlock, System Preferences, an MP3/CD player, and others. The whole installation provides approximately the same feature set as Mac OS 9, but as you’d expect in a beta, some of the new components are more primitive than the mature ones from Mac OS 9. The best example of this is the new Dock, which replaces Mac OS 9’s Apple and Application menus and desktop, but doesn’t offer the same level of flexibility as the older tools in Mac OS 9.
As a Macintosh system, the most obvious changes in Mac OS X are the visual interface – Aqua – and the file system layout. The underlying system is already more stable, but this is a less obvious change. Classic Mac developers are beginning to move their software to Carbon, and as they do so they will begin to take advantage of Carbon’s new capabilities and advantages. For those interested in exploring further, there’s a wealth of new territory. NeXT developers are quickly moving over to Mac OS X, and adapting their applications for Cocoa. Darwin’s Unix environment provides a whole new range of capabilities, particularly in the areas of networking and programming. This is foreign ground for many Mac users, but the potential is considerable.
In the next installment of this article, I’ll talk about how the computer industry stands to be affected by Mac OS X’s merger of an underlying Unix structure with the qualities that make a Macintosh.
[Chris Pepper is a systems administrator in New York, and he’s just delighted that his "personal" Mac workstations are now running Unix like the servers he coddles for a living. Check out his Mac OS X Software and Information site for more on Apple’s new operating system.]