16.12.2012 Views

A Technical History of Apple's Operating Systems - Mac OS X Internals

A Technical History of Apple's Operating Systems - Mac OS X Internals

A Technical History of Apple's Operating Systems - Mac OS X Internals

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A <strong>Technical</strong> <strong>History</strong><br />

<strong>of</strong> Apple’s <strong>Operating</strong><br />

<strong>Systems</strong><br />

Amit Singh<br />

A Supplementary Document for Chapter 1 from<br />

the book <strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong>: A <strong>Systems</strong> Approach.<br />

Copyright © Amit Singh. All Rights Reserved. Portions Copyright © Pearson Education.<br />

Document Version 2.0.1 (July 28, 2006)<br />

Latest version available at http://osxbook.com/book/bonus/chapter1/


This page intentionally left blank.


Dear Reader<br />

This is a supplementary document for Chapter 1 from my book <strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong>:<br />

A <strong>Systems</strong> Approach. A subset (about 30%) <strong>of</strong> this document appears<br />

in the book as the first chapter with the title Origins <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X.<br />

This document is titled A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong>.<br />

Whereas the book’s abridged version covers the history <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X, this<br />

document’s coverage is considerably broader. It encompasses not only <strong>Mac</strong> <strong>OS</strong><br />

X and its relevant ancestors, but the various operating systems that Apple has<br />

dabbled with since the company’s inception, and many other systems that were<br />

direct or indirect sources <strong>of</strong> inspiration.<br />

This was the first chapter I wrote for the book. It was particularly difficult to<br />

write in terms <strong>of</strong> the time and other resources required in researching the material.<br />

I <strong>of</strong>ten had to find and scavenge ancient documentation, s<strong>of</strong>tware, and<br />

hardware (all actual screenshots shown in this document were captured first<br />

hand.) However, I couldn’t include the chapter in its original form in the book.<br />

The book grew in size beyond everybody’s expectations—1680 pages! Therefore,<br />

it was hard to justify the inclusion <strong>of</strong> this much history, even if it is interesting<br />

history.<br />

I strongly believe that reading this document will help in understanding the evolution<br />

<strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X, and, to some extent, <strong>of</strong> some aspects <strong>of</strong> modern-day operating<br />

systems. An important reality <strong>of</strong> technology, and <strong>of</strong> computing in particular,<br />

is that many things that we think <strong>of</strong> as “new ideas” are not quite new. As<br />

Alan Kay once said, “Most ideas come from previous ideas.” This is also true in the<br />

case <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X. As one digs the past <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X and its predecessors, one<br />

begins to understand how ancient things influenced not-so-ancient things, and<br />

the fact that we owe what we have today to many more people than are usually<br />

credited.<br />

Please note again that this document is not the same as the book’s first chapter.<br />

In particular, this document was not copyedited, composited, or pro<strong>of</strong>read by<br />

the publisher. I prepared this PDF from my “raw” manuscript. Therefore, this<br />

document is not an example <strong>of</strong> the book’s final typesetting or other production<br />

aspects.<br />

I hope you enjoy reading this document and the book. Just as this document<br />

provides a super-detailed history <strong>of</strong> Apple’s operating systems, the book itself is<br />

super-detailed on the internals <strong>of</strong> modern day <strong>Mac</strong> <strong>OS</strong> X. It is not at all a book<br />

about using <strong>Mac</strong> <strong>OS</strong> X—it is about the system’s design and implementation.<br />

Therefore, I expect it to appeal to all operating system enthusiasts and students.<br />

Amit Singh<br />

Sunnyvale, California<br />

http://osxbook.com/contact/


This page intentionally left blank.


About <strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong><br />

<strong>Mac</strong> <strong>OS</strong> X was released in March 2001, but many components, such as<br />

<strong>Mac</strong>h and BSD, are considerably older. Understanding the design, implementation,<br />

and workings <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X requires examination <strong>of</strong> several<br />

technologies that differ in their age, origins,<br />

philosophies, and roles.<br />

<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong>: A <strong>Systems</strong> Approach<br />

(Amazon page) is the first book<br />

that dissects the internals <strong>of</strong> the system,<br />

presenting a detailed picture that grows<br />

incrementally as you read. For example,<br />

you will learn the roles <strong>of</strong> the firmware,<br />

the bootloader, the <strong>Mac</strong>h and<br />

BSD kernel components (including the<br />

process, virtual memory, IPC, and<br />

file system layers), the object-oriented<br />

I/O Kit driver framework, user libraries,<br />

and other core pieces <strong>of</strong> s<strong>of</strong>tware.<br />

You will learn how these pieces connect<br />

and work internally, where they originated,<br />

and how they evolved. The book<br />

also covers several key areas <strong>of</strong> the<br />

Intel-based <strong>Mac</strong>intosh computers.<br />

Over 1600 pages <strong>of</strong> the what, how, and why <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X!<br />

A solid understanding <strong>of</strong> system internals is immensely useful in design,<br />

development, and debugging for programmers <strong>of</strong> various skill levels. System<br />

programmers can use the book as a reference and to construct a better<br />

picture <strong>of</strong> how the core system works. Application programmers can gain a<br />

deeper understanding <strong>of</strong> how their applications interact with the system.<br />

System administrators and power users can use the book to harness the<br />

power <strong>of</strong> the rich environment <strong>of</strong>fered by <strong>Mac</strong> <strong>OS</strong> X. Finally, members <strong>of</strong><br />

the Windows, Linux, BSD, and other Unix communities will find the book<br />

valuable in comparing and contrasting <strong>Mac</strong> <strong>OS</strong> X with their respective systems.<br />

Please visit the book’s web site (osxbook.com) for more information on<br />

the book, including a detailed Table <strong>of</strong> Contents and links to reviews.


This page intentionally left blank.


A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.1. First Bytes into an Apple........................................................... 6<br />

1.1.1. Apple I........................................................................................................ 6<br />

1.1.2. Apple ][ ..................................................................................................... 10<br />

1.1.2.1. Apple D<strong>OS</strong>................................................................................................... 11<br />

1.1.2.2. Apple Pascal................................................................................................ 12<br />

1.1.2.3. Apple CP/M................................................................................................. 13<br />

1.1.3. Apple /// .................................................................................................... 14<br />

1.1.3.1. Apple S<strong>OS</strong>................................................................................................... 14<br />

1.1.3.2. Apple ProD<strong>OS</strong>.............................................................................................. 16<br />

1.2. Inspirations............................................................................... 17<br />

1.2.1. Memex..................................................................................................... 18<br />

1.2.2. Sketchpad................................................................................................ 19<br />

1.2.3. NLS: The oNLine System......................................................................... 21<br />

1.2.3.1. The First Computer Mouse.......................................................................... 21<br />

1.2.3.2. A 5-Chord Key Set....................................................................................... 22<br />

1.2.3.3. Document Processing................................................................................. 22<br />

1.2.3.4. Hypertext and Image Maps......................................................................... 22<br />

1.2.3.5. Searching..................................................................................................... 23<br />

1.2.3.6. Windows...................................................................................................... 23<br />

1.2.3.7. Collaboration............................................................................................... 23<br />

1.2.3.8. Live, Interactive Collaboration..................................................................... 24<br />

1.2.3.9. The Result................................................................................................... 24<br />

1.2.4. Smalltalk................................................................................................... 25<br />

1.2.5. Xerox Alto................................................................................................ 30<br />

1.2.5.1. Alto <strong>OS</strong>......................................................................................................... 33<br />

1.2.5.2. Alto Executive.............................................................................................. 35<br />

1.2.5.3. NetExec....................................................................................................... 36<br />

1.2.5.4. Programming Facilities................................................................................ 37<br />

1.2.5.5. Applications................................................................................................. 38<br />

1.2.5.6. Networking................................................................................................... 38<br />

1.2.5.7. Worms......................................................................................................... 40<br />

1.2.6. Xerox STAR System................................................................................ 41<br />

1.3. The Graphical Age at Apple..................................................... 43<br />

1.3.1. Lisa.......................................................................................................... 44<br />

1.3.1.1. Packaging.................................................................................................... 45<br />

1.3.1.2. Processor and Memory............................................................................... 45<br />

1.3.1.3. Display......................................................................................................... 46<br />

1.3.1.4. Storage........................................................................................................ 46<br />

1.3.1.5. Expansion.................................................................................................... 47<br />

1


2 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.3.1.6. Lisa <strong>OS</strong>........................................................................................................ 47<br />

1.3.1.7. Lisa WorkShop............................................................................................ 55<br />

1.3.1.8. Lisa’s Fate................................................................................................... 56<br />

1.3.2. The <strong>Mac</strong>intosh......................................................................................... 57<br />

1.4. Many <strong>Systems</strong> for Many Apples.............................................. 63<br />

1.4.1. System S<strong>of</strong>tware Releases 2 - 6.............................................................. 63<br />

1.4.2. What Color is Your System? .................................................................... 65<br />

1.4.3. GS/<strong>OS</strong>..................................................................................................... 66<br />

1.4.4. A/UX......................................................................................................... 68<br />

1.5. Seeking Power.......................................................................... 72<br />

1.5.1. System 7.................................................................................................. 72<br />

1.5.2. AIM for POWER....................................................................................... 74<br />

1.5.2.1. A RISCy Look Back...................................................................................... 74<br />

1.5.2.2. Apple Wants RISC....................................................................................... 76<br />

1.5.2.3. Apple Likes RISC: ARM............................................................................... 78<br />

1.5.3. <strong>Mac</strong> <strong>OS</strong> for PowerPC.............................................................................. 79<br />

1.5.4. MAE......................................................................................................... 80<br />

1.5.5. Apple Workgroup Server.......................................................................... 84<br />

1.5.6. NetWare for PowerPC............................................................................. 85<br />

1.5.7. AIX for PowerPC...................................................................................... 85<br />

1.6. Quest for the <strong>Operating</strong> System.............................................. 87<br />

1.6.1. Star Trek................................................................................................... 88<br />

1.6.2. Raptor...................................................................................................... 89<br />

1.6.3. NuKernel.................................................................................................. 89<br />

1.6.4. Tal<strong>OS</strong>....................................................................................................... 89<br />

1.6.5. Copland.................................................................................................... 90<br />

1.6.6. Gershwin.................................................................................................. 93<br />

1.6.7. Be<strong>OS</strong>....................................................................................................... 93<br />

1.6.8. Plan A...................................................................................................... 95<br />

1.7. The NeXT Chapter..................................................................... 95<br />

1.7.1. NEXTSTEP.............................................................................................. 96<br />

1.7.2. OPENSTEP........................................................................................... 101<br />

1.8. The <strong>Mac</strong>h Factor..................................................................... 102<br />

1.8.1. Rochester’s Intelligent Gateway............................................................ 103<br />

1.8.2. Accent.................................................................................................... 104<br />

1.8.3. <strong>Mac</strong>h...................................................................................................... 106<br />

1.8.4. MkLinux................................................................................................. 111<br />

1.8.5. Musical Names...................................................................................... 112<br />

1.9. Strategies................................................................................ 113<br />

1.9.1. <strong>Mac</strong> <strong>OS</strong> 8 and 9..................................................................................... 115<br />

1.9.2. Rhapsody............................................................................................... 117<br />

1.9.2.1. Blue Box.................................................................................................... 119


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 3<br />

1.9.2.2. Yellow Box................................................................................................. 120<br />

1.10. Towards <strong>Mac</strong> <strong>OS</strong> X............................................................... 121<br />

1.10.1. <strong>Mac</strong> <strong>OS</strong> X Server 1.x........................................................................... 123<br />

1.10.2. <strong>Mac</strong> <strong>OS</strong> X Developer Previews........................................................... 123<br />

1.10.2.1. DP1.......................................................................................................... 123<br />

1.10.2.2. DP2.......................................................................................................... 124<br />

1.10.2.3. DP3.......................................................................................................... 124<br />

1.10.2.4. DP4.......................................................................................................... 125<br />

1.10.3. <strong>Mac</strong> <strong>OS</strong> X Public Beta......................................................................... 125<br />

1.10.4. <strong>Mac</strong> <strong>OS</strong> X 10.x.................................................................................... 127<br />

1.10.4.1. <strong>Mac</strong> <strong>OS</strong> X 10.0........................................................................................ 128<br />

1.10.4.2. <strong>Mac</strong> <strong>OS</strong> X 10.1........................................................................................ 129<br />

1.10.4.3. <strong>Mac</strong> <strong>OS</strong> X 10.2........................................................................................ 130<br />

1.10.4.4. <strong>Mac</strong> <strong>OS</strong> X 10.3........................................................................................ 131<br />

1.10.4.5. <strong>Mac</strong> <strong>OS</strong> X 10.4........................................................................................ 131<br />

1.11. Others.................................................................................... 133<br />

1.11.1. <strong>Mac</strong> <strong>OS</strong> on the Pippin.......................................................................... 133<br />

1.11.2. Newton <strong>OS</strong>........................................................................................... 137<br />

1.11.2.1. Newton <strong>OS</strong>............................................................................................... 137<br />

1.11.2.2. System Services...................................................................................... 138<br />

1.11.2.3. Application Components.......................................................................... 138<br />

1.11.3. The iPod’s <strong>Operating</strong> System.............................................................. 139


4 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong>


C H A P T E R 1<br />

A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

“Most ideas come from previous ideas.”—Alan Curtis Kay<br />

The <strong>Mac</strong> <strong>OS</strong> X operating system represents a rather successful coming<br />

together <strong>of</strong> paradigms, ideologies, and technologies that have <strong>of</strong>ten<br />

resisted each other in the past. A good example is the cordial relationship that exists<br />

between the command-line and graphical interfaces in <strong>Mac</strong> <strong>OS</strong> X. The system is a<br />

result <strong>of</strong> the trials and tribulations <strong>of</strong> Apple, NeXT, as well as their user and devel-<br />

oper communities. <strong>Mac</strong> <strong>OS</strong> X exemplifies how a capable system can result from the<br />

direct or indirect efforts <strong>of</strong> corporations, academic and research communities, the<br />

Open Source and Free S<strong>of</strong>tware movements, and <strong>of</strong> course, individuals.<br />

Apple has been around since 1976, and many accounts <strong>of</strong> its history have been<br />

told. If the story <strong>of</strong> Apple as a company is fascinating, so is the technical history <strong>of</strong><br />

Apple’s operating systems. This chapter discusses operating systems that Apple has<br />

created in the past, those that it attempted to create, and some that influenced or in-<br />

spired Apple. In this discussion, we will come across several technologies whose<br />

confluence eventually led to <strong>Mac</strong> <strong>OS</strong> X.<br />

1


2 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.1. FIRST BYTES INTO AN APPLE<br />

As 1975 came to an end, Steve Wozniak had finished his prototype <strong>of</strong> a home-brew<br />

computer built using inexpensive components. Hewlett-Packard, Wozniak’s em-<br />

ployer at that time, was not interested in his creation. Wozniak requested, and was<br />

soon granted, a release <strong>of</strong> the technology. On April first, 1976, Steve Jobs, Steve<br />

Wozniak, and an Atari engineer named Ronald Wayne founded Apple. The com-<br />

pany’s first product was Wozniak’s computer: the Apple I.<br />

1.1.1. Apple I<br />

The Apple I was based on an 8-bit processor, the 6502, which was made by M<strong>OS</strong><br />

Technology, Inc. <strong>of</strong> Norristown, Pennsylvania. The 6502 was designed by ex-<br />

Motorola engineers. It was similar to the more expensive 6800 from Motorola. An-<br />

other alternative, the Intel 8080, was also more expensive than the 6502. The 6502<br />

was chosen primarily because it was cheap—it could be had for $25, whereas the<br />

6800 and the 8080 were well over $100 apiece.<br />

M<strong>OS</strong> Technology advertised in 1975 that it would sell the 6502 at a dis-<br />

counted price <strong>of</strong> $20 at the Wescon electronics show in San Francisco. The<br />

6502’s low price and popularity would eventually cause Intel and Motorola<br />

to lower the prices <strong>of</strong> their processors. Motorola had also sued M<strong>OS</strong> Tech-<br />

nology over the similarity <strong>of</strong> the 650x processor line to the 6800. The 6501<br />

was consequently withdrawn from the market.<br />

The 6502 came in a 40-pin package. The Apple I used a clock oscillator with a<br />

frequency <strong>of</strong> 1.023 MHz. Moreover, in the Apple I, 4 out <strong>of</strong> every 65 clock-cycles<br />

were dedicated to memory refresh. Therefore, the effective cycle frequency was<br />

0.960 MHz. Other key features <strong>of</strong> the processor included the following.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 3<br />

• An instruction set consisting <strong>of</strong> 56 documented instructions<br />

• Interrupt capability with support for non-maskable interrupts<br />

• A 16-bit address bus with an addressable memory range <strong>of</strong> up to 64KB<br />

• Over a dozen addressing modes<br />

• An 8-bit accumulator that was used for arithmetic and logical operations<br />

• Two 8-bit index registers X and Y, which were typically used in indexed<br />

addressing modes<br />

• A 16-bit program counter logically divided into “PCL” (low bits 0–7)<br />

and “PCH” (high bits 8–15) halves<br />

• An 8-bit processor status register consisting <strong>of</strong> the following flags: Negative<br />

(N), Overflow (V), Break Command (B), Decimal mode (D), Interrupt<br />

Disable (I), Zero (Z), and Carry (C)<br />

• An 8-bit stack pointer (the high byte <strong>of</strong> the logical stack pointer was<br />

hardwired to the value 1, limiting the stack to be 256 bytes in size, and to<br />

lie between addresses 0x100 and 0x1FF)<br />

The Apple I used 16-pin dynamic RAM. It had sockets for up to 8KB <strong>of</strong> on-<br />

board memory. The total memory could be expanded to 64KB through a 44-pin<br />

edge connector. All refreshing <strong>of</strong> dynamic memory, including the <strong>of</strong>f-board expan-<br />

sion memory, was performed automatically. The crystal oscillator was the source for<br />

the entire system timing.<br />

The Apple I had a built-in video terminal. The output video signal was a com-<br />

posite signal consisting <strong>of</strong> sync and video information. It could be sent to any stan-<br />

dard raster-scan-based video display monitor. In particular, the Apple I could be<br />

directly connected to a television with an RF modulator, yielding an automatic<br />

scrolling display with 24 lines per page, and a frame rate <strong>of</strong> 60.05 Hz. Each line had<br />

40 characters, with the character matrix being 5×7 in size. Owing to the high cost <strong>of</strong><br />

RAM, video terminals were designed with shift registers at that time. The Apple I’s<br />

display memory was comprised <strong>of</strong> seven 1K dynamic shift registers.<br />

The Apple I also had a keyboard interface and a cassette board meant to work<br />

with regular cassette recorders. The “computer” was simply a motherboard (see


4 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Figure 1–1.) The user had to provide a case, a display device, an ASCII-encoded<br />

keyboard, and two AC power sources.<br />

The Apple I was introduced at a price <strong>of</strong> $666.66. It came with 4KB <strong>of</strong> RAM<br />

and a tape <strong>of</strong> Apple BASIC.<br />

FIGURE 1–1 The Apple I computer board<br />

The Apple I incorporated a firmware resident system monitor—sometimes<br />

called the Hex Monitor. It was an extremely simple program that could be thought<br />

<strong>of</strong> as its operating system. The program was 256 bytes in size, residing between lo-<br />

cations 0xFF00 and 0xFFFF in the PROM. 1 It made use <strong>of</strong> the keyboard and the<br />

display to present the user with a command line for viewing memory contents, typ-<br />

ing programs, executing programs, and so on. Certain RAM locations were used for<br />

designated purposes by the monitor, and therefore, were unavailable to the user for<br />

other purposes.<br />

1 Programmable Read-Only Memory


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 5<br />

Figure 1–2 shows a test program entered at the monitor’s “backslash” prompt.<br />

The first line <strong>of</strong> hexadecimal numbers is the program itself. Its purpose is to print a<br />

continuous stream <strong>of</strong> ASCII characters on the display. Typing 0.A prints a listing <strong>of</strong><br />

the program, and typing R runs the program.<br />

FIGURE 1–2 The Apple I’s firmware-resident system monitor<br />

Compared to the UNIX general-purpose time-sharing system, which was in its<br />

Sixth Edition then, the Apple I’s operating environment was decidedly puny. How-<br />

ever, a contemporary computer system running UNIX would have cost many thou-<br />

sands <strong>of</strong> dollars. The Apple I was an attempt to make computing affordable for hob-<br />

byists, and as those behind it hoped, for the masses. Within the first nine months <strong>of</strong><br />

the Apple I’s introduction, all but a few <strong>of</strong> the two hundred or so units manufactured<br />

had been sold.


6 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.1.2. Apple ][<br />

The Apple I had a life span <strong>of</strong> less than a year, but its successor would live much<br />

longer. Wozniak soon began work on the Apple ][. Although based on the 6502<br />

processor as well, the Apple ][ was introduced as an integrated computer: it came<br />

completely assembled in a beige plastic case. The contents <strong>of</strong> the original Apple ][<br />

package included the following.<br />

• An Apple ][ P.C. (“Printed Circuit”) Board complete with specified<br />

RAM memory<br />

• A D.C. power connector with cable<br />

• A 2” speaker with cable<br />

• A Preliminary manual<br />

• Two demonstration cassette tapes<br />

• Two 16-pin headers plugged into locations A7 2 and J14 on the Apple ][<br />

board<br />

Latter models varied in their configurations as well as bundled accessories.<br />

For example, Apple ][ computers with 16KB or more memory came with game<br />

paddles and the STARTREK game tape.<br />

The Apple ][ provided a machine-level monitor. Depending on the Apple ][<br />

model, resetting the computer could either leave the user in the monitor, or could<br />

auto-start the ROM, dropping the user in BASIC. Calling a specific subroutine 3<br />

from BASIC allowed access to the monitor. The monitor provided commands for<br />

tasks such as the following.<br />

• Examining, changing, moving, and verifying memory<br />

• Performing cassette I/O<br />

2 The Apple ][’s keyboard connector was a 16-pin IC socket at location A7 on the main circuit board,<br />

whereas a 16-pin game I/O connector was located at J14.<br />

3 Typing CALL -151 at the BASIC prompt provided access to the monitor.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 7<br />

• Configuring the video mode<br />

• Assembling, disassembling, running, and debugging machine code<br />

Upon its release, the Apple ][ was the first personal computer to display color<br />

graphics. Apple provided special s<strong>of</strong>tware to make use <strong>of</strong> the Apple ][’s capabilities,<br />

including its graphical prowess. For example, the High-Resolution <strong>Operating</strong> Sub-<br />

routines package provided graphical subroutines usable from both BASIC and ma-<br />

chine language. Using these subroutines, the programmer could initialize high-<br />

resolution mode, clear the screen, plot a point, draw a line, and draw or animate<br />

predefined shapes.<br />

Various Apple ][ machines were made during the long life-span <strong>of</strong> the Apple ][<br />

line: the Apple ][+, ][e, ][c, ][e Enhanced, ][e Platinum, the 16-bit ][GS, and the ][c+<br />

that was introduced in 1988 as the last Apple ][ model. Many <strong>of</strong> these models had<br />

multiple revisions themselves. As we will discuss next, several operating systems<br />

were created for the Apple ][ family.<br />

1.1.2.1. Apple D<strong>OS</strong><br />

Shortly after the release <strong>of</strong> the Apple ][ in 1977, it was realized that a better storage<br />

solution than the existing one (which was based on cassette tape) was imperative for<br />

the computer. Wozniak created a brilliant design for a floppy disk drive—the Disk<br />

][—and thus there was need for a disk operating system (D<strong>OS</strong>). Apple’s first ver-<br />

sion <strong>of</strong> a D<strong>OS</strong> was released as Apple D<strong>OS</strong> 3.1 in July 1978.<br />

Apple D<strong>OS</strong> is unrelated to Micros<strong>of</strong>t’s popular MS-D<strong>OS</strong>. During a time<br />

when it was a luxury to have disk drives, and for an operating system to<br />

support them, many such “disk operating systems” had the term D<strong>OS</strong> in<br />

their names.<br />

The first release <strong>of</strong> Apple D<strong>OS</strong> had the version 3.1 (as opposed to, say, 1.0)<br />

because one <strong>of</strong> the implementers, Paul Laughton, incremented a revision counter <strong>of</strong><br />

the format x.y every time the source code was recompiled. The counter started with


8 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

x being 0 and y being 1. Every time y reached 9, x was incremented by 1. Apple<br />

D<strong>OS</strong> was beta tested as version 3.0. Figure 1–3 shows a screenshot from Apple<br />

D<strong>OS</strong> 3.3.<br />

FIGURE 1–3 Apple D<strong>OS</strong> 3.3<br />

1.1.2.2. Apple Pascal<br />

The p-System was a Pascal language and development system that was very popular<br />

in the 1970s and the early 1980s. It was created at the University <strong>of</strong> California, San<br />

Diego (UCSD). It was a portable operating system, essentially a stack-based virtual


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 9<br />

machine running p-Code, 4 with UCSD Pascal being the most popular programming<br />

language for it.<br />

In 1978, most <strong>of</strong> Apple’s s<strong>of</strong>tware development was around the BASIC and<br />

assembly languages. Two Apple employees, Bill Atkinson and Jef Raskin, were in-<br />

strumental in introducing the Pascal language at Apple. They also licensed the p-<br />

System from UCSD.<br />

UCSD students Mark Allen and Richard Gleaves developed a p-Code inter-<br />

preter for the 6502 in the summer <strong>of</strong> 1978. This interpreter became the basis for the<br />

Apple ][ Pascal 5 that was released in 1979. Apple ][ Pascal included a compiler, an<br />

assembler, a filer, a modal editor, and various utility programs. The system was<br />

command-line-driven. Pascal code would compile into p-Code, which would then<br />

be interpreted by the 6502-native interpreter. It supported program modules called<br />

units, which could be segmented, and therefore, were typically memory-resident<br />

only when needed. Apple ][ Pascal’s memory usage was limited to 64KB.<br />

Apple Pascal lived as a product for five years, with the Pascal support in the<br />

<strong>Mac</strong>intosh Programmer’s Workshop (MPW) eventually replacing it.<br />

1.1.2.3. Apple CP/M<br />

Micros<strong>of</strong>t introduced a coprocessor card, a circuit board named S<strong>of</strong>tCard, in 1980.<br />

It was originally called the Micros<strong>of</strong>t Z-80 S<strong>of</strong>tCard, but Micros<strong>of</strong>t had to rename it<br />

to avoid a lawsuit from Zilog, the makers <strong>of</strong> the Z-80 processor. The S<strong>of</strong>tCard<br />

plugged into a slot and added a Z-80 processor, essentially converting an Apple ][<br />

into two computers. An Apple ][ with a S<strong>of</strong>tCard could run Z-80 programs based on<br />

4 p-Code was akin to what is now commonly known as bytecode.<br />

5 Apple’s Pascal system for the Apple ][ was derived from a specific implementation <strong>of</strong> the p-Code<br />

architecture: UCSD Pascal II.1.


10 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

the popular CP/M operating system, 6 which had a rich s<strong>of</strong>tware library <strong>of</strong> programs<br />

such as dBase and WordStar. Programming languages such as Micros<strong>of</strong>t ANSI<br />

Standard COBOL and FORTRAN could also be used on the Apple ][.<br />

Besides S<strong>of</strong>tCard, there existed other coprocessor cards for the Z-80 and for<br />

other processors such as the Motorola 6809. For example, the Stellation Mill 6809<br />

card allowed the <strong>OS</strong>-9 real-time operating system 7 to run on compatible Apple ma-<br />

chines.<br />

1.1.3. Apple ///<br />

The Apple /// was introduced in 1980 as a computer for business users. Apple<br />

originally planned to ship the Apple /// with a suite <strong>of</strong> <strong>of</strong>fice programs: a spread-<br />

sheet, a word processor, a database program, and a business-graphics program.<br />

However, the Apple /// shipped late, and initially ran only the VisiCalc spreadsheet<br />

program. It had a new operating system called S<strong>OS</strong>.<br />

1.1.3.1. Apple S<strong>OS</strong><br />

S<strong>OS</strong> 8 <strong>of</strong>ficially stood for “Sophisticated <strong>Operating</strong> System,” although it was appar-<br />

ently an acronym for “Sara’s <strong>Operating</strong> System,” named after an engineer’s daugh-<br />

ter.<br />

Every S<strong>OS</strong> program loaded the operating system into memory. A S<strong>OS</strong> applica-<br />

tion disk consisted <strong>of</strong> a kernel (S<strong>OS</strong>.Kernel); an interpreter (S<strong>OS</strong>.Interp), which<br />

could be the application itself, or something that the application used; and a set <strong>of</strong><br />

drivers (S<strong>OS</strong>.Driver). Unlike the Apple ][, which used ROM-based device drivers<br />

6 CP/M was created by Gary Kildall, who founded a company called Intergalactic Digital Research to<br />

market the system.<br />

7 Unrelated to <strong>Mac</strong> <strong>OS</strong> 9.<br />

8 Pronounced “sauce” (which would make it “Apple Sauce.”)


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 11<br />

(such as those residing on I/O card ROMs), S<strong>OS</strong> device drivers were RAM-based,<br />

and could be “installed,” which was a first for a commercial operating system at<br />

that time. Figure 1–4 shows a screenshot from S<strong>OS</strong>.<br />

FIGURE 1–4 Apple S<strong>OS</strong><br />

The Apple /// also had a Pascal system that was derived from Apple ][ Pascal,<br />

but had language extensions, access to up to 256KB <strong>of</strong> memory, a floating-point<br />

implementation called Standard Apple Numerical Environment (SANE), and the<br />

ability to access S<strong>OS</strong> from Pascal programs using the S<strong>OS</strong>IO unit.<br />

Steve Wozniak once called S<strong>OS</strong> “the finest operating system” for a micro-<br />

computer. He lamented, however, that S<strong>OS</strong> was closed-source. In general,<br />

Apple’s attitude with the Apple /// was that <strong>of</strong> starkly heightened secrecy as<br />

compared to earlier systems.


12 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

S<strong>OS</strong> evolved into Apple ProD<strong>OS</strong>.<br />

1.1.3.2. Apple ProD<strong>OS</strong><br />

Apple ProD<strong>OS</strong> was first released as version 1.0 in October 1983. Based on S<strong>OS</strong>, it<br />

was Apple’s replacement for Apple D<strong>OS</strong> 3.3. ProD<strong>OS</strong> provided better facilities for<br />

programming in BASIC, assembly language, and machine language; better interrupt<br />

handling; faster disk I/O with direct block access; and so on. Figure 1–5 shows a<br />

screenshot from ProD<strong>OS</strong>.<br />

FIGURE 1–5 Apple ProD<strong>OS</strong><br />

ProD<strong>OS</strong> also had a relatively sophisticated hierarchical file system with fea-<br />

tures such as the following.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 13<br />

• Multiple logical volumes on one physical volume<br />

• Support for up to 20 different file types, <strong>of</strong> which 10 could be userdefined<br />

• Up to 8 open files at any given time<br />

• An arbitrary number <strong>of</strong> files in a subdirectory, although the volume directory<br />

was limited to a maximum <strong>of</strong> 51 files<br />

When the 16-bit Apple ][ was released, ProD<strong>OS</strong> was at version 1.1.1. It forked<br />

into ProD<strong>OS</strong> 8 and ProD<strong>OS</strong> 16 for 8-bit and 16-bit processors, respectively.<br />

1.2. INSPIRATIONS<br />

1984 is well known in the Apple world as the year the <strong>Mac</strong>intosh was introduced. In<br />

1983, Apple had released the Lisa computer, which represented a fundamental step<br />

forward in mainstream personal computing. Lisa and <strong>Mac</strong>intosh were greatly in-<br />

spired—directly or indirectly—by the work done at Xerox Palo Alto Research Cen-<br />

ter (PARC). Sources <strong>of</strong> such inspirations included the Smalltalk environment, the<br />

Xerox STAR system, and the Xerox Alto. Most <strong>of</strong> the ideas pioneered in these sys-<br />

tems remain relevant today—in <strong>Mac</strong> <strong>OS</strong> X and in other modern systems.<br />

To fully understand the lineage <strong>of</strong> the <strong>Mac</strong>intosh, we must take a few detours<br />

and go further back in time, first to 1945, then to 1963, and finally to 1968—before<br />

the advent <strong>of</strong> UNIX, long before Apple or Micros<strong>of</strong>t were even founded, and in<br />

fact, decades 9 before the first version <strong>of</strong> Micros<strong>of</strong>t Windows or the <strong>Mac</strong>intosh were<br />

released.<br />

9 The first version <strong>of</strong> Micros<strong>of</strong>t Windows was released on June 28, 1985. Micros<strong>of</strong>t had made the first<br />

Windows announcement in November 1983. Micros<strong>of</strong>t’s selling point was that Windows provided a<br />

new s<strong>of</strong>tware development and runtime environment that used bitmap displays and mice, thus freeing<br />

the user from the “MS-D<strong>OS</strong> method <strong>of</strong> typing commands at the C prompt (C:\).”


14 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.2.1. Memex<br />

Vannevar Bush published an article titled As We May Think in the July 1945 edition<br />

<strong>of</strong> The Atlantic Monthly. 10 Bush was then the Director <strong>of</strong> the Office <strong>of</strong> Scientific<br />

Research and Development in the United States. His article described, among sev-<br />

eral incredible visionary insights and observations, a hypothetical device Bush had<br />

conceived many years earlier: the memex.<br />

The memex was a mechanized private file and library—a supplement to hu-<br />

man memory. It would store a vast amount <strong>of</strong> information and allow for rapid<br />

searching <strong>of</strong> its contents. Bush envisioned that a user could store books, letters, re-<br />

cords, and any other arbitrary information on the memex, whose storage capacity<br />

would be large enough. The information could be textual or graphic. Other features<br />

<strong>of</strong> the memex included the following.<br />

• It would be incorporated into an ordinary looking desk, thus fitting in the<br />

user’s normal work environment. Its user interface would consist <strong>of</strong> a<br />

keyboard, buttons, levers, and translucent projection screens.<br />

• Its primary storage medium would be micr<strong>of</strong>ilm.<br />

• New material would be primarily available for purchase on micr<strong>of</strong>ilm. A<br />

variety <strong>of</strong> content, ranging from books to daily newspapers, could be<br />

trivially inserted into the memex.<br />

• The memex would have photocopying abilities so that users could conveniently<br />

add their own content to the machine’s data store.<br />

• A lever would allow a user to flip forward and backward through pages<br />

<strong>of</strong> information, with the browsing speed dependent on how far the lever<br />

was moved. A shortcut would warp to the first page <strong>of</strong> the index.<br />

• The user would be able to arbitrarily annotate preexisting information in<br />

the memex.<br />

• The memex would not only index its content normally, but would allow<br />

the user to build “trails” <strong>of</strong> information, connecting one piece to another<br />

to build associations between related bodies <strong>of</strong> knowledge. Thus, Bush<br />

10 As We May Think,” by Vannevar Bush (Atlantic Monthly 176:1, July 1945, pp. 101–108).


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 15<br />

described the core idea behind the web: the hyperlink—almost half a<br />

century before the first web browser was created.<br />

Bush made numerous uncanny predictions. He suggested that some day an<br />

entire encyclopedia would be available on a storage medium the size <strong>of</strong> a matchbox.<br />

He envisioned that people from all walks <strong>of</strong> life—chemists, historians, lawyers, pat-<br />

ent attorneys, physicians, and so on—would use the memex to perform hitherto im-<br />

possible or inordinately difficult tasks.<br />

The modern-day Internet, the development and proliferation <strong>of</strong> high-density<br />

storage media, and the critical dependence <strong>of</strong> computer users on searching, are re-<br />

sounding testimonies to Bush’s foresight.<br />

1.2.2. Sketchpad<br />

In January 1963, Ivan Edward Sutherland, who was a graduate student at the Mas-<br />

sachusetts Institute <strong>of</strong> Technology, submitted his Ph. D. thesis titled Sketchpad, A<br />

Man-<strong>Mac</strong>hine Graphical Communication System. Sutherland’s thesis advisor was<br />

Claude Elwood Shannon, the world-renowned mathematical engineer who is known<br />

as “the father <strong>of</strong> information theory.”<br />

Sutherland had begun work on a drawing system for the TX-2 computer in the<br />

fall <strong>of</strong> 1961. The Sketchpad system was primarily designed and developed within<br />

the next year and a half.<br />

TX-2<br />

The TX-2 computer was built in 1956. It had a word length <strong>of</strong> 36 bits, but it sup-<br />

ported breaking a 36-bit word into independent sub-words, even allowing sub-word<br />

lengths to differ. It had a large amount <strong>of</strong> memory for its time: a vacuum-tube-driven<br />

core <strong>of</strong> 64K words, and a faster, transistor-driven core <strong>of</strong> 4K words. It had a paper-tape<br />

reader and could also use magnetic tape as auxiliary storage.


16 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

The primary input device <strong>of</strong> Sketchpad was the light pen: a hand held photo-<br />

diode device with the shape and dimensions <strong>of</strong> a pen. The light pen was connected<br />

to the computer by a coaxial cable, through which it communicated to the computer<br />

when its field-<strong>of</strong>-view encompassed a spot on the TX-2’s display. The pen’s barrel<br />

could be rotated to vary the distance between the photodiode and the lens at the<br />

pen’s tip, thus adjusting the field-<strong>of</strong>-view’s size.<br />

As the user drew directly on the screen using the light pen, Sketchpad inter-<br />

preted the drawing. Using straight-line segments and circle arcs as basic drawable<br />

shapes, the user could draw more complex shapes. The system treated on-screen<br />

shapes as objects 11 that could be operated upon. For example, transforms such as<br />

rotation, scaling, and translation could be applied to existing drawings. Once drawn,<br />

shapes could be saved, and reused as primitive units. 12 The light pen was used in<br />

conjunction with push-button controls. For example, the draw control created a new<br />

line segment or arc, with the drawn shape’s end-point remaining attached to the pen.<br />

Other examples <strong>of</strong> controls included circle center, move, delete, and instance.<br />

Sketchpad was demonstrated by creating electrical, mathematical, mechanical,<br />

scientific, and even artistic drawings. Moreover, arbitrary mathematical conditions,<br />

which could be the result <strong>of</strong> complex computations, could be applied to drawings.<br />

Sketchpad would automatically satisfy the conditions and alter the drawings to pic-<br />

torially display the results. It had various other mathematical abilities that made it a<br />

powerful graphical input program—for example, it allowed sub-pictures within pic-<br />

tures, with no intrinsic limit on the nesting level.<br />

Sketchpad drawings, or rather, their topologies, were stored in special files<br />

using data structures optimized for fast editing <strong>of</strong> the drawings.<br />

Sutherland received the Turing award in 1988 for his pioneering contribu-<br />

11 Sketchpad could be seen as an object-oriented graphics editor, and a precursor to object-oriented<br />

programming.<br />

12 Thus, Sketchpad provided the first example <strong>of</strong> the Prototype design pattern.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 17<br />

tions to the field <strong>of</strong> computer graphics. His work on Sketchpad would prove<br />

inspirational in the development <strong>of</strong> Smalltalk, which in turn would be an in-<br />

spiration for the advent <strong>of</strong> the graphical user interface at Apple.<br />

1.2.3. NLS: The oNLine System<br />

On December 9, 1968, an array <strong>of</strong> astounding technologies was demonstrated at the<br />

Convention Center in San Francisco during the Fall Joint Computer Conference<br />

(FJCC). Douglas Engelbart and his team <strong>of</strong> seventeen colleagues—working in the<br />

Augmentation Research Center at the Stanford Research Institute (SRI) in Menlo<br />

Park, California—presented NLS (oNLine System). NLS was an online 13 system<br />

they had been working on since 1962. The “astounding” adjective is justified by the<br />

quantity and quality <strong>of</strong> innovation demonstrated on that single day.<br />

Engelbart said 14 at the beginning <strong>of</strong> his presentation, “The research program<br />

that I am going to describe to you today is quickly characterizable by saying: if in<br />

your <strong>of</strong>fice, you as an intellectual worker were supplied with a computer display<br />

backed up by a computer that was alive for you all day and was instantly responsi-<br />

ble, err, responsive... how much value could you derive from that? Well that basi-<br />

cally characterizes what we’ve been pursuing for many years...”<br />

1.2.3.1. The First Computer Mouse<br />

Engelbart demonstrated the first computer mouse, a three-button pointing device<br />

with a tracking spot, or “bug,” on the screen. The mouse’s underside had two<br />

wheels that could roll or slide on a flat surface. Each wheel controlled a potentiome-<br />

ter. As the user moved the mouse, the respective rolling and sliding motions <strong>of</strong> the<br />

13 “Online” refers to the interactive nature <strong>of</strong> NLS. In the 1960s, computing was typically batch-<br />

oriented, which made an interactive system very appealing.<br />

14 Quoted from a video recording <strong>of</strong> Engelbart’s demonstration.


18 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

two wheels resulted in voltage changes that were translated to relative coordinate<br />

changes on the screen.<br />

1.2.3.2. A 5-Chord Key Set<br />

Another input device Engelbart used in his demonstration was a chord key set—a<br />

five-finger equivalent <strong>of</strong> a full-sized keyboard. The key set could be used to input<br />

up to 31 different characters (2 5 minus the one state when no keys are pressed.)<br />

1.2.3.3. Document Processing<br />

Engelbart showed that text could be entered, dragged, copied, pasted, formatted,<br />

scrolled, and grouped hierarchically in nested levels. Multiple lines <strong>of</strong> text could be<br />

collapsed into a single line. The text so created could be saved in files, with provi-<br />

sion for storing metadata such as the file’s owner and time <strong>of</strong> creation. The use <strong>of</strong> a<br />

mouse made these operations easier. Engelbart referred to the overall mechanism as<br />

view control.<br />

The system was useful while editing code as well—blocks <strong>of</strong> code could be<br />

expanded and collapsed, and even auto-completion was supported.<br />

Furthermore, documents could contain embedded statements for markup,<br />

which allowed formatting <strong>of</strong> documents for specific purposes such as printing.<br />

1.2.3.4. Hypertext and Image Maps<br />

Using hypertext, or text with hyperlinks, Engelbart could jump from one location to<br />

another. Hyperlinks could be used to facilitate access to search results, or could be<br />

explicitly used as visible or invisible “live” links to information.<br />

The system also had picture-drawing capabilities. Even pictures could have<br />

live hyperlinks, like latter-day image maps in web pages.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 19<br />

Origins <strong>of</strong> Hypertext<br />

Theodor Holm Nelson came up with the term “hypertext,” whereas the concept<br />

itself is ascribed to Vannevar Bush, who described it in the context <strong>of</strong> the memex ma-<br />

chine, as we saw earlier in this chapter. Nelson is noted for his Xanadu project, which<br />

was to be a worldwide electronic publishing system. He coined the term “hyper-text” in<br />

1965 to refer to a flexible, generalized, non-linear presentation <strong>of</strong> related information.<br />

1.2.3.5. Searching<br />

NLS provided powerful search facilities: keywords could be weighted, and search<br />

results were ordered accordingly. Results could also be presented as hyperlinks.<br />

1.2.3.6. Windows<br />

The computer screen could be split into a frozen display and a scanning window.<br />

While you were reading a manual, for example, and you needed to look up a term,<br />

you could split the screen and view the term’s definition in the dynamically chang-<br />

ing scanning window—similar to latter-day frames in web pages.<br />

1.2.3.7. Collaboration<br />

The system also kept track <strong>of</strong> who you were and what you were doing. People could<br />

work collaboratively on files, annotate each other’s text, and leave notes for each<br />

other—akin to modern-day document versioning systems. It was also possible to<br />

leave messages for one or more specific people. A special language, essentially a<br />

programmable filter, would allow a test to be associated with pieces <strong>of</strong> text. There-<br />

after, readers could only view what they were allowed to, as determined by the re-<br />

sult <strong>of</strong> the context-sensitive test.


20 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.2.3.8. Live, Interactive Collaboration<br />

The SRI team demonstrated live audio-video conferencing. The communicating<br />

parties could even have collaborative screen sharing, with each party having inde-<br />

pendent capabilities. For example, two people could look at the same display, but<br />

one <strong>of</strong> them would have read-only privileges, whereas the other would be able to<br />

modify the display.<br />

1.2.3.9. The Result<br />

Engelbart stated that NLS was a vehicle to allow humans to operate (compose,<br />

study, and modify) within the domain <strong>of</strong> complex information structures, where<br />

content represents concepts. NLS was meant to be a tool to navigate complex struc-<br />

tures: something linear text could not do well.<br />

Perhaps no discussion <strong>of</strong> individual components <strong>of</strong> NLS can convey how<br />

awe-inspiring the overall system that resulted from the integration <strong>of</strong> these<br />

parts was. NLS is best understood and appreciated by watching a record-<br />

ing 15 <strong>of</strong> the NLS demonstration.<br />

Engelbart was also involved in the creation <strong>of</strong> the ARPANET, 16 the precursor<br />

to the Internet. His team planned to create a special ARPANET service that would<br />

provide relevant network information. For example, the service would answer ques-<br />

tions such as the following.<br />

Who is providing what services?<br />

What protocol do I use to get there?<br />

Who is “down” (in the networking sense) today and who is “up”?<br />

15 Recordings <strong>of</strong> the NLS demonstration are available online at a Stanford University web site<br />

(http://sloan.stanford.edu/mousesite/1968Demo.html).<br />

16 The ARPANET began life in the late 1960s as a network consisting <strong>of</strong> only four computers, or network<br />

nodes. It was started by the U.S. Department <strong>of</strong> Defense Advanced Research Projects Agency<br />

(DARPA). SRI hosted one <strong>of</strong> the network nodes.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 21<br />

The inherent philosophy <strong>of</strong> the endeavors <strong>of</strong> Engelbart and his team was boot-<br />

strapping, which they defined as the recursive process <strong>of</strong> building tools that let you<br />

build better tools. A successful example <strong>of</strong> the bootstrapping philosophy is the<br />

UNIX operating system.<br />

Even with such impressive innovations, NLS ran into misfortune. Several NLS<br />

team members went to the then nascent Xerox PARC, where they hoped to create a<br />

distributed (across the network)—rather than time-sharing—version <strong>of</strong> NLS. Worse<br />

still, SRI dropped the program, leaving no funding for the project. Engelbart went to<br />

a phone networking company called Tymshare, where he sat in a cubicle in an <strong>of</strong>fice<br />

building in Cupertino, very near to the birthplace <strong>of</strong> the <strong>Mac</strong>intosh.<br />

1.2.4. Smalltalk<br />

The work done at Xerox PARC would greatly influence the face—and surely the<br />

interface—<strong>of</strong> computing. The 1970s saw the development and maturation at<br />

PARC’s Computer Science Laboratory (CSL) <strong>of</strong> technologies such as high-quality<br />

graphical user interfaces, windowing systems, laser printing, and networking.<br />

Smalltalk emerged as both a programming language and a programming environ-<br />

ment at PARC.<br />

While a graduate student at the University <strong>of</strong> Utah in the late 1960s, Alan Kay<br />

had collaborated with Ed Cheadle on designing a personal computer, the FLEX ma-<br />

chine, for those who were not computer pr<strong>of</strong>essionals. The FLEX machine had a<br />

pointing and drawing tablet, a calligraphic display, and a multiwindowed graphical<br />

user interface. Its operating system was object-oriented. The user interacted with the<br />

computer—what Kay called a “personal, reactive, minicomputer”—using text and<br />

pictures. The machine’s primary language was also called FLEX. It was a simple,<br />

interactive, programming language designed to run on a hardware interpreter. Kay’s<br />

work had inspirations from many existing works <strong>of</strong> research, such as GRAIL,


22 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

LINC, 17 LOGO, NLS, Simula, and Sketchpad. Kay described the design and im-<br />

plementation <strong>of</strong> the FLEX machine in his 1969 Ph. D. Thesis titled The Reactive<br />

Engine. Kay’s doctoral work at Utah led to the development <strong>of</strong> Smalltalk, the first<br />

version <strong>of</strong> which was deployed at Xerox PARC in 1972; Kay was one <strong>of</strong> the found-<br />

ing members at PARC.<br />

Besides Kay, Daniel H. H. Ingalls, Adele Goldberg, and others at PARC were<br />

involved in Smalltalk’s development. Smalltalk was both a truly object-oriented<br />

programming language and an operating environment with an integrated user inter-<br />

face. Daniel H. H. Ingalls wrote the first Smalltalk evaluator in October 1972 as a<br />

thousand-line BASIC program. The first “program” to run on this evaluator was the<br />

summation 3 + 4. Shortly afterwards, the Smalltalk-72 system appeared. It was im-<br />

plemented in Nova assembly language. Several versions followed, with perhaps the<br />

best known being Smalltalk-80.<br />

Simula<br />

Simula, which was one <strong>of</strong> the inspirations behind Smalltalk, was the first<br />

language to use object concepts. It originated at the Norwegian Computing<br />

Center, Oslo, in the mid 1960s, as a form <strong>of</strong> Algol 60 extended with classes<br />

and coroutines. It was intended to be suitable for discrete-event simulation,<br />

hence the name.<br />

Later on, Smalltalk would be one <strong>of</strong> the inspirations behind the Objective-C<br />

programming language, which would be the language <strong>of</strong> choice on the NEXTSTEP<br />

platform. Apple would inherit NeXT’s technologies, and Objective-C would be a<br />

key language for Apple as well. Many similarities can be readily seen between<br />

Smalltalk and Objective-C. Every Smalltalk variable refers to an object. Every<br />

17 The LINC (Laboratory INstrument Computer) was a small stored-program computer built by<br />

Wesley Clark and Charles Molnar at MIT’s Lincoln Laboratory in 1962. Digital Equipment Corporation<br />

subsequently manufactured the LINC. It is widely regarded as the first personal computer.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 23<br />

Smalltalk object is an instance <strong>of</strong> a class whose ancestor is a single base class<br />

named Object. Smalltalk uses a message-based model <strong>of</strong> computation. An operation<br />

involves sending a message to an object, which is the only way to interact with an<br />

object. The sender requests the receiver to perform an action named by a selector. A<br />

receiving object responds to a message by looking up in its class for a method with<br />

the same selector. If the method is not found, the object looks up in its superclass,<br />

and so on. The set <strong>of</strong> messages an object responds to constitutes the object’s proto-<br />

col. Figure 1–6 shows an example <strong>of</strong> Smalltalk code (note the similarities to<br />

modern-day Objective-C).<br />

”The Towers <strong>of</strong> Hanoi”<br />

moveDisk: fromTower to: toTower<br />

Transcript cr.<br />

Transcript show: (fromTower: printString, ‘�’, toTower printString).<br />

doHanoi: n from: fromTower using: usingTower to: toTower<br />

(n > 0) ifTrue: [<br />

self doHanoi: (n - 1) from: fromTower using: toTower to: usingTower.<br />

self moveDisk: fromTower to: toTower.<br />

Self doHanoi: (n - 1) from: usingTower using: fromTower to: toTower]<br />

(Object new) doHanoi: 3 from: 1 using: 2 to: 3.<br />

FIGURE 1–6 The Towers <strong>of</strong> Hanoi implemented in Smalltalk<br />

Perhaps the most consequential contribution <strong>of</strong> Smalltalk to personal comput-<br />

ing was the Smalltalk environment’s highly interactive user interface. As was the<br />

case with its predecessor, the FLEX machine, an important early goal <strong>of</strong> Smalltalk<br />

research had been to make computing systems more accessible to those who are not<br />

pr<strong>of</strong>essional computer scientists. The hardware <strong>of</strong> a computer running Smalltalk<br />

consisted <strong>of</strong> a high-resolution bitmapped display screen, a mouse, and a keyboard.<br />

The user interface incorporated concepts such as the following.<br />

• Overlapping and resizable windows that were essential to increasing the<br />

virtual real estate <strong>of</strong> the display screen, providing an illusion <strong>of</strong> multiple,


24 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

overlapping pieces <strong>of</strong> paper on an electronic desktop, with each “paper”<br />

containing an independently running activity<br />

• Iconic and textual menus<br />

• Scroll bars<br />

• The use <strong>of</strong> the mouse as a single, uniform method <strong>of</strong> selecting, cutting,<br />

and pasting various types <strong>of</strong> objects<br />

• The use <strong>of</strong> the mouse to perform operations, or commands, on objects<br />

Smalltalk, along with its integrated environment, facilitated development <strong>of</strong><br />

useful and interesting tools such as a WYSIWYG editor, a music capture and edit-<br />

ing system, and an animation system. In turn, the availability <strong>of</strong> such tools was con-<br />

ducive to writing programs, editing text, drawing, real-time animation, and music<br />

synthesis. Smalltalk was meant to be a powerful language that experienced pro-<br />

grammers could use, yet one that could still be easily grasped by children. Figure 1–<br />

7 shows a rendition <strong>of</strong> the Smalltalk-80 user interface.<br />

Squeak<br />

A modern, portable, open source implementation <strong>of</strong> the Smalltalk environment is<br />

available as Squeak, which was created by Kay, 18 Ingalls, Kaehler, and others in 1995,<br />

while these people were employed at Apple. Squeak is available for <strong>Mac</strong> <strong>OS</strong> X.<br />

Kay did not achieve all his goals with the FLEX machine. In the late 1960s, he<br />

came up with the idea <strong>of</strong> a powerful, easy to use, lap-sized personal computer that<br />

he called the Dynabook. It was so called because Kay envisioned the personal com-<br />

puter to be a dynamic conglomeration <strong>of</strong> all other media: animation, audio, graph-<br />

ics, text, and so on. Key described the Dynabook as a personal computer for “chil-<br />

dren <strong>of</strong> all ages.”<br />

Kay’s work and ideas inspired an effort to create a personal computer at PARC<br />

in 1972: one that would be known as the Alto.<br />

18 Kay would later become an Apple fellow.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 25<br />

System Workspace<br />

Files<br />

(FileStream oldFileNamed: ’changes.st’) fileIn.<br />

(FileStream fileNamed: ’changes.st’) fileOutChanges.<br />

(FileStream fileNamed: ’fileName.st’) edit.<br />

System Transcript<br />

Changes<br />

(FileStream fileNamed: ’changes.st’) fileOutChanges.<br />

Smalltalk noChanges.<br />

Workspace<br />

Workspace<br />

Workspace<br />

Smalltalk at: #BicPen put: Pen new<br />

Project<br />

This is a sample project in<br />

Smalltalk.<br />

FIGURE 1–7 The Smalltalk-80 integrated user interface<br />

System Browser<br />

Interface-Prompt CRFillInTheBlankC ------------ ------------<br />

Interface-Browse FillInTheBlank instance creation example 1<br />

Interface-Inspec FillInTheBlankCon examples<br />

example 2<br />

Interface-Debugg FillInTheBlankVie ------------ example 3<br />

Interface-File M ------------<br />

------------<br />

Interface-Transc instance class<br />

example 2<br />

“Example waits for you to click red button somewhere on the<br />

screen. The view will show where you point. Terminate by choosing<br />

menu command accept or typing carriage return.”<br />

restore display<br />

exit project<br />

project<br />

file list<br />

browser<br />

workspace<br />

system transcript<br />

system workspace<br />

save<br />

quite<br />

FillInTheBlank<br />

request: ’Type a name for recalling a source Form.’<br />

displayAt: Sensor waitButton


26 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Besides the Smalltalk group at PARC, the Pilot/Mesa and the Interlisp<br />

groups shared credit in developing or refining the concepts <strong>of</strong> bit-mapped<br />

graphics, windows, menus, and the mouse.<br />

1.2.5. Xerox Alto<br />

The “personal” in PARC’s personal computing effort referred to a non-shared sys-<br />

tem containing sufficient processing power, storage, and I/O capability to support<br />

the computing needs <strong>of</strong> a single user. The result was the Alto, which was originally<br />

designed by Charles P. Thacker and Edward M. McCreight. Other contributors to<br />

the Alto included Alan Kay, Butler Lampson, and various members <strong>of</strong> PARC’s<br />

Computer Sciences Laboratory and <strong>Systems</strong> Sciences Laboratory. Bob Metcalfe and<br />

David Boggs designed the Ethernet, an important technology used in the Alto.<br />

The first Alto was functional in April 1973. It was named Bilbo. The very first<br />

bitmap picture it displayed was that <strong>of</strong> the Muppets’ Cookie Monster. Small-<br />

talk was soon bootstrapped on this machine. Alan Kay referred to the Alto<br />

as the “Interim Dynabook.”<br />

The Alto’s key hardware characteristics were the following.<br />

• It consisted <strong>of</strong> a 16-bit medium-scale-integrated (MSI 19) microprogrammed<br />

processor. The processor was not single-chip. It emulated a<br />

standard instruction set that was derived from the Data General Nova<br />

computer, thus aiding in portability. The corresponding emulation microcode—the<br />

normal emulator—resided in ROM. The instruction set<br />

could be extended through a small amount <strong>of</strong> microinstruction RAM.<br />

• It had 64KB <strong>of</strong> error correcting code (ECC) 16-bit word semiconductor<br />

memory with a cycle time <strong>of</strong> 850 ns. The memory was expandable to<br />

•<br />

256KB.<br />

It had a bitmapped 606×808 point graphical display with a viewing area<br />

<strong>of</strong> 8.5”×11”. The display was oriented with the long tube dimension ver-<br />

19 MSI refers to the number <strong>of</strong> electronic components on a chip. MSI has evolved to “very large” and<br />

“ultra large” scale integrated systems (VLSI and ULSI, respectively).


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 27<br />

tical. It was implemented using a standard 875-line raster-scanned television<br />

monitor with a refresh rate <strong>of</strong> 60 fields per second (or 30 frames per<br />

second). The on-screen contents were refreshed from a bitmap in main<br />

memory, as bits were serially extracted from words fetched from memory,<br />

resulting in a video signal. There was a 16×16 hardware cursor<br />

whose bitmap was contained in 16 memory words at a specific address.<br />

The cursor was merged, or composited, with the video to present the final<br />

image. Displaying on the entire screen at full resolution (the screenfill<br />

operation) required about 60% <strong>of</strong> the processor cycles.<br />

• The Alto’s input devices included a 61-key or 64-key unencoded keyboard,<br />

a five-finger key set, and a three-button mouse. The key set was<br />

programmatically visible as five bits <strong>of</strong> memory. The mouse contained a<br />

ball, as opposed to the wheels in the SRI mouse. Rather than numbering<br />

the mouse buttons, the Alto convention was to name them red, yellow,<br />

and blue, even though they were visually not <strong>of</strong> these colors.<br />

• The Alto was housed in a small cabinet that contained the processor, one<br />

or more disks, and their power supplies. Other, larger I/O devices could<br />

be contained in their own cabinets that could be located away from the<br />

Alto, which was meant for desktop use. It had interfaces for local connection<br />

to printers and plotters, and a 2.94 Mbps Ethernet interface via<br />

which it could be connected to other Altos and laser printers. Note that<br />

the Alto’s processor controlled the disk, the display, and the Ethernet.<br />

The Alto could be booted from either a local disk, or the network. In the case<br />

<strong>of</strong> a disk boot, the user could specify a disk address from where to fetch the 256-<br />

word disk bootloader, with the default location being disk address 0. The first key-<br />

board word was read to determine the boot type to perform. Pressing the key<br />

implied a network boot; otherwise, the microcode interpreted any reported key-<br />

presses as a disk address. The bootloader loaded a portion <strong>of</strong> Alto main memory<br />

from a boot file, eventually jumping to a known fixed location. The newly loaded<br />

program could then initialize still more <strong>of</strong> the Alto’s state. In the case <strong>of</strong> a network<br />

boot, a special boot packet containing a 256-word Ethernet bootloader would have<br />

to arrive at the Alto for booting to commence. This packet—the BreathOfLife pack-<br />

et—was a raw Ethernet packet that was sent by a boot server periodically on each<br />

directly connected Ethernet. The boot microcode enabled the Ethernet receiver to


28 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

accept packets directed to a special host 377B. The received packets were copied<br />

into memory beginning at location 1. When a packet <strong>of</strong> type 602B was received<br />

without error, the Alto began executing instructions at location 3. The loader would<br />

establish further communication to continue booting.<br />

Figure 1–8 shows a rendition <strong>of</strong> the Alto’s interface.<br />

Start<br />

Pages: 832<br />

Files listed: 72<br />

Files selected: 0<br />

Copy/Rename: 0<br />

Ready:<br />

Select file names with the mouse<br />

Red-Copy, Yel-Copy/Rename, Blue-Delete<br />

Click ‘Start’ to execute file name commands<br />

Quit<br />

Clear<br />

Type<br />

--<br />

Log<br />

Delete: 0<br />

Copy: 0<br />

Pages: 0<br />

Files listed: 0<br />

Files selected: 0<br />

Copy/Rename: 0<br />

Log<br />

Delete: 0<br />

Copy: 0<br />

DP0: *.* No Disk: *>*<br />

~~ BEGINNING ~~<br />

BattleShip.er.<br />

BattleShip.RUN.<br />

BlackJack.RUN.<br />

Bravo.error.<br />

Bravo.messages.<br />

Bravo.run.<br />

Calculator.RUN.<br />

Chess.log.<br />

Chess.RUN.<br />

Com.Cm.<br />

CRTTEST.RUN.<br />

DMT.boot.<br />

empress.run.<br />

Executive.run.<br />

FTP.run.<br />

FTP.log.<br />

Fly.run.<br />

galaxian.boot.<br />

Garbage.$.<br />

Mesa.Typescript<br />

NEPTUNE.RUN.<br />

Rem.cm.<br />

Swatee.<br />

Sys.boot.<br />

SysDir.<br />

Sysfont.al.<br />

User.cm.<br />

FIGURE 1–8 The Xerox Alto system


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 29<br />

The Alto was later reengineered as the Alto II. By 1979, over 1500 Altos were<br />

in use, within and outside <strong>of</strong> Xerox.<br />

As the number <strong>of</strong> Altos increased, many <strong>of</strong> the system aspects were standard-<br />

ized. Several standard facilities were made ROM-resident, including I/O device in-<br />

terfaces such as display, disk, Ethernet, keyboard, and mouse.<br />

1.2.5.1. Alto <strong>OS</strong><br />

The Alto’s operating system, which was stored in the file Sys.boot, was imple-<br />

mented in BCPL. Its functionality included the following.<br />

• Drivers for disk, keyboard, and display<br />

• Management <strong>of</strong> memory, the clock, interrupts, and other events<br />

• The file system<br />

• The BCPL environment<br />

BCPL was developed as a general-purpose recursive programming lan-<br />

guage, with emphasis on systems programming. It has similarities to AL-<br />

GOL. It was used on a variety <strong>of</strong> computer systems such as CTSS (at Pro-<br />

ject MAC), PDP-11, GE635 (GEC<strong>OS</strong>), and Nova.<br />

The Alto ran its instruction set emulator in a task called Emulator, which ran<br />

with the lowest priority. It also was the 0 th task. This task was always requesting<br />

wake-up, but could be interrupted by a wake-up request from any other task. In this<br />

sense, it ran in the background. Other standard tasks included tasks for the follow-<br />

ing subsystems.<br />

• Disk (Disk Sector Task, Disk Word Task)<br />

• Display (Display Word Task, Cursor Task, Display Horizontal Task, Display<br />

Vertical Task)<br />

• Memory (Memory Refresh Task, Parity Task)<br />

• Networking (Ethernet Task)


30 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

A technique called Junta allowed BCPL programs to eliminate layers <strong>of</strong> the<br />

Alto operating system that were not required by a particular subsystem. 20 Another<br />

technique called Counter-Junta could bring back the layers removed through Junta.<br />

Consequently, exceptionally large programs could run on the Alto with a clean re-<br />

turn path to the operating system. To facilitate Junta, the operating system was di-<br />

vided into a series <strong>of</strong> levels. Each level had a known approximate size. Examples <strong>of</strong><br />

levels include levBcpl (BCPL runtime routines), levDisplay (display driver),<br />

and levMain (the main operating system, including code for Junta itself). Figure 1–<br />

9 shows a pseudocode example <strong>of</strong> using Junta.<br />

// All levels below levName will be de-activated, that is,<br />

// levName will be the last level retained. Thereafter,<br />

// ProcedureName() will be called; it should not return.<br />

//<br />

Junta(levName, ProcedureName)<br />

...<br />

// fCode could be fcOK or fcAbort<br />

// This will also perform the CounterJunta()<br />

//<br />

OsFinish(fCode)<br />

FIGURE 1–9 Using Junta<br />

The Alto provided powerful and flexible graphics capabilities. For example, a<br />

set <strong>of</strong> BIT BLT 21 routines was available as a BCPL driver. The BIT BLT algorithm<br />

was also implemented by a complex Alto instruction called BITBLT. Figure 1–10<br />

shows an assembly-language excerpt from the source code <strong>of</strong> these routines (circa<br />

November 1975).<br />

20 The Alto’s processor did not support virtual memory.<br />

21 “BIT BLT” is pronounced as bit-blit. The “BLT” stands for Block Transfer. The term is commonly<br />

used to refer to an algorithm for moving and modifying rectangular bitmaps from one area <strong>of</strong> memory<br />

to another on a bit-mapped device. Typically one <strong>of</strong> the areas resides in main memory and the other<br />

resides in display memory.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 31<br />

...<br />

CLIPC:<br />

...<br />

MOV 3,1 ; SUBR FOR WINDOW CLIPPING<br />

; SAVE RETURN – BBSTABLE COMES IN AC2<br />

STA 1,TEMP1,2<br />

LDA 0,CHAR,2<br />

LDA 1,SPACE<br />

SNE 0,1<br />

JMP SPCIT<br />

ISZ TRLCHR,2 ; INDICATE NON_SPACE CHAR – HELP DEAL<br />

; WITH MULTIPLE SPACES IN JUSTIFICATION<br />

NOP ; SOMETIMES USED AS NIL FLAG – ARGHH!!<br />

FIGURE 1–10 Assembly-language excerpt from the BIT BLT source for the Alto<br />

1.2.5.2. Alto Executive<br />

The program that a user interacted with just after the Alto booted was the Alto Ex-<br />

ecutive (Executive.Run)—a command interpreter akin to the UNIX shell. It ran<br />

atop the Alto <strong>OS</strong>, and could theoretically be replaced by another program. It had<br />

built-in facilities for executing programs and command files, listing on-disk files,<br />

querying file sizes, and so on. Examples <strong>of</strong> Executive subroutines that could be in-<br />

voked from the command line included the following. 22<br />

• BootFrom.~ FileName [...Sys.Boot]<br />

• Chat.~<br />

• Copy.~ DestFileName SourceFileName ...<br />

• Delete.~ FileName ...<br />

• Diagnose.~<br />

• FileStat.~ FileName ...<br />

• Ftp.~<br />

• Login.~<br />

• NetExec.~<br />

22 The “~” character, which was used for identifying Executive commands, was illegal in a filename.


32 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• Quit.~<br />

• Rename.~ OldFileName NewFileName<br />

• Scavenger.~<br />

• SetTime.~<br />

• Type.~ FileName ...<br />

The Executive supported powerful command-line editing and filename expan-<br />

sion. The user could refer to a set <strong>of</strong> files by specifying patterns containing special<br />

characters such as * and #, which the Executive expanded. The Executive displayed<br />

a digital clock and other useful status information, such as the versions <strong>of</strong> the oper-<br />

ating system and the Executive itself, the owner’s name, the disk’s name; the Ether-<br />

net address <strong>of</strong> the Alto, and the number <strong>of</strong> free pages on the disk. When a user<br />

called another program from the Executive, the display was erased and replaced by<br />

that <strong>of</strong> the called program. The operating system invoked the Executive whenever a<br />

program finished running, or specifically, whenever the BCPL operator finish (or<br />

equivalent) was executed. Figure 1–11 shows an example <strong>of</strong> the Executive’s<br />

prompt.<br />

-- XEROX Alto Executive/11 ------------ May 18, 1981 – 786 Pages ----- <strong>OS</strong> Version<br />

18/16 --- Alto 0#377# --- --- -----------------------------------------<br />

>// eventBooted<br />

>|<br />

FIGURE 1–11 The Alto Executive’s prompt<br />

The Alto’s Find subsystem allowed fast pattern-based file searches. Special-<br />

purpose files such as address or telephone lists, program source files, and library<br />

catalogs could be effectively searched through this subsystem.<br />

1.2.5.3. NetExec<br />

There also was a networked version <strong>of</strong> the Executive—the NetExec—that loaded<br />

programs from a boot server available via the Ethernet rather than from the local


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 33<br />

disk. One could query available facilities by typing . Examples <strong>of</strong> utilities typi-<br />

cally available through the NetExec included the following.<br />

• Scavenger was a program that rebuilt the file structure, but not the content,<br />

<strong>of</strong> an Alto disk. It was analogous to the UNIX fsck program. It<br />

checked disk packs while attempting to correct erroneous header blocks,<br />

checksum errors, and other problems. It prompted the user for confirmation<br />

in most cases. It could discover all well-formed files and all free<br />

pages, verify that the serial numbers <strong>of</strong> all well-formed files were distinct,<br />

and link all irrecoverably bad pages together as part <strong>of</strong> the file<br />

Garbage.$. Scavenger was available from the NetExec as an emergency<br />

remedial measure in case the local disk was rendered unbootable.<br />

• Chat was a subsystem that allowed teletype-like interactive access to a<br />

remote computer on the network. It included an extension to support<br />

text-display control and graphics, similar to the latter-day telnet program.<br />

• CopyDisk was a standalone program used to transfer the entire contents<br />

<strong>of</strong> a disk, either between computers, or between the multiple disks <strong>of</strong> a<br />

single computer.<br />

• FTP was a file transfer program.<br />

1.2.5.4. Programming Facilities<br />

Many programming languages were available on the Alto, including BCPL, LISP,<br />

Smalltalk, Mesa, 23 and Poplar. 24<br />

The system’s debugger was called Swat. It saved machine state in a file named<br />

Swatee. You could stop a running program and get back to the Executive by hold-<br />

ing down the left key and hitting the key.<br />

23 Mesa was a Pascal-like strongly-typed system programming language.<br />

24 Poplar was a simple, interactive, text-oriented programming language.


34 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.2.5.5. Applications<br />

The Alto began with several productivity applications and went on to have many<br />

more. Examples <strong>of</strong> sophisticated Alto applications include the following.<br />

• Bravo was a feature-rich, multiwindowed, text-processing application.<br />

• Draw was an interactive illustrator program for creating pictures composed<br />

<strong>of</strong> lines, curves, and text captions. It divided the screen into multiple<br />

areas: brush menu, command menu, font menu, picture area, caption<br />

area, and a message area for displaying information, error, or prompting<br />

messages.<br />

• Laurel 25 was a display-oriented mail messaging system that provided facilities<br />

to display, forward, classify, file, and print mail messages. It<br />

stored messages on the local Alto disk.<br />

• Markup was a document illustration application.<br />

• Neptune was a utility program for managing files and directories.<br />

• Officetalk was an experimental forms-processing system that inspired the<br />

Xerox STAR system.<br />

Alto used file extensions to conventionally indicate file content types. A file<br />

extension was a filename’s trailing portion following a period. It could be<br />

null. Examples <strong>of</strong> such extensions include “.log” (program action history),<br />

“.mail” (Laurel mail file), “.run” (BCPL program executable), “.st” (Smalltalk<br />

source file), and “.syms” (BCPL symbol table file). Alto filenames could be<br />

at most 39 characters in length.<br />

1.2.5.6. Networking<br />

The development <strong>of</strong> inter-network communication facilities at PARC led to a packet<br />

format called PARC Universal Packet, or Pup. Besides the name <strong>of</strong> the abstract de-<br />

sign <strong>of</strong> the packet format, Pup also represented the corresponding inter-network<br />

architecture, which included a hierarchy <strong>of</strong> protocols. The standard Pup format is<br />

shown in Figure 1–12. Pup influenced the creation <strong>of</strong> the TCP/IP protocol suite.<br />

25 A subsequent mail program for an Alto-successor machine was called Hardy.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 35<br />

1 byte 1 byte<br />

Pup Length<br />

Transport Control Pup Type<br />

Pup Identifier<br />

Destination Network Destination Host<br />

Destination Socket<br />

Source Network Source Host<br />

Source Socket<br />

Packet Contents<br />

Possible Garbage Byte<br />

Pup Checksum<br />

FIGURE 1–12 The standard Pup format<br />

Pup Header<br />

(20 bytes)<br />

Contents<br />

(0 - 532 bytes)<br />

Destination Port<br />

Source Port<br />

The Alto made heavy use <strong>of</strong> networking. As we saw earlier, it also included<br />

capabilities for file transfer and remote interactive access. A protocol called Copy-<br />

Disk, which was similar to FTP, allowed creation <strong>of</strong> a disk’s bit-for-bit copy over<br />

the network. In all such protocols, the server listened for connection requests on a<br />

well-known socket. A client initiated a connection to the server using commands<br />

sent over an established connection to operate the server.


36 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.2.5.7. Worms<br />

An interesting investigation involving networked Alto computers was with worm<br />

programs. In 1975, science fiction writer John Brunner had written about such pro-<br />

grams in his book The Shockwave Rider. PARC researchers John F. Shoch and Jon<br />

A. Hupp experimented with worm programs in the early 1980s. The experimental<br />

environment consisted <strong>of</strong> over a hundred Ethernet-connected Altos. A worm was<br />

simply a multimachine computation, with each machine holding a segment <strong>of</strong> the<br />

worm. Segments on various machines could communicate with each other. If a<br />

segment was lost, say, because its machine went down, the remaining segments<br />

would search for an idle Alto on which to load a new copy—self-repairing s<strong>of</strong>tware.<br />

It is important to note that the idea behind the worm experiments was not that <strong>of</strong><br />

mischief. The researchers intended to create useful programs that would utilize oth-<br />

erwise idle machines—essentially a form <strong>of</strong> distributed computing. 26 Nevertheless,<br />

the aberrant potential <strong>of</strong> worms was clearly identified, although worms were still<br />

not perceived as a real security risk. Comparatively, viruses and self-replicating<br />

Trojan horse programs were considered bigger threats to security. Examples <strong>of</strong> ap-<br />

plications that used such worms include the following.<br />

• The Existential worm was a null worm that only contained logic for its<br />

own survival.<br />

• The Billboard worm could distribute graphics images to multiple machines.<br />

• The Alarm Clock worm was a distributed, fault-tolerant, computer-based<br />

alarm clock that could call a user on the telephone at a designated time.<br />

• The Multimachine Animation worm was part <strong>of</strong> a distributed real-time<br />

animation mechanism involving multiple compute nodes and a single<br />

master node.<br />

26 The Alto worms were conceptually similar, in some aspects, to the controller and agent programs in<br />

a modern-day grid-computing environment such as Apple’s Xgrid.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 37<br />

• The Ethernet Diagnostic worm conducted network tests to locate erroneous<br />

Ethernet interfaces. It reported the findings to a control host.<br />

Other useful things that the worms were meant to do included reclaiming file<br />

space, shutting down idle workstations, and delivering mail.<br />

Trek<br />

A popular application for the Alto was the game Trek, which used a number <strong>of</strong><br />

Alto computers on a single Ethernet to facilitate a distributed multiplayer game. The<br />

game’s objective was to destroy the enemy and his base without being destroyed, and<br />

to become the “Master <strong>of</strong> the Universe.” Each Alto user participating in the game could<br />

control one space ship. Trek’s display consisted <strong>of</strong> seven distinct areas: long range<br />

and galaxy scan; short range scan; acceleration and direction controls; energy and<br />

velocity indicators; damage information; fire control and supplies indicators; and the<br />

communication area.<br />

Xerox used the Alto’s technology to create a system designed for <strong>of</strong>fice pro-<br />

fessionals: the STAR System.<br />

1.2.6. Xerox STAR System<br />

Xerox introduced the 8010 27 STAR Information System at a Chicago trade show in<br />

April 1981. The STAR’s hardware 28 was based on the Alto, with better components<br />

such as more memory, bigger disks, a higher resolution display, and faster Ethernet.<br />

An important difference from the Alto was that the STAR user interface was explic-<br />

itly designed before actually building the hardware or s<strong>of</strong>tware. Moreover, rather<br />

27 The Xerox STAR 8010 was also nicknamed the Dandelion.<br />

28 Even though the overall system was marketed as “STAR,” the name STAR should only apply to the<br />

s<strong>of</strong>tware. The computer itself was an 8000 series workstation.


38 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

than using an existing computer, the hardware was specially designed for the s<strong>of</strong>t-<br />

ware. Figure 1–13 shows a mockup <strong>of</strong> the STAR user interface.<br />

Frame<br />

Graphic<br />

Paginate Button<br />

Close Button<br />

Help Button<br />

Text<br />

Display<br />

�<br />

Title<br />

Chart<br />

���� ��� ����� ����� ��<br />

���������� ��� ����� �� ��<br />

���� �� ����� ����� ����<br />

�� ��� ������� ���� ���������<br />

������ ������ ����� ������<br />

��� ����� �� ������� ��<br />

������� ��� ��� ������<br />

Scrollbar<br />

Keyboard<br />

Document<br />

FIGURE 1–13 The Xerox STAR system<br />

�<br />

�<br />

�<br />

Book<br />

Resear<br />

Letter<br />

Form<br />

Hercules<br />

Printer<br />

Memo<br />

Form<br />

Book<br />

Draft<br />

Amit S.<br />

Audience<br />

Feedback<br />

Amit<br />

IN<br />

Directory<br />

Chapter<br />

Drafts<br />

Out<br />

OUT<br />

Mouse<br />

Adjust<br />

Select<br />

Directory<br />

Folder<br />

Out-Basket<br />

In-Basket<br />

The STAR user interface provided the user with an electronic metaphor for the<br />

physical <strong>of</strong>fice. As Figure 1–13 shows, there were electronic analogs <strong>of</strong> common<br />

<strong>of</strong>fice objects: paper, folders, file cabinets, mailboxes, calculators, printers, and so<br />

on. It would be an understatement to say that the STAR interface greatly influenced<br />

many systems that came after it. Noteworthy aspects <strong>of</strong> the STAR user interface<br />

included the following.<br />

• The user’s first view <strong>of</strong> the working environment was the Desktop,<br />

which displayed icons (small pictures) <strong>of</strong> familiar objects such as documents,<br />

folders, file drawers, in-baskets, and out-baskets.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 39<br />

• The user could click on an icon and push the key to open the<br />

icon, which resulted in a window displaying the icon’s contents. Icons<br />

could represent either Data (Document, Folder, or Record File) or Function.<br />

The user could copy, delete, file, mail, move, open, close, and print<br />

data icons. Function icons operated on data icons. Many <strong>of</strong> the function<br />

icons were analogous to modern-day application icons. Examples <strong>of</strong><br />

function icons include File Drawer, In- and Out-Baskets, Printer, Floppy<br />

Disk Drive, User, User Group, Calculator, Terminal Emulator, and Network<br />

Resource Directory.<br />

• Windows had title bars displaying the corresponding icon names and a<br />

context-sensitive command menu. Context-sensitive help was accessible<br />

via the ? button. Horizontal and vertical scroll bars provided page-up,<br />

page-down, and jump-to features. However, STAR windows could only<br />

be tiled 29 and were explicitly designed not to overlap; overlapping behavior<br />

was considered a nuisance (for the end user) in the Alto by STAR’s<br />

designers.<br />

• An abstraction called Property Sheets was analogous to today’s control<br />

or property panels. A related abstraction called Option Sheets implemented<br />

a visual interface for providing options (arguments) to commands.<br />

For example, the “Find” option sheet was a powerful tool for<br />

searching text in a part or whole <strong>of</strong> a document or selection. Even textual<br />

properties such as case, face, font, position, and size could be used for<br />

searching. It also allowed optionally user-confirmed replacement <strong>of</strong> the<br />

found text and its properties.<br />

The STAR system was rather expensive, with a base configuration initially<br />

costing $16,500.<br />

1.3. THE GRAPHICAL AGE AT APPLE<br />

Apple was instrumental in making personal computing affordable for the masses<br />

with the Apple ][. However, even after the Apple ][’s success, computers were diffi-<br />

cult to learn for most people—a fact that was perceived by Apple and many others<br />

as a large impediment to computer use. The Lisa (Local Integrated S<strong>of</strong>tware Archi-<br />

29 Window overlapping was allowed, and in fact was turned on by default, in STAR’s successor View-<br />

Point.


40 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

tecture) project began at Apple in 1979 to create an integrated, stand-alone, single-<br />

user, and easy-to-use microcomputer.<br />

1.3.1. Lisa<br />

Lisa’s goals included the following.<br />

• Be intuitive<br />

• Be consistent<br />

• Provide an integrated environment that was in line with people’s day-today<br />

work<br />

• Provide sufficient performance without being overly complex or exorbitantly<br />

priced<br />

• Provide an open architecture to make it easy for Apple and third parties<br />

to develop additional hardware and s<strong>of</strong>tware<br />

• Be reliable<br />

• Be aesthetically appealing and not out <strong>of</strong> place in a typical work environment<br />

As we noted at the beginning <strong>of</strong> Section 1.2, Lisa was greatly inspired by the<br />

work done at Xerox PARC: especially by the Smalltalk environment, and to a lesser<br />

extent, by the Xerox STAR System. Apple was made privy to many details <strong>of</strong><br />

PARC’s technologies, thanks to a deal in which Xerox received Apple stock in re-<br />

turn for allowing Apple to visit Xerox to observe and understand some <strong>of</strong> Xerox’s<br />

work. The marketing requirements for the Lisa project, which was already under-<br />

way when Apple visited PARC for the first time, included heavy incorporation <strong>of</strong><br />

Smalltalk concepts. Apple also adopted the STAR system’s Desktop metaphor,<br />

along with STAR’s use <strong>of</strong> icons. Apple would refine and augment these concepts<br />

and use them to create a pragmatic and efficient user interface for Lisa.<br />

Apple released Lisa at an annual shareholder meeting on January 19, 1983—a<br />

year before the <strong>Mac</strong>intosh was introduced. Lisa’s price was $9995, making it five


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 41<br />

times more expensive than the originally planned price <strong>of</strong> $2000. 30 Apple pro-<br />

claimed that Lisa would revolutionize the way work was done in <strong>of</strong>fice environ-<br />

ments. Apple also emphasized Lisa’s small learning curve by claiming that a first-<br />

time user could do productive work with Lisa in less than 30 minutes. Apple had<br />

earlier estimated that existing computers required twenty to thirty hours <strong>of</strong> training<br />

and practice before a user could start being productive.<br />

1.3.1.1. Packaging<br />

The first Lisa system consisted <strong>of</strong> the following discrete parts.<br />

• A patented compact desktop unit weighing 48 lbs; it housed the computer<br />

itself, a CRT screen, two floppy disk drives, and the power supply<br />

• A one-button mouse<br />

• A keyboard with a numeric keypad<br />

• An Apple ProFile hard disk drive unit<br />

Various peripherals such as mouse, keyboard, hard disk drives, printers, and<br />

serial devices could be plugged into the main unit. Moreover, it was possible to dis-<br />

assemble the unit without tools.<br />

1.3.1.2. Processor and Memory<br />

Lisa had a 5 MHz Motorola MC68000 processor, which had a 16-bit external data<br />

path with a 32-bit internal architecture. The system had a memory management unit<br />

(MMU), but no floating-point unit (FPU). Lisa initially included 1MB <strong>of</strong> RAM, but<br />

could support up to 2MB. However, the processor was capable <strong>of</strong> handling a 16MB<br />

address space, and supported multiple memory addressing modes. A physical ad-<br />

dress could lie in one <strong>of</strong> following three address spaces:<br />

30 When introduced, the Lisa project had consumed about 200 man-years and 50 million dollars.


42 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• The main memory (RAM), where Lisa programs and data were stored<br />

• The I/O address space, which was used for accessing peripheral controllers,<br />

status registers, and control registers<br />

• The special I/O address space, which was used for accessing the boot<br />

ROM and internal MMU registers<br />

Lisa’s MMU provided four (numbered 0 through 3) logical address space con-<br />

texts for programs to run, <strong>of</strong> which context 0 was reserved for use by the operating<br />

system.<br />

1.3.1.3. Display<br />

Lisa had a 12” CRT display with active dimensions <strong>of</strong> 8.5”×6”. Apple referred to it<br />

as a “half-page” 31 display, given that a Letter-sized sheet <strong>of</strong> paper measures<br />

8.5”×11”. The bitmapped display’s maximum resolution was 720×364. It allowed<br />

for up to 45 lines <strong>of</strong> 144 characters each. The horizontal and vertical pixel densities<br />

were not the same, being 90 and 60 dots per inch, respectively. Therefore, a mathe-<br />

matical square did not appear as a square on Lisa’s screen. Like the Xerox STAR<br />

system, Lisa strived to present a physical <strong>of</strong>fice metaphor. It mimicked the appear-<br />

ance <strong>of</strong> real-life paper by displaying black text on white background. Since a white<br />

screen flickers more than a black screen, Lisa required a higher refresh rate for its<br />

display, thus adding to its price.<br />

1.3.1.4. Storage<br />

Each <strong>of</strong> Lisa’s two built-in floppy disk drives used special high-density double-<br />

sided 5.25” diskettes, with a formatted capacity <strong>of</strong> 851KB. The 5MB Apple ProFile<br />

was a self-contained external hard disk drive unit that connected to Lisa’s built-in<br />

31 You can get a feel for the size <strong>of</strong> Lisa’s display by folding a Letter-sized sheet <strong>of</strong> paper into half.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 43<br />

parallel port. It was possible to connect multiple such disk unit, for a maximum <strong>of</strong><br />

seven units, using optional parallel interface cards.<br />

1.3.1.5. Expansion<br />

Lisa had a built-in parallel port, two built-in serial ports, and three expansion slots<br />

on the motherboard that could be accessed by removing the main unit’s back panel.<br />

It also had a composite video output allowing it to be connected to compatible ex-<br />

ternal monitors.<br />

1.3.1.6. Lisa <strong>OS</strong><br />

Lisa was introduced with a proprietary operating system (the Lisa Office System, or<br />

Lisa <strong>OS</strong>) and a suite <strong>of</strong> <strong>of</strong>fice applications. Several aspects <strong>of</strong> Lisa’s s<strong>of</strong>tware would<br />

become part <strong>of</strong> Apple’s systems to come, and in fact, many such concepts exist in<br />

<strong>Mac</strong> <strong>OS</strong> X in some form.<br />

Lisa was not tied to a particular operating system. Unlike its successor, the<br />

<strong>Mac</strong>intosh, Lisa did not have portions <strong>of</strong> the operating system in ROM. This al-<br />

lowed it to support multiple operating systems. It presented the user with an interac-<br />

tive screen called the Environments Window if multiple bootable environments (for<br />

example, Lisa <strong>OS</strong> and Lisa Workshop) were found on attached storage devices.<br />

At the time <strong>of</strong> Lisa’s release, Apple announced that Micros<strong>of</strong>t had been<br />

working on a version <strong>of</strong> Xenix for Lisa. Eventually, SCO Xenix was available<br />

for Lisa.<br />

Most <strong>of</strong> Lisa’s system and application s<strong>of</strong>tware was written in an extended<br />

version <strong>of</strong> Pascal (Lisa Pascal). During Lisa’s development, Apple even considered<br />

using a p-Chip that would run p-Code natively.<br />

Lisa <strong>OS</strong> was designed to support Lisa’s graphical user interface. Figure 1–14<br />

shows a logical view <strong>of</strong> Lisa’s s<strong>of</strong>tware architecture.


44 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Lisa <strong>OS</strong> was designed to support Lisa’s graphical user interface. Figure 1–14<br />

shows a logical view <strong>of</strong> Lisa’s s<strong>of</strong>tware architecture.<br />

LisaCalc<br />

Filer<br />

LisaDraw<br />

Table Editor<br />

Text Editor<br />

Printing<br />

Support<br />

Database<br />

Routines<br />

Pascal Library (PasLib)<br />

Exception<br />

Handling<br />

LisaGraph<br />

LisaList<br />

File<br />

Management<br />

LisaProject<br />

Hard Disk Drives Floppy Diskettes<br />

Peripheral Devices<br />

API<br />

Window<br />

Manager<br />

QuickDraw<br />

Font Manager<br />

Heap<br />

Manager<br />

FIGURE 1–14 Lisa’s s<strong>of</strong>tware architecture<br />

Process Management<br />

LisaTerminal<br />

Cut & Paste<br />

LisaWrite<br />

Memory<br />

Management<br />

Print Manager<br />

Calculator<br />

Desktop Manager<br />

Process<br />

Management<br />

RAM MMU CPU<br />

Alert Manager<br />

Parameter<br />

Memory (PRAM)<br />

Hardware Interface<br />

Floating-Point<br />

Support<br />

Display<br />

Clock<br />

Applications<br />

Library<br />

Core <strong>OS</strong><br />

Input Device<br />

Interrupts<br />

Hardware<br />

Lisa <strong>OS</strong> implemented non-preemptive multitasking. Although the scheduling algo-<br />

rithm was simple in the absence <strong>of</strong> preemption, it supported process priorities.<br />

A process could only be created by another process, except the initial process,<br />

which was created by the operating system as the “shell” process upon booting. The<br />

shell process ran the Desktop Manager application by default. The system’s process<br />

management API included calls for creating, terminating, suspending, and resuming


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 45<br />

processes. Terminating a process also resulted in the termination <strong>of</strong> all its descen-<br />

dants.<br />

Examples <strong>of</strong> Lisa process-management system calls included the following.<br />

• make_process<br />

• kill_process<br />

• activate_process<br />

• suspend_process<br />

• info_process<br />

• setpriority_process<br />

• yield_process<br />

• sched_class<br />

System-level exceptions resulted in the termination <strong>of</strong> a process—a side effect<br />

<strong>of</strong> the execution <strong>of</strong> default exception handlers. Processes could install custom ex-<br />

ception handlers, which were invoked with detailed exception context. Examples <strong>of</strong><br />

Lisa exception-management system calls included the following.<br />

• enable_excep<br />

• disable_excep<br />

• declare_excep_hdl<br />

• signal_excep<br />

Interprocess Communication<br />

By default, a process was not allowed to access the logical address space <strong>of</strong> another<br />

process. Interprocess communication was possible through multiple mechanisms<br />

such as events, shared files, and shared memory. Events were structured messages<br />

consisting <strong>of</strong> a system-attached header and a sender-provided data block, transmit-<br />

ted between processes over named channels. A process could listen on a channel,<br />

waiting for messages to arrive. Alternatively, a process could register an exception<br />

handler and arrange for an exception to be generated upon message arrival.


46 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

lowing.<br />

Examples <strong>of</strong> Lisa event-channel management system calls included the fol-<br />

• make_event_chn<br />

• kill_event_chn<br />

• open_event_chn<br />

• close_event_chn<br />

• wait_event_chn<br />

• send_event_chn<br />

Memory Management<br />

Lisa <strong>OS</strong> supported segmented virtual memory wherein read-only code segments<br />

could be swapped in as needed. A program had to be accordingly compiled and<br />

linked for this to work. For example, the programmer could divide a program into<br />

independent parts, with the size <strong>of</strong> each part being limited to 128KB. When an in-<br />

struction attempted to access code that was not in physical memory, a bus error oc-<br />

curred. The consequent system trap was handled by the memory manager, which<br />

brought the required segment into physical memory and restarted the instruction.<br />

Examples <strong>of</strong> Lisa memory-management system calls included the following.<br />

• make_dataseg<br />

• kill_dataseg<br />

• open_dataseg<br />

• close_dataseg<br />

• mem_info<br />

• info_address<br />

File System<br />

Lisa <strong>OS</strong> used a hierarchical file system that incorporated both UNIX-like aspects<br />

and some hitherto new concepts. The mount system call performed a similar func-<br />

tion as on UNIX: it was used to introduce a new object into the file system’s name


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 47<br />

space. Besides files and folders, the file system name space also contained disk vol-<br />

umes, printer devices, and serial devices—again, like UNIX. The system performed<br />

I/O to these objects uniformly, regardless <strong>of</strong> the underlying device, although one<br />

could perform device-specific “control” operations on files representing devices.<br />

The file system stored redundant information for each file to reduce the likeli-<br />

hood <strong>of</strong> data loss in a crash. The volume format had a central disk catalog that con-<br />

tained critical information about each file. This information was replicated in a spe-<br />

cial block belonging to the file. Moreover, each used block on disk was tagged, con-<br />

taining information indicating that block’s logical position in the contents <strong>of</strong> the file<br />

that it belonged to. Thus, critical redundant information was distributed throughout<br />

the volume, making it possible to recover or reconstruct information after a system<br />

crash in many cases. The standard file system repair program was called the<br />

scavenger. 32<br />

The Lisa file system supported per-file attributes. System-generated metadata,<br />

such as a file’s size and creation date, were stored as attributes. There were APIs<br />

using which applications could define, create, and access their own attributes, which<br />

were stored in a per-file label—an early form <strong>of</strong> the resource fork in the latter-day<br />

<strong>Mac</strong>intosh Hierarchical File System (HFS). It was also possible for a program to<br />

preallocate contiguous file system space.<br />

Examples <strong>of</strong> Lisa file system calls included the following.<br />

• open<br />

• make_pipe<br />

• read_data<br />

• flush<br />

• lookup<br />

• allocate<br />

• truncate<br />

32 Recall that the Alto’s file system repair program was also called scavenger.


48 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• read_label<br />

• get_working_dir<br />

• device_control<br />

Other sets <strong>of</strong> system calls included those for timers and for manipulating sys-<br />

tem configuration. The system call Pascal interface was implemented in the Lisa<br />

<strong>Operating</strong> System library.<br />

The Graphical User Interface<br />

Perhaps the best-known aspect <strong>of</strong> Lisa is the graphical user interface (GUI) <strong>of</strong> the<br />

Lisa <strong>OS</strong>. The system’s shell—the Desktop Manager—used icons <strong>of</strong> documents and<br />

folders to act as an electronic analog <strong>of</strong> a real desk with a filing system. Some<br />

noteworthy aspects <strong>of</strong> the user interface included the following.<br />

• Multiple, overlapping windows<br />

• Hierarchical pull-down menus<br />

• A menu bar 33 that was always visible at the top <strong>of</strong> the screen and changed<br />

automatically as the active application changed, revealing options that<br />

were relevant to that application<br />

• Dialog boxes for prompts, error messages, and other interactions with the<br />

user<br />

• Horizontal and vertical scroll bars<br />

• Use <strong>of</strong> the mouse for pointing, clicking, double-clicking, dragging, and<br />

selecting – optionally in conjunction with key-presses<br />

• A cursor whose shape changed depending on its current function<br />

• Special or modifier keys on the keyboard (including the “Apple key”),<br />

with support for direct invocation <strong>of</strong> frequently used menu commands<br />

from the keyboard<br />

• Editing commands such as copy, cut, paste, and undo<br />

• A “scrap folder” called the Clipboard—for use by copy-paste and cutpaste<br />

operations<br />

33 Lisa’s menu bar did not have the Apple menu found in latter systems. However, menu commands<br />

did use an Apple symbol. Apple later started using the cloverleaf symbol (the cmd key) for menu<br />

commands.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 49<br />

The Clipboard was implemented as a globally shared data segment accessible<br />

by all processes. Data was stored in the Clipboard in multiple formats, including a<br />

generic format that could be used by a process that did not understand the<br />

application-specific version <strong>of</strong> that data.<br />

There were graphic representations (icons) <strong>of</strong> objects typically found in an<br />

<strong>of</strong>fice environment, such as files, folders, blank stationery, clipboard, and trash can<br />

(or wastebasket). The icons were active in that they could be clicked. They were<br />

used to represent both objects and tasks. Double-clicking on a folder icon would<br />

display the folder’s contents in a window, whereas double-clicking on a document<br />

icon would launch the appropriate application to open the document (each docu-<br />

ment could have an associated application with it). The resultant windows came up<br />

animated. An object could be renamed by pointing at its icon and simply typing the<br />

desired name. New folders and documents were created by “tearing <strong>of</strong>f” items from<br />

pads <strong>of</strong> empty folders and documents, respectively. Items were deleted by dragging<br />

them to a trash can icon. Figure 1–15 shows a screenshot <strong>of</strong> Lisa’s user interface.<br />

Advanced Features<br />

In addition to bringing graphical user interfaces to mainstream computing, Lisa<br />

was among the first to provide s<strong>of</strong>tware controls for hitherto mechanical ones. It had<br />

instant-on capability: pressing the power switch while Lisa was operating sent a reset<br />

signal to the CPU. The handler routine for this signal caused open documents and the<br />

state <strong>of</strong> the desktop to be saved to disk, after which the computer went into a low-<br />

power state. Powering Lisa on would restore the desktop state.<br />

Other s<strong>of</strong>tware controls allowed ejecting a diskette; and adjusting preferences<br />

such as screen brightness, key repeat rate, and the tone generator volume.<br />

Lisa also had a hardware serial number that could be used by its s<strong>of</strong>tware for<br />

multiple purposes, including a rudimentary form <strong>of</strong> digital content protection.


50 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

FIGURE 1–12 Lisa’s graphical user interface<br />

Lisa came with a suite <strong>of</strong> the following GUI-based <strong>of</strong>fice applications.<br />

• LisaCalc—spreadsheet and financial modeling tool with support for up<br />

to a 255×255 worksheet<br />

• LisaDraw—drawing and illustration application<br />

• LisaGraph—application for making bar, line, pie, and scatter graphs<br />

• LisaList—database for creating and maintaining various types <strong>of</strong> lists<br />

• LisaProject—visual project-management and scheduling application<br />

based on Project Evaluation and Review Technique (PERT)<br />

• LisaTerminal—asynchronous communications application that supported<br />

emulation <strong>of</strong> teletype (TTY), VT52, and VT100 terminals<br />

• LisaWrite—WYSIWYG word processor<br />

Lisa applications had consistent user interfaces so that a user was not required<br />

to learn every application from scratch. It was also possible to transfer data between<br />

applications.<br />

Lisa’s competition included the IBM PC XT (introduced on March 8, 1983),


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 51<br />

the DEC family <strong>of</strong> personal computers (the Rainbow 100, the DECmate II,<br />

and the PC300 line), the Corvus Concept Network Workstation (which also<br />

used the M68000 processor), the Fortune 32:16 Hard Disk System, the<br />

Xerox STAR System, and the Xerox 820-II Personal Computer.<br />

Multiple programming languages were available 34 for Lisa, such as Pascal,<br />

BASIC-Plus, C, and COBOL. Lisa’s s<strong>of</strong>tware library, many <strong>of</strong> whose components<br />

are shown in Figure 1–14, provided a variety <strong>of</strong> primitives for building complex<br />

applications. Pascal language units in the s<strong>of</strong>tware library included the Alert Man-<br />

ager, the Font Manager, the Print Manager, QuickDraw, and the Window Manager.<br />

QuickDraw was a high-performance bitmap graphics technology that used<br />

regions, both for clipping and for implementing shapes with efficient use <strong>of</strong><br />

memory. A region was an arbitrary area that could include multiple groups<br />

<strong>of</strong> disjoint areas.<br />

1.3.1.7. Lisa WorkShop<br />

Lisa WorkShop was Lisa’s development environment. Strongly influenced by<br />

UCSD Pascal, it was primarily meant for Pascal-based development, although it<br />

supported other languages such as BASIC-Plus, C, and COBOL-74. It provided a<br />

multitude <strong>of</strong> tools for s<strong>of</strong>tware development: a Pascal compiler, a 68K assembler, a<br />

linker, a low-level debugger, a file comparison utility, a mouse-based graphical text-<br />

editor, and so on. It also provided a command-line shell, along with subsystems for<br />

accessing files on storage devices (the File Manager) and for accessing low-level<br />

features <strong>of</strong> Lisa (the System Manager). The WorkShop could even copy-protect<br />

s<strong>of</strong>tware, after which copies <strong>of</strong> such protected s<strong>of</strong>tware would only run on one ma-<br />

chine (the first machine on which the copy was made).<br />

34 The Pascal, Basic-Plus, and COBOL products could be purchased from Apple at the time <strong>of</strong> Lisa’s<br />

introduction at the suggested retail price <strong>of</strong> $595, $295, and $995, respectively.


52 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

ware.<br />

The WorkShop was extensively used for the development <strong>of</strong> <strong>Mac</strong>intosh s<strong>of</strong>t-<br />

1.3.1.8. Lisa’s Fate<br />

Despite Lisa’s technical sophistication and Apple’s advertising, 35 Lisa was a com-<br />

mercial failure, partly owing to its high cost. The addition <strong>of</strong> more memory and a<br />

disk drive pushed Lisa’s price well above $10,000. The <strong>Mac</strong>intosh, which was un-<br />

der development, was perceived by many as a far more affordable mini-Lisa. In<br />

1984, Apple released a second version <strong>of</strong> the computer, Lisa 2, at half the price <strong>of</strong><br />

the original. The Lisa 2/5 variant came with a 5MB external ProFile disk drive,<br />

whereas the Lisa 2/10 variant came with an internal 10MB “Widget” drive. A year<br />

after the <strong>Mac</strong>intosh was introduced, Lisa 2 was re-branded as the <strong>Mac</strong>intosh XL. It<br />

ran the <strong>Mac</strong>intosh operating system courtesy <strong>of</strong> the <strong>Mac</strong>Works XL s<strong>of</strong>tware, which<br />

implemented <strong>Mac</strong>intosh ROM emulation.<br />

Lisa was discontinued in 1985. In September 1989, Apple buried about 2700<br />

Lisa computers in the Logan landfill in Utah. The value <strong>of</strong> the computers had de-<br />

preciated so much that the tax break received from scrapping the computers resulted<br />

in more money for Apple than could be obtained by selling them.<br />

Although Lisa failed to become the perfect computer it was designed to be, it<br />

introduced several aspects that would become part <strong>of</strong> Apple’s systems to come. In<br />

this sense, Lisa was a technological success.<br />

35 Hollywood actor Kevin Costner appeared as a businessman in a 1983 Lisa advertisement.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 53<br />

1.3.2. The <strong>Mac</strong>intosh<br />

At the turn <strong>of</strong> the 1980s, there was a project called Annie inside Apple. Apple em-<br />

ployee Jef Raskin 36 was not happy with names such as “Lisa” and “Annie,” which<br />

represented a sexist approach according to him. He changed the project’s name to<br />

<strong>Mac</strong>intosh, a deliberate misspelling <strong>of</strong> “McIntosh,” which is a variety <strong>of</strong> Apples.<br />

McIntosh was also part <strong>of</strong> the name <strong>of</strong> a stereo manufacturer called McIn-<br />

tosh Labs. The name was brought under contention when Apple tried to<br />

trademark it, but Apple eventually managed to buy the trademark. During<br />

the legal battle, Apple considered acronyms such as MAC, for Mouse Acti-<br />

vated Computer. There were alleged jokes within Apple that “MAC” actually<br />

was an acronym for Meaningless Acronym Computer. For a short while,<br />

there were even efforts to change the project’s name to Bicycle, which al-<br />

luded to a quote from Steve Jobs about personal computers being “bicycles<br />

for the mind.”<br />

Jef Raskin had written The Book <strong>of</strong> <strong>Mac</strong>intosh, an Apple-internal document on<br />

personal computing that described a cheap, user-friendly computer designed for the<br />

Person In The Street (PITS). Some <strong>of</strong> the desirable features <strong>of</strong> the computer were<br />

the following.<br />

• The computer “system” must not consist <strong>of</strong> myriad external components.<br />

It must be all in one, with components such as the display, the keyboard,<br />

disks, and others all integrated into one package. Moreover, the package<br />

must be portable, with a handle, and must not weigh more than 20 lbs.<br />

• The computer’s internals should not be visible.<br />

• The PITS should never be required to open the computer, nor even see its<br />

interior. The only reason to open the computer should be for repair.<br />

• The PITS should not be required to deal with components in sockets,<br />

whether inside or outside <strong>of</strong> the computer. Any additional boards, RAMs,<br />

ROMs, or other accessories should be allowed only if they exist as<br />

standalone appliances that can be trivially connected to the computer.<br />

36 Jef Raskin was Apple employee number 31.


54 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• There should be no external cables besides a power cord. In the ideal<br />

world, there would not even be a power cord!<br />

• If there are multiple models <strong>of</strong> a computer system, the models should not<br />

have differences that require documentation in a user’s manual.<br />

• There should not be too many keys on the keyboard.<br />

• There should be as few manuals as possible, and even those should be<br />

small. The manuals should not use computer jargon.<br />

• The end-user should be able to purchase the computer for no more than<br />

$500.<br />

Besides documenting his vision for an affordable, appliance-like computer, Jef<br />

Raskin also put together a capable initial team in late 1979 to pursue his <strong>Mac</strong>intosh<br />

project. However, Raskin left the project—and some time later, the company—be-<br />

fore <strong>Mac</strong>intosh could become substantial. Steve Jobs, who took over, would be the<br />

driving force behind the <strong>Mac</strong>intosh product.<br />

Steve Jobs unveiled the <strong>Mac</strong>intosh on January 24, 1984, at the Flint Center in<br />

De Anza College, Cupertino. The occasion was Apple’s annual shareholders meet-<br />

ing. Jobs opened the meeting by reciting lines from Bob Dylan’s song The Times<br />

They Are A-Changin’.<br />

Come writers and critics<br />

Who prophesize with your pen<br />

And keep your eyes wide<br />

The chance won’t come again<br />

And don’t speak too soon<br />

For the wheel’s still in spin<br />

And there’s no tellin’ who<br />

That it’s namin’.<br />

For the loser now<br />

Will be later to win<br />

For the times they are a-changin’.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 55<br />

Besides being a vehicle <strong>of</strong> Lisa’s technology <strong>of</strong> windows, icons, pull-down<br />

menus, mouse commands, and s<strong>of</strong>tware integration, the <strong>Mac</strong>intosh was a compel-<br />

ling execution <strong>of</strong> marketing wizardry. Apple hailed it as “the computer for the rest<br />

<strong>of</strong> us.” After demonstrating the <strong>Mac</strong>intosh’s capabilities, Jobs said “We’ve done a<br />

lot <strong>of</strong> talking about <strong>Mac</strong>intosh recently, but today, for the first time ever, I’d like the<br />

<strong>Mac</strong>intosh to speak for itself.” A program running on the <strong>Mac</strong>intosh “spoke” an<br />

introductory message:<br />

“Hello, I am <strong>Mac</strong>intosh. It sure is great to get out <strong>of</strong> that bag. Unaccustomed<br />

as I am to public speaking, I’d like to share with you a maxim I thought <strong>of</strong> the first<br />

time I met with an IBM mainframe: NEVER TRUST A COMPUTER YOU CAN’T<br />

LIFT! Obviously, I can talk, but right now I’d like to sit back and listen. So, it is<br />

with considerable pride that I introduce a man who’s been like a father to me…<br />

STEVE JOBS.”<br />

An early <strong>Mac</strong>intosh sales brochure had the following blurb: “For the first<br />

time in recorded computer history, hardware engineers actually talked to<br />

s<strong>of</strong>tware engineers in moderate tones <strong>of</strong> voice, and both were united by a<br />

common goal: to build the most powerful, most transportable, most flexible,<br />

most versatile computer not-very-much-money could buy. And when the<br />

engineers were finally finished, they introduced us to a personal computer<br />

so personable it can practically shake hands. And so easy to use most<br />

people already know how. They didn’t call it the QZ190, or the Zipchip<br />

5000. They called it <strong>Mac</strong>intosh.”<br />

Later known as the <strong>Mac</strong> 128K due to the 128KB <strong>of</strong> built-in RAM, the <strong>Mac</strong>in-<br />

tosh debuted at a price <strong>of</strong> $2,495. It had the following key specifications.<br />

• 7.83 MHz Motorola MC68000 processor<br />

• No memory management unit (MMU), no floating-point unit (FPU), and<br />

no L1 or L2 caches<br />

• 32-bit internal data bus<br />

• 64KB ROM


56 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• 128KB RAM<br />

• 20 bytes <strong>of</strong> parameter memory (PRAM) on a CM<strong>OS</strong> custom chip with<br />

4.5 V user-replaceable backup battery<br />

• Internal single-sided 3.5” floppy disk drive that accepted 400KB hard<br />

shell floppy disks<br />

• An external drive port with a DB-19 connector that allowed attachment<br />

<strong>of</strong> a second drive<br />

• Mouse port (DE-9 connector), and a mechanical tracking mouse with<br />

optical shaft encoding at 3.54 pulses per mm (90 pulses per inch) <strong>of</strong><br />

travel<br />

• Synchronous serial keyboard bus with an RJ-11 connector, and a<br />

s<strong>of</strong>tware-mapped 58-key keyboard<br />

• Two RS-232/RS-422 serial ports (DE-9 connectors) for connecting modems,<br />

printers, and other peripherals<br />

• Four-voice sound generator with 8-bit digital/analog conversion and 22<br />

kHz sampling rate<br />

• 512×342-pixel bit-mapped black and white display on a 9-inch diagonal<br />

CRT screen<br />

• Physical dimensions <strong>of</strong> 13.6”×9.6”×10.9”, with a weight <strong>of</strong> 16 lb 8 oz<br />

(7.5 kg), and a logic board area <strong>of</strong> 80 square inches<br />

• No internal fan<br />

The <strong>Mac</strong>intosh ran a single-user, single-tasking operating system, initially<br />

known as <strong>Mac</strong> System S<strong>of</strong>tware, which resided on a single 400KB floppy disk.<br />

Many <strong>Mac</strong>intosh programs were either conversions <strong>of</strong>, or influenced by, Lisa pro-<br />

grams. Examples include <strong>Mac</strong>Paint, <strong>Mac</strong>Project, and <strong>Mac</strong>Write.<br />

Unlike Lisa, the <strong>Mac</strong>intosh was not designed to run multiple operating sys-<br />

tems. The <strong>Mac</strong>intosh ROM contained both low-level and high-level code. The low-<br />

level code was for hardware initialization, diagnostics, drivers, and so on. The<br />

higher-level Toolbox was a collection <strong>of</strong> s<strong>of</strong>tware routines meant for use by applica-<br />

tions, quite like a shared library. Toolbox functionality included the following.<br />

• Management <strong>of</strong> dialog boxes, fonts, icons, pull-down menus, scroll bars,<br />

and windows<br />

• Event handling


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 57<br />

• Text entry and editing<br />

• Arithmetic and logical operations<br />

The Lisa-derived QuickDraw portion <strong>of</strong> the Toolbox contained highly opti-<br />

mized primitives for drawing shapes and user-interface elements. The use <strong>of</strong> com-<br />

mon system-provided user-interface routines ensured a consistent and standard user<br />

interface. With time, the Toolbox would have an incredible amount <strong>of</strong> functionality<br />

(and associated APIs) packed into it, obstructing Apple’s attempts to create a mod-<br />

ern operating system while maintaining backwards compatibility. Figure 1–16<br />

shows a screenshot <strong>of</strong> the first <strong>Mac</strong>intosh operating system.<br />

FIGURE 1–16 <strong>Mac</strong>intosh System 1: the first <strong>Mac</strong>intosh operating system<br />

The Finder was the default application that ran as the system came up. It was<br />

an interface for browsing the file system and launching applications. Owing to the


58 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

single-tasking operating system, the user had to quit any running application to<br />

work in the Finder.<br />

The <strong>Mac</strong>intosh File System (MFS) was a flat file system: all files were stored<br />

in a single directory. However, the system s<strong>of</strong>tware presented a hierarchical view<br />

that showed nested folders. Each disk contained a folder called Empty Folder at its<br />

root level. Renaming this folder created a new folder, with a replacement Empty<br />

Folder appearing as a side effect.<br />

There was a menu-bar at the top, like in the case <strong>of</strong> Lisa, but with an Apple<br />

menu. There was also an iconic trash can that was automatically emptied every time<br />

the system booted. The <strong>Mac</strong>intosh also heralded Apple’s Human Interface Guide-<br />

lines, which partially evolved from Lisa’s user-interface standards.<br />

An Icon Named Trash<br />

The <strong>Mac</strong>intosh trash can is sometimes criticized for being poorly designed, as it<br />

is not only meant to destroy files, but also for ejecting disks so that they can be safely<br />

put away. Apple’s interface designers once explained the rationale behind this design.<br />

Since the original <strong>Mac</strong>intosh only had a single floppy disk drive, and no hard<br />

disk, it was expected that users would typically use several diskettes while working on<br />

the <strong>Mac</strong>intosh. A convenience feature <strong>of</strong> the system was that it cached—in memo-<br />

ry—the list <strong>of</strong> files on a diskette. The cache was retained even after the diskette had<br />

been ejected. A grayed-out Desktop icon for that diskette indicated this fact. Clicking<br />

on such an icon prompted the user to insert the appropriate diskette in the drive. Drag-<br />

ging a grayed-out icon to the trash freed up the memory used by that diskette’s cache.<br />

Thus, even if a user intended to permanently eject a diskette, two actions were<br />

required: the eject command, and dragging an icon to the trash. The redundancy was<br />

removed by combining these actions to a single action: dragging an “active” (non-<br />

grayed-out) icon to the trash caused the diskette to be ejected and its cache to be de-<br />

leted.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 59<br />

At its introduction, the <strong>Mac</strong>intosh was targeted for two primary markets:<br />

knowledge-workers and students. Referring to the telephone as the first “desktop<br />

appliance,” Steve Jobs hoped that the <strong>Mac</strong>intosh would become the second desktop<br />

appliance. Bill Gates <strong>of</strong> Micros<strong>of</strong>t stated, “To create a new standard takes some-<br />

thing that’s not just a little bit different. It takes something that’s really new, and<br />

captures people’s imaginations. <strong>Mac</strong>intosh meets that standard.”<br />

In 1984, Apple also introduced AppleTalk, a self-configuring, multilayered<br />

local area network (LAN) protocol whose features include dynamic addressing,<br />

router discovery, and name binding.<br />

1.4. MANY SYSTEMS FOR MANY APPLES<br />

After the <strong>Mac</strong>intosh’s release, Apple spent the next few years improving the <strong>Mac</strong>in-<br />

tosh operating system and creating some other noteworthy systems.<br />

1.4.1. System S<strong>of</strong>tware Releases 2 - 6<br />

For a long time, there were multiple, independent versioning schemes in effect for<br />

<strong>Mac</strong>intosh system components: a System S<strong>of</strong>tware Release, a System Version, a<br />

Finder Version, a MultiFinder Version, a LaserWriter Version, and so on. Eventually<br />

there were attempts to unify these versions.<br />

Notable improvements made during this time included the following.<br />

• Continued speed improvements for the Finder, including a disk cache<br />

and an additional minifinder to make applications launch faster<br />

• Commands for common tasks such as shutting down, creating new folders,<br />

and ejecting disks<br />

• A hierarchical file system (HFS) that supported true hierarchy, allowing<br />

folders to be nested without illusory aid<br />

• Support for multiple monitors


60 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• Support for larger disk drives<br />

• AppleShare client features<br />

Figure 1–17 shows a screenshot <strong>of</strong> System 6.<br />

FIGURE 1–17 <strong>Mac</strong>intosh System 6<br />

An important improvement came when Apple incorporated cooperative multi-<br />

tasking through the MultiFinder. Initially included as a separate piece <strong>of</strong> s<strong>of</strong>tware<br />

along with the original Finder, MultiFinder soon became mandatory. It allowed the<br />

user to have several programs open simultaneously and to assign specific amounts<br />

<strong>of</strong> RAM to these programs. Usability improvements included providing a progress<br />

bar with cancel button for “copy file” and “erase disk” operations. Until this point,<br />

the Finder did not use color even on color capable systems. This was remedied with<br />

the introduction <strong>of</strong> Color QuickDraw.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 61<br />

1.4.2. What Color is Your System?<br />

In March 1988, after the <strong>Mac</strong>intosh had been around for four years, some Apple<br />

engineers and managers had an <strong>of</strong>f-site meeting. As they brainstormed to come up<br />

with future operating system strategies, they noted down their ideas on three sets <strong>of</strong><br />

index cards that were colored blue, pink, and red.<br />

Blue would be the project for improving the existing <strong>Mac</strong>intosh operating sys-<br />

tem. It would eventually form the core <strong>of</strong> System 7.<br />

Pink would soon become a revolutionary operating system project at Apple.<br />

The operating system was planned to be object-oriented. It would have full memory<br />

protection, multitasking with lightweight threads, a large number <strong>of</strong> protected ad-<br />

dress spaces, and several other modern features. After languishing for many years at<br />

Apple, Pink would move out to Taligent, a company jointly run by Apple and IBM.<br />

We will briefly discuss Taligent in Section 1.6.4.<br />

Since the color red is “pinker than pink,” ideas considered too advanced even<br />

for Pink were made part <strong>of</strong> the Red project.<br />

As the 1980s were drawing to an end, the system s<strong>of</strong>tware was at major ver-<br />

sion 6. System 7, a result <strong>of</strong> the Blue project, would be Apple’s most significant<br />

system yet, both relatively and absolutely. However, that would not be until 1991.<br />

Apple would come out with two interesting operating systems before that: GS/<strong>OS</strong><br />

and A/UX.<br />

Gestalt<br />

In 1989, Apple introduced a system call named “Gestalt” in version 6.0.4 <strong>of</strong> the<br />

operating system. Gestalt allowed applications to dynamically query the capabilities<br />

that were present in a running system configuration. It would go on to become a widely<br />

used system call, and continues to exist in <strong>Mac</strong> <strong>OS</strong> X as a Carbon function.


62 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

“Gestalt” is originally a German word that means wholeness, shape, or form. In<br />

one <strong>of</strong> its connotations, it is used to denote a structure or configuration integrated to<br />

form a functional unit in such a way that the properties <strong>of</strong> the whole are not derivable<br />

by summation <strong>of</strong> its parts.<br />

1.4.3. GS/<strong>OS</strong><br />

As noted earlier, the Apple ][ had a rather long life span. After the release <strong>of</strong> the<br />

<strong>Mac</strong>intosh in 1984, the Apple ][ still existed as a product. The Apple ][GS was intro-<br />

duced in 1986, almost as a bridge between the old and the new. It was the first and<br />

only 16-bit Apple ][, and had impressive multimedia abilities (the “GS” stood for<br />

graphics and sound). Its notable features included the following.<br />

• A 6502-compatible 37 65C816 processor. The firmware-resident monitor<br />

allowed assembling and disassembling instructions for both processors.<br />

• Support for 24-bit addressing, which allowed memory expansion up to 8<br />

MB. The monitor could handle both 16-bit and 24-bit addresses.<br />

• Two very high-resolution graphics modes: 320×200 with a 16-color palette<br />

and 640×200 with a 4-color palette.<br />

• RGB and NTSC video outputs.<br />

• A 32-voice Ensoniq Digital Oscillator chip that could be driven by firmware<br />

to produce up to 15 musical instruments.<br />

• A mouse-driven, color desktop interface with windows and menus. A<br />

built-in control panel desk accessory allowed the user to set machine parameters<br />

for display, disk drives, processor speed, serial ports, and so on.<br />

• Two standard serial ports that could be used with AppleTalk.<br />

The Apple ][GS had several other additions or improvements over previous<br />

Apple ][ machines.<br />

Apple ProD<strong>OS</strong> was forked into 8- and 16-bit versions to accommodate the<br />

Apple ][GS. After using ProD<strong>OS</strong> 16 as the computer’s operating system for a short<br />

37 The user could select either the 1 MHz processor clock speed <strong>of</strong> the 6502, or a faster 2.8 MHz.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 63<br />

time, Apple replaced it with GS/<strong>OS</strong>: a new 16-bit native-mode system that signifi-<br />

cantly improved performance on many fronts such as boot time, disk access time,<br />

and program launch time. Figure 1–18 shows a screenshot <strong>of</strong> GS/<strong>OS</strong>.<br />

FIGURE 1–18 GS/<strong>OS</strong><br />

GS/<strong>OS</strong> had several modern features. It had the concept <strong>of</strong> file system transla-<br />

tors (FSTs)—a generic file interface that allowed different file systems to be read<br />

from and written to. The concept was along similar lines as AT&T’s file system<br />

switch, Sun Microsystems’ vnode/vfs, and DEC’s gnode that were being introduced<br />

in the mid-1980s to allow multiple file systems to coexist. GS/<strong>OS</strong> eventually went<br />

on to have FSTs for various file systems: <strong>Mac</strong>intosh HFS, ISO/High Sierra, Apple-<br />

Share, and native file systems <strong>of</strong> Apple D<strong>OS</strong> 3.3, Apple Pascal, MS-D<strong>OS</strong>, and Pro-<br />

D<strong>OS</strong>. Since the AppleShare FST allowed GS/<strong>OS</strong> to access an AppleShare file<br />

server using AppleTalk networking, the GS/<strong>OS</strong> Finder could browse over the net-<br />

work. GS/<strong>OS</strong> could even be network booted.


64 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

The graphical control panel in GS/<strong>OS</strong> was a facility for controlling various<br />

system settings. Third-party developers could add their own control panel devices<br />

(CDEVs), thus extending the set <strong>of</strong> entities that the control panel could access.<br />

The last version <strong>of</strong> GS/<strong>OS</strong>—4.02—shipped with Apple ][GS System 6.0.1.<br />

1.4.4. A/UX<br />

A/UX was Apple’s own version <strong>of</strong> P<strong>OS</strong>IX compliant UNIX. It was released in late<br />

1988. It only ran on 68K-based Apple machines 38 with both a floating-point unit<br />

(FPU) and a paged memory-management unit (PMMU). The earliest A/UX was<br />

based on 4.2BSD and AT&T UNIX System V Release 2, but it would later derive<br />

from 4.3BSD and various subsequent System V releases. A/UX features included<br />

the following.<br />

• 4.3BSD extensions such as groups, signals, and job control<br />

• System V IPC (semaphores, messages) and System V-style signals<br />

• Networking (AppleTalk, STREAMS, TCP/IP over Ethernet as well as<br />

over a serial connection, sockets, domains, subnets, NFS with Yellow<br />

Pages, and so on)<br />

• The Berkeley Fast File System (ffs)<br />

• Multiple Unix command interpreters such as the Bourne, Korn, and C<br />

shells<br />

• A comprehensive set <strong>of</strong> development tools such as lint, lex, yacc, debuggers<br />

(adb, sdb, <strong>Mac</strong>sBug), various editors, assembler, linker, C compiler<br />

(cc), FORTRAN compiler (f77), make, and SCCS<br />

• The X Window System<br />

• AppleTalk printing and file sharing client services via LocalTalk or EtherTalk<br />

38 For example, A/UX ran on a <strong>Mac</strong>intosh SE/30.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 65<br />

Besides P<strong>OS</strong>IX compatibility, A/UX supported the BSD and System V APIs.<br />

In particular, A/UX was compliant with the System V Interface Definition (SVID),<br />

and passed the System V Verification Suite (SVVS).<br />

Figure 1–19 shows a screenshot <strong>of</strong> A/UX.<br />

FIGURE 1–19 The A/UX operating system<br />

More interestingly, A/UX combined various features <strong>of</strong> the <strong>Mac</strong>intosh operat-<br />

ing system with Unix. A/UX 2.x used <strong>Mac</strong>intosh System 6, whereas A/UX 3.x<br />

combined a Unix environment with System 7. The default user environment con-<br />

sisted <strong>of</strong> the <strong>Mac</strong>intosh Finder, which was essentially a graphical shell hosted by A/<br />

UX. The A/UX file system appeared as a disk drive icon in the Finder. Files could<br />

be accessed and manipulated through their icons. It was possible to run <strong>Mac</strong>intosh


66 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

applications, Unix command-line or X Window applications, and even MS-D<strong>OS</strong><br />

applications 39 side-by-side. The <strong>Mac</strong>X display server allowed X Window System<br />

client applications to be displayed on the A/UX Desktop.<br />

The <strong>OS</strong>F/Motif toolkit for the X Window system was available as a third-party<br />

addition. A/UX supported hybrid applications that made use <strong>of</strong> both the Unix sys-<br />

tem call interface and the <strong>Mac</strong>intosh Toolbox. All types <strong>of</strong> applications could be<br />

launched from within the Finder.<br />

Whereas Unix processes ran with preemptive multitasking under A/UX, the<br />

<strong>Mac</strong>intosh Finder (the MultiFinder specifically) still supported only cooperative<br />

multitasking. When 32-bit addressing was in effect, the startmac application was<br />

responsible for creating the <strong>Mac</strong>intosh environment under A/UX. The startmac24<br />

variant was used with 24-bit addressing. Many aspects <strong>of</strong> this environment were<br />

customizable, including which application to run as the Finder. <strong>Mac</strong>intosh-style<br />

menu-driven login, logout, system startup, and shutdown procedures were sup-<br />

ported. A conceptual diagram <strong>of</strong> the A/UX architecture is shown in Figure 1–20.<br />

Many proponents <strong>of</strong> A/UX regarded it as the holy grail <strong>of</strong> Unix systems.<br />

Given compatible hardware, the A/UX installation procedure was incredibly simple<br />

for a Unix system, being essentially one-click.<br />

From trivialities such as similar commands (such as appleping) to the more<br />

elaborate marriage <strong>of</strong> the Unix and <strong>Mac</strong>intosh environments, vestiges <strong>of</strong> insights<br />

gained through A/UX can be seen in <strong>Mac</strong> <strong>OS</strong> X. Examples include the following.<br />

• A/UX used /.mac//Desktop Folder/ and /.mac//<br />

Trash/ as the Unix pathnames for directories containing items visible<br />

on the <strong>Mac</strong>intosh Desktop and in the trash can, respectively.<br />

• Unix uses the ‘/’ character to separate path components, whereas <strong>Mac</strong>intosh<br />

file systems use ‘:’. Invisible translation was done while accessing<br />

or moving files from one environment to the other.<br />

• Home directories for user accounts were located in /users/.<br />

39 Running MS-D<strong>OS</strong> applications required the S<strong>of</strong>tPC product.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 67<br />

<strong>Mac</strong>intosh Desktop<br />

Unix Command-line<br />

Application<br />

A/UX Toolbox<br />

Kernel<br />

Unix<br />

MSD<strong>OS</strong><br />

Application<br />

<strong>Mac</strong>intosh ROM Calls<br />

Toolbox Calls<br />

Translation<br />

Multitasking<br />

and Process<br />

Scheduling<br />

FIGURE 1–20 A/UX architecture<br />

Unix X Window<br />

System Application<br />

Virtual Memory<br />

Management<br />

A/UX<br />

Finder<br />

<strong>Mac</strong>intosh <strong>OS</strong> Calls<br />

Memory Manager<br />

Time Manager<br />

Slot Manager<br />

Interprocess<br />

Communication<br />

Drivers<br />

Hardware<br />

A/UX Library Calls<br />

Redirection <strong>Mac</strong>intosh <strong>OS</strong><br />

(reimplemented)<br />

Unix X Window<br />

System Motif-based<br />

Application<br />

A/UX<br />

Libraries<br />

<strong>Mac</strong>intosh<br />

Application<br />

SerialManager<br />

Sound Manager<br />

File Manager<br />

Device I/O<br />

and Driver<br />

Interfacing<br />

ROM-resident <strong>Mac</strong>intosh User Interface Routines<br />

The last version <strong>of</strong> A/UX—3.1.1—was released in 1995.<br />

Unix System Calls<br />

C Library


68 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.5. SEEKING POWER<br />

As the 1990s began, Apple was making great efforts to overhaul its operating sys-<br />

tem. Of the three “colorful” projects mentioned earlier, Blue, would emerge as Sys-<br />

tem 7.<br />

1.5.1. System 7<br />

When released in 1991, System 7 represented a gigantic leap forward in comparison<br />

to earlier <strong>Mac</strong>intosh systems. Some <strong>of</strong> its key features included a built-in Multi-<br />

Finder, built-in networking (AppleTalk Phase 2 40), built-in file sharing (Apple-<br />

Share), support for 32-bit memory addressing, a virtual memory implementation,<br />

and a multitude <strong>of</strong> new technologies 41 such as the following.<br />

• AppleScript—a system-level macro language for automating tasks<br />

• ColorSync—a color management system<br />

• PowerTalk—a collaboration and email s<strong>of</strong>tware<br />

• QuickTime—a cross-platform multimedia s<strong>of</strong>tware for viewing and manipulating<br />

video, animations, images, and audio<br />

• TrueType—a font technology<br />

• WorldScript—a multilingual text-rendering engine and programming<br />

interface<br />

The first <strong>Mac</strong>intosh with an MMU was introduced in 1987: the <strong>Mac</strong>intosh II.<br />

Whereas A/UX required an MMU, it was not until System 7 that a <strong>Mac</strong>intosh<br />

operating system would use the MMU. However, the virtual memory sup-<br />

port was only preliminary—features such as protected address spaces,<br />

memory-mapped files, page locking, and shared memory, were not present.<br />

40 AppleTalk Phase 2 was introduced in 1989. It was based on the original version <strong>of</strong> AppleTalk, but<br />

included several improvements and performance enhancements.<br />

41 Some <strong>of</strong> these technologies were not bundled with the first release <strong>of</strong> System 7.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 69<br />

FIGURE 1–21 System 7<br />

System 7 also had several usability improvements such as the following.<br />

• Users could view, and switch between, running applications via a menu.<br />

• The trash can now had the same status as any other folder. It now had to<br />

be proactively emptied instead <strong>of</strong> the system automatically emptying it.<br />

• In addition to cut-and-paste, text-selections could be dragged between<br />

applications.<br />

• Aliases could be created for access to documents and applications from<br />

two or more locations.<br />

• Control Panels and Extensions were organized hierarchically on disk.<br />

Certain machines such as the <strong>Mac</strong>intosh II, IIx, IIcx, and the SE/30 could


70 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

have 32-bit support and a larger virtual memory capability through a 32-bit<br />

“system enabler” program (called MODE32) on System 7. The standard<br />

ROMs <strong>of</strong> these machines were not 32-bit clean, and therefore were only<br />

compatible with 24-bit addressing. MODE32 allowed selecting and chang-<br />

ing between 24-bit and 32-bit addressing modes. With 32-bit addressing, it<br />

was possible to use more than 8 MB <strong>of</strong> contiguous physical memory. With<br />

virtual memory, it was possible to use hard disk space as swap space to<br />

run programs.<br />

Even with the aforementioned improvements, System 7 only performed coop-<br />

erative multitasking, and lacked memory protection.<br />

Around this time, Apple formed an alliance with IBM and Motorola—a move<br />

that put the PowerPC on Apple’s hardware roadmap. The advent <strong>of</strong> the PowerPC<br />

required fundamental changes in the design <strong>of</strong> the <strong>Mac</strong>intosh operating system.<br />

1.5.2. AIM for POWER<br />

The emphasis on making the semantics <strong>of</strong> computer architecture close to those <strong>of</strong><br />

higher level programming environments had led to very complex processors. How-<br />

ever, people like Seymour Cray understood the benefits <strong>of</strong> simplicity in computer<br />

architecture design even in the early 1960s. Cray’s CDC 6600 supercomputer and<br />

the CRAY-1 computer were both RISC machines, although the term “RISC” had not<br />

been coined yet.<br />

1.5.2.1. A RISCy Look Back<br />

RISC stands for Reduced Instruction Set Computer, although it does not only imply<br />

fewer instructions. RISC architectures are predominantly load-store and register-<br />

centric, usually employ fixed-format instructions, have efficient pipelining, require<br />

relatively fewer clock cycles per instruction, and so on.<br />

The line between RISC and CISC has been growing fuzzier over the years,


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 71<br />

particularly as focus <strong>of</strong> microprocessor companies has shifted to micro-<br />

architecture. It is common to see companies attempting to optimize su-<br />

perscalar, out-<strong>of</strong>-order execution. For example, Intel’s Pentium Pro (1995)<br />

translated complex x86 instructions into RISC-like micro-operations during<br />

instruction decoding. A superscalar engine executed these micro-operations<br />

in a speculative, out-<strong>of</strong>-order fashion, with register renaming. Intel’s P6 ar-<br />

chitecture had various other RISC-like features.<br />

The 801 Minicomputer Project, so called after the name <strong>of</strong> the building it was<br />

housed in, started at IBM in 1975. John Cocke, who is regarded as the “father <strong>of</strong><br />

RISC architecture,” and others explored a simplified instruction set along with<br />

compiler code-generation strategies for improving performance and reducing cost.<br />

An early RISC tenet was an instruction-processing rate <strong>of</strong> 1 per clock-cycle. The<br />

801 was able to achieve a clock-cycles-per-instruction (CPI) ratio <strong>of</strong> 1 for contrived<br />

code, but not for general-purpose code. It had 120 instructions. As instruction pipe-<br />

lining and cache memories evolved and improved, it became increasingly possible<br />

to meet the goal <strong>of</strong> having a CPI <strong>of</strong> 1.<br />

IBM’s first RISC-based product was the IBM Personal Computer RT (RISC<br />

Technology), which was announced in January 1986. It ran an operating system<br />

called the Advanced Interactive Executive (AIX). Further work led to a new design<br />

called “AMERICA,” which led to “RI<strong>OS</strong>,” and eventually the “POWER” architec-<br />

ture. POWER is a contraction for “Performance Optimized With Enhanced RISC.”<br />

It combined the original RISC concepts with some traditional (CISC) concepts re-<br />

sulting in a more balanced architecture, representing the second generation <strong>of</strong><br />

IBM’s RISC technology. The associated product family included the RISC System/<br />

6000 (RS/6000), along with the AIX 3 operating system. The first RS/6000 systems<br />

were announced on February 15, 1990.<br />

The POWER architecture defined 184 instructions, which, although a few too<br />

many from a RISC purist’s perspective, performed well with the independent execu-<br />

tion units available in the RS/6000, as multiple instructions could be executed in a


72 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

single cycle. As the POWER architecture evolved, the earliest version <strong>of</strong> the archi-<br />

tecture came to be known as POWER1. Even in the POWER1 era, there were mul-<br />

tiple implementations <strong>of</strong> POWER, such as the low-end RISC Single Chip (RSC),<br />

the mid-end RS .9, and the high-end RS 1.0. The RSC had a shared data and in-<br />

struction cache. It was a low-cost shrinkage <strong>of</strong> POWER onto a single chip, whereas<br />

the others were multiple-chip. The lowest-end RS/6000 model—the 33 MHz Model<br />

220—was released in January 1992.<br />

In the early 1980s, Berkeley and Stanford Universities were working on the<br />

RISC and MIPS projects, respectively. By 1990, there were several competing<br />

RISC architectures in the market: MIPS, HP Precision Architecture (PA-RISC),<br />

SPARC V8, Motorola 88K, and IBM RS/6000. The Intel i860 was introduced in<br />

1989 as a general-purpose, 64-bit RISC processor with 3D graphics capabilities.<br />

The Alpha AXP from Digital Equipment Corporation joined the RISC crowd in<br />

1992 as another 64-bit RISC processor.<br />

1.5.2.2. Apple Wants RISC<br />

As part <strong>of</strong> a project code-named Jaguar, Apple had briefly considered using a Mo-<br />

torola 88K variant as their future RISC-based hardware platform. They turned to the<br />

POWER architecture next.<br />

In 1991 Apple, IBM, and Motorola joined forces to form the “AIM” Alliance<br />

with the goal <strong>of</strong> creating a Common Hardware Reference Platform (CHRP). The<br />

collaboration resulted in the PowerPC Architecture—a derivative <strong>of</strong> POWER. Pow-<br />

erPC included most <strong>of</strong> the POWER instructions, while adding some new ones and<br />

excluding some rarely used instructions. Important PowerPC improvements in-<br />

cluded the following.<br />

• It supported both 32-bit and 64-bit computing, with an implementation<br />

being free to only implement the 32-bit subset. An implementation supporting<br />

both would be able to dynamically switch between them.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 73<br />

• It had a cleaner and simplified superscalar design.<br />

• It had a cleaner separation between architecture and implementation. The<br />

resulting architecture was flexible enough to permit a broad range <strong>of</strong> implementations.<br />

• It supported symmetric multiprocessor (SMP) systems.<br />

CHRP was also aimed at companies other than Apple so that they could<br />

sell PowerPC-based systems. Micros<strong>of</strong>t Windows NT 3.51 and 4.0 ran on<br />

PowerPC Reference Platform (PReP) compliant systems, until Micros<strong>of</strong>t<br />

announced in early 1997 that it would phase out NT development on the<br />

PowerPC architecture. A version <strong>of</strong> Solaris (2.5.1) was also released as<br />

Solaris PowerPC Edition.<br />

The first PowerPC processor was the 601. It was jointly developed by the AIM<br />

companies at the Somerset Design Center in the Northwest Hills <strong>of</strong> Austin, Texas.<br />

When introduced in September 1993, the 601 ran at 66 MHz. It implemented the<br />

32-bit subset <strong>of</strong> the PowerPC Architecture, but without the full PowerPC instruction<br />

set. It was regarded as a bridge that would allow vendors to transition to PowerPC.<br />

IBM’s RS/6000 Model 250 Workstation was the first PowerPC-based system to<br />

ship.<br />

From PowerPC to x86<br />

After Apple adopted the PowerPC, it remained the mainstay <strong>of</strong> Apple hardware<br />

for over a decade—until the year 2005, specifically. Steve Jobs announced in his<br />

Worldwide Developer Conference 2005 keynote that Apple had decided to transition<br />

from PowerPC to the x86 platform within the next two years. Apple also announced its<br />

partnership with Intel to facilitate the transition. <strong>Mac</strong> <strong>OS</strong> X was demonstrated to be<br />

already running on x86 hardware during the keynote.<br />

Apple has used many PowerPC generations over the years. Until Apple intro-<br />

duced the Power <strong>Mac</strong>intosh “G5” in June 2003, all PowerPC processors used by


74 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Apple had been 32-bit implementations. The first 64-bit G5 chips—namely, the<br />

PowerPC 970 and 970FX—are very similar to the POWER4 chips since the G5 is<br />

based on the POWER4 architecture. A key difference is that the G5 contains the<br />

VMX 42 vector-processing unit (VPU). Moreover, a single POWER4 chip has two<br />

processor cores, whereas the 970 and the 970FX only have one each. Apple added<br />

the dual-core 970MP processor to its PowerPC <strong>of</strong>ferings in the second half <strong>of</strong> 2005.<br />

1.5.2.3. Apple Likes RISC: ARM<br />

As Apple was turning to RISC computing in the early 1990s, it collaborated with<br />

other partners besides IBM. In the mid 1980s, the Cambridge-based British com-<br />

pany Acorn Computer Group 43 had developed the world’s first commercial RISC<br />

processor. At that time, ARM stood for “Acorn RISC <strong>Mac</strong>hine.” The first version <strong>of</strong><br />

the ARM architecture (ARMv1) had 26-bit addressing, with no onboard multiplier<br />

or coprocessor. The first ARMv1 processor, the ARM1, saw limited use in proto-<br />

types <strong>of</strong> the Archimedes workstation and as a low-cost secondary component in the<br />

BBC microcomputer. It is noteworthy that ARM eschewed some key features <strong>of</strong> the<br />

prevailing Berkeley RISC architecture: delayed branching, register windows, and<br />

requiring all instructions to execute in a single cycle each.<br />

Even before the AIM alliance was formed, Apple had teamed with Acorn to<br />

fund a new company called Advanced RISC <strong>Mac</strong>hines (ARM) Limited. The com-<br />

pany’s goal was to create a new RISC microprocessor standard. VLSI Technology<br />

was an investor and technology partner in this endeavor. It was also ARM’s first<br />

licensee. ARM Limited’s first processor was an embeddable RISC core called the<br />

ARM6. Based on version 3 <strong>of</strong> the ARM processor architecture (ARMv3), the<br />

ARM6 had full 32-bit code and data addressing. An ARM6 processor—a 20 MHz<br />

42 VMX is the same as AltiVec, which is a Motorola trademark.<br />

43 One <strong>of</strong> Acorn’s best-known computers was the BBC micro, which, at its launch in 1981, was based<br />

on a 2 MHz 6502 processor.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 75<br />

610—was used in Apple’s MessagePad hand-held that ran the Newton operating<br />

system 44.<br />

1.5.3. <strong>Mac</strong> <strong>OS</strong> for PowerPC<br />

System 7.1.2 was the first Apple operating system to run on the PowerPC, even<br />

though much <strong>of</strong> the code was not PowerPC-native. Given Apple’s roadmap, porting<br />

all components <strong>of</strong> the operating system to a new architecture would have taken pro-<br />

hibitively long. Moreover, it was extremely important for Apple to provide a way so<br />

that 68K-based applications would continue to run even on the PowerPC platform.<br />

The system architecture devised to address these issues included a hardware ab-<br />

straction layer (HAL) and a 68K emulator.<br />

A nanokernel 45 was used to “drive” the PowerPC. Executing in supervisor<br />

mode, the nanokernel acted as the HAL. It exported low-level interfaces for inter-<br />

rupt management, exception handling, memory management, and so on. Only the<br />

system s<strong>of</strong>tware and possibly debuggers could use the nanokernel API.<br />

The 68K emulator was initialized by the nanokernel during boot time. It only<br />

emulated a 68LC040 46 user-mode instruction set, without emulating the paged<br />

MMU (PMMU) or the FPU. Exception stack frames were created as per a slightly<br />

older processor (the 68020) for better compatibility. There were other caveats and<br />

limitations as compared to a real 68LC040. In particular, since A/UX used the<br />

PMMU directly, it did not run on this emulator.<br />

Since two instruction-set architectures were simultaneously in effect, a system<br />

level component called the Mixed Mode Manager was used to handle context<br />

44 Keywords <strong>of</strong>ten associated with ARM processors include “embedded,” “high-performance,” “lowcost,”<br />

“power-efficient,” and “RISC.” Such features are especially appealing for low-power devices.<br />

45 A term sometimes used to refer to a kernel that is even smaller than a microkernel.<br />

46 The 68LC040 was a low-cost version <strong>of</strong> the 68040—it lacked a floating-point unit.


76 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

switches between the two types <strong>of</strong> code. Code pieces belonging to the two archi-<br />

tectures could also call each other. The manager was transparent to 68K code, but<br />

PowerPC code was aware <strong>of</strong> it.<br />

The initial PowerPC ports <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> had little native PowerPC code—most<br />

existing applications, device drivers, system extensions, large parts <strong>of</strong> the Toolbox,<br />

and the operating system itself were not PowerPC-native. In fact, even though Ap-<br />

ple’s PowerPC introduction occurred in 1994, most <strong>of</strong> the operating system was still<br />

68K-based in 1996. It would not be until 1998 that <strong>Mac</strong> <strong>OS</strong> was mostly PowerPC-<br />

native. Figure 1–22 is a conceptual depiction <strong>of</strong> part <strong>of</strong> the transition to PowerPC.<br />

It was hoped that the nanokernel would form the basis for future Apple sys-<br />

tems, perhaps as a robust microkernel.<br />

1.5.4. MAE<br />

A Mixed Mode Manager was also used in Apple’s <strong>Mac</strong>intosh Application Environ-<br />

ment (MAE) product. MAE was an X Window application available for Sun and<br />

Hewlett-Packard workstations. It ran on Sun<strong>OS</strong> (SPARC) and HP-UX (HP9000/<br />

700), providing an emulated <strong>Mac</strong>intosh environment. It also contained a 68K emu-<br />

lator—for example, MAE 3 had a 68LC040 emulator. The Mixed Mode Manager<br />

was used to optimize execution by translating 68K code to native instructions if<br />

possible.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 77<br />

“Single”<br />

Finder<br />

Multi<br />

Finder<br />

Single<br />

Application<br />

Multi<br />

Finder<br />

<strong>Mac</strong>intosh Toolbox <strong>Mac</strong>intosh Toolbox<br />

Drivers Core <strong>OS</strong> Drivers Core <strong>OS</strong><br />

68k 68k<br />

(1) (2)<br />

Applications<br />

Multi<br />

Finder<br />

Carbon<br />

Drivers Core <strong>OS</strong> Drivers Core <strong>OS</strong><br />

68k Emulator 68k Emulator<br />

Nanokernel Nanokernel<br />

PowerPC PowerPC<br />

(3) (4)<br />

FIGURE 1–22 Transitioning to the PowerPC<br />

Applications<br />

Applications<br />

MAE provided an emulated System 7. Depending on the MAE version, it sup-<br />

ported features such as aliases, AppleEvents, AppleTalk, NFS, QuickDraw, Quick-<br />

Time, and TrueType. MAE ran as a user-space process called mae, along with an<br />

auxiliary daemon process called macd, which was the <strong>Mac</strong>intosh environment dae-<br />

mon. Multiple copies <strong>of</strong> MAE could run simultaneously on a workstation within the<br />

constraints <strong>of</strong> available resources.


78 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

MAE contained an implementation <strong>of</strong> the <strong>Mac</strong>intosh Process Manager, which<br />

was responsible for loading and unloading all <strong>Mac</strong>intosh applications used from<br />

within MAE. When the mae process started, it reserved a memory region for use by<br />

the Process Manager and the virtual <strong>Mac</strong>intosh system. The default size <strong>of</strong> this re-<br />

gion was 16MB, although the user could configure it based on resources available<br />

on the host, the number <strong>of</strong> MAE instances that could be launched, and the amount<br />

<strong>of</strong> “physical memory” desired in the virtual environment. Even though MAE itself<br />

ran on a UNIX system, applications within MAE ran with cooperative multitask-<br />

ing—as they would on a real <strong>Mac</strong>intosh. Moreover, there was no memory protec-<br />

tion. MAE had several behavioral similarities to A/UX. It made UNIX file systems<br />

visible as <strong>Mac</strong> <strong>OS</strong> volumes. UNIX symbolic links were represented as aliases. A<br />

MAE user could launch UNIX commands from the Finder.<br />

Since MAE had neither a real <strong>Mac</strong>intosh-compatible graphics card nor a real<br />

monitor, its graphics component had to provide an illusion to the <strong>Mac</strong>intosh s<strong>of</strong>t-<br />

ware running within it. It implemented a virtual <strong>Mac</strong>intosh monitor as a frame-<br />

buffer, which was updated as a result <strong>of</strong> applications making QuickDraw calls, with<br />

QuickDraw, in turn, notifying MAE <strong>of</strong> the parts <strong>of</strong> the bitmap that had changed. In<br />

early versions <strong>of</strong> MAE, the entire framebuffer was passed to the X Window system.<br />

In version 3.0 <strong>of</strong> MAE, updates to the framebuffer were translated to Xlib calls that<br />

were sent to the X server.<br />

MAE included the following primary components.<br />

• The main executable (apple/bin/mae), the auxiliary daemon, other<br />

native UNIX code, and related data<br />

• The MAE engine (apple/lib/engine), which included code for the<br />

<strong>Mac</strong> <strong>OS</strong> ROM (Toolbox), 680x0 “glue” code, and related data<br />

• <strong>Mac</strong> <strong>OS</strong> system code, application code, and data<br />

• The MAE X Window graphics buffer


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 79<br />

The glue code mapped <strong>Mac</strong> <strong>OS</strong> operations to UNIX system calls. The MAE<br />

engine and associated data were mapped into memory using the mmap() system<br />

call. If the host platform supported copy-on-write, substantial portions <strong>of</strong> MAE<br />

could be shared between its multiple instances.<br />

MAE made heavy use <strong>of</strong> processor caches, performing best on machines with<br />

large caches. It cached both instructions and data. Examples <strong>of</strong> instruction cache use<br />

by MAE included the following.<br />

• Native code to support the 680x0 glue and dynamic compilation<br />

• Native code to emulate instructions<br />

• Dynamically compiled code to emulate instructions<br />

Examples <strong>of</strong> data cache use by MAE included the following.<br />

• Native data to support the 680x0 glue and dynamic compilation<br />

• Dispatch table 47 for mapping 680x0 opcodes to native emulation code<br />

• 680x0 instructions emulated by MAE<br />

• 680x0 data for <strong>Mac</strong> <strong>OS</strong> system code and the Toolbox<br />

• Graphics framebuffer<br />

MAE was discontinued on May 14, 1998.<br />

MAS<br />

Apple had announced another emulation-based <strong>Mac</strong>-on-Unix solution called<br />

<strong>Mac</strong>intosh Application Services (MAS). Unlike MAE, MAS supported both 680x0-based<br />

and PowerPC-based <strong>Mac</strong>intosh s<strong>of</strong>tware on PowerPC-based Unix systems such as<br />

AIX.<br />

47 The dispatch table was indexed by the 16-bit 680x0 opcode. It was perhaps the most aggressive<br />

cache user among all <strong>of</strong> MAE’s components.


80 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Meanwhile, Apple continued to develop System 7, adding features and im-<br />

proving existing features. The Internet was burgeoning, rapidly making networking<br />

capabilities an essential component <strong>of</strong> even end-user operating systems. System 7.5<br />

and later included OpenTransport, a networking subsystem based on Mentat Port-<br />

able STREAMS.<br />

Other noteworthy features added to <strong>Systems</strong> 7.5.x included QuickDraw 3D, a<br />

Java runtime, and the OpenDoc component s<strong>of</strong>tware architecture that could be lik-<br />

ened to Micros<strong>of</strong>t’s Object Linking and Embedding (OLE). Visual enhancements<br />

such as a startup screen with a <strong>Mac</strong> <strong>OS</strong> logo and a progress bar were also added<br />

around this time.<br />

In the 1990s, Apple also made some forays into server computing. Let us<br />

briefly look at some <strong>of</strong> these endeavors.<br />

1.5.5. Apple Workgroup Server<br />

Apple Workgroup Server was a line <strong>of</strong> servers intended for use as file, print, and<br />

database servers for workgroups. These systems were initially 68K-based, but<br />

PowerPC-based systems were also available eventually. The following are some<br />

examples <strong>of</strong> systems from this line.<br />

• WGS 60 (50/25 MHz Motorola 68040) used System 7.1, ran AppleShare<br />

4.0, and was targeted at small businesses and classroom lab environments.<br />

• WGS 80 (66 MHz Motorola 68040) used System 7.1, ran AppleShare<br />

4.0, and was targeted at medium-sized business environments where it<br />

could act as a communications server – for example, as an Internet router<br />

and a SNA*ps, X.25, or X.400 gateway.<br />

• WGS 95 (66 MHz Motorola 68040) used A/UX 3.1 as the server operating<br />

system, ran AppleShare Pro, and was targeted at large or dataintensive<br />

workgroups—for example, as a high-performance AppleShare<br />

file and print server. It was also intended to run relational database<br />

(RDBMS) products such as Oracle7 Cooperative Server.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 81<br />

in 1997.<br />

• WGS 9650 (233 MHz PowerPC 604e) ran <strong>Mac</strong> <strong>OS</strong> 7.6.1.<br />

The 60, 80, and 95 were introduced in 1993, whereas the 9650 was introduced<br />

1.5.6. NetWare for PowerPC<br />

Apple partnered with Novell in the mid 1990s to port NetWare to the PowerPC. The<br />

jointly funded port was designed to be much easier to configure than NetWare for<br />

x86. It was intended to run on an Apple-designed server called Shiner.<br />

Although the port was more or less completed, the project was killed before it<br />

ever shipped. Shiner would lead to the Apple Network Server, which ran AIX.<br />

1.5.7. AIX for PowerPC<br />

A few years later—in 1996—Apple had a short-lived product called Apple Network<br />

Server. The PowerPC-based server had hardware features such as the following.<br />

• Processor resident on a daughterboard for easy upgradeability<br />

• An easy-to-replace logic board<br />

• Up to 1MB <strong>of</strong> L2 cache<br />

• Up to 512MB <strong>of</strong> parity RAM<br />

• A 4MB ROM and an 8KB NVRAM<br />

• Multiple hot-swappable and RAID-capable drive bays, for a total approximate<br />

disk capacity <strong>of</strong> 340GB<br />

• Hot-swappable power supplies and fans<br />

• Provisions for adding several SCSI devices and PCI cards<br />

• An external LCD display for system diagnostics and status messages<br />

• Several physical security features


82 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

The Network Server came with the AIX for Apple Network Servers operating<br />

system, which was based on IBM’s AIX. The server did not support <strong>Mac</strong> <strong>OS</strong>. With<br />

AIX, Apple had an advanced operating system with features such as the following.<br />

• Memory protection<br />

• Preemptive multitasking<br />

• Multithreading<br />

• Support for various networking protocols including AppleTalk and<br />

AppleTalk services<br />

• RAID<br />

• Journal File System (JFS)<br />

• Logical Volume Manager (LVM), which supported multiple file systems<br />

up to 256GB in size, and could handle files up to 2GB in size<br />

The user could work with the command-line interface, or could have one <strong>of</strong><br />

the AIXwindows or Common Desktop Environment (CDE) graphical interfaces. The<br />

operating system included several applications to ease administrative tasks. A<br />

menu-driven System Management Interface Tool (SMIT) was used for configura-<br />

tion, installation, maintenance, and troubleshooting. A graphical Visual System<br />

Management (VSM) interface allowed system tasks to be performed by clicking on<br />

icons.<br />

Apple revised the Network Server line shortly after its introduction, but dis-<br />

continued it in 1997. The next serious server <strong>of</strong>fering from Apple would not be until<br />

2002, when the Xserve would be released.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 83<br />

1.6. QUEST FOR THE 48 OPERATING SYSTEM<br />

FIGURE 1–20 Micros<strong>of</strong>t Windows NT 3.1<br />

Micros<strong>of</strong>t’s Windows 3.x had been extremely successful since its release in 1990.<br />

Micros<strong>of</strong>t had been working on a new operating system code-named “Chicago.”<br />

Initially slated for 1993 release, “Chicago” kept slipping. It would be eventually be<br />

released as Windows 95. Micros<strong>of</strong>t did, however, release Windows NT in 1993. NT<br />

was an advanced operating system meant for high-end client-server applications. It<br />

had various important features such as symmetric multiprocessing support, a pre-<br />

48 Whereas the word “the” is used here to designate prominence and desirability, it is an interesting<br />

coincidence that “THE” was the name <strong>of</strong> a multiprogramming system described by Edsger W. Dijkstra<br />

in a 1968 paper.


84 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

emptive scheduler, integrated networking, subsystems for <strong>OS</strong>/2 and P<strong>OS</strong>IX, virtual<br />

machines for D<strong>OS</strong> and 16-bit Windows, a new file system called NTFS, and sup-<br />

port for the Win32 API.<br />

Apple needed an answer to Micros<strong>of</strong>t’s onslaught, particularly in the face <strong>of</strong><br />

the upcoming Windows 95, which was to be an end-user operating system.<br />

The Pink and the Red projects would turn out to be rather unsuccessful. Apple<br />

would continue to make attempts to solve the “<strong>OS</strong> problem” one way or another.<br />

1.6.1. Star Trek<br />

Star Trek was a bold project that Apple ran jointly with Novell to port <strong>Mac</strong> <strong>OS</strong> to<br />

run on the x86 platform. A team consisting <strong>of</strong> engineers from both Apple and No-<br />

vell actually succeeded in creating a very reasonable prototype in an incredibly<br />

short amount <strong>of</strong> time. The project was cancelled, however, for various reasons: Ap-<br />

ple had already committed to the PowerPC; many within and outside <strong>of</strong> Apple<br />

thought that doing so would disrupt Apple’s existing business model; and vendor<br />

feedback was not encouraging.<br />

Many years later, Darwin—the core <strong>of</strong> Apple’s far more successful <strong>Mac</strong> <strong>OS</strong><br />

X—would run on both the PowerPC and the x86. Whereas the Star Trek prototype<br />

showed the “Happy <strong>Mac</strong>” logo while booting up, Darwin/x86 prints the message<br />

“Welcome to <strong>Mac</strong>intosh” during boot.<br />

Star Trek was finally vindicated with Apple’s mid-2005 announcement <strong>of</strong> tran-<br />

sitioning <strong>Mac</strong> <strong>OS</strong> X to the x86 platform. The first x86-based <strong>Mac</strong>intosh comput-<br />

ers—the i<strong>Mac</strong> and the <strong>Mac</strong>Book Pro (the successor to the PowerBook)—were un-<br />

veiled at the San Francisco <strong>Mac</strong>world Conference & Expo in January 2006.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 85<br />

1.6.2. Raptor<br />

Raptor was in many respects the Red project. It was supposed to provide Apple<br />

with a next-generation microkernel that would run on any architecture. As the Star<br />

Trek project was being cancelled, it was considered for absorption by Raptor, which<br />

itself would die due to budgetary limitations and employee attrition, among other<br />

reasons.<br />

1.6.3. NuKernel<br />

NuKernel was a kernel project at Apple that was meant to result in a modern operat-<br />

ing system kernel on more than one occasion.<br />

1.6.4. Tal<strong>OS</strong><br />

Apple and IBM formed a company called Taligent in early 1992 to continue work<br />

on the Pink project. Pink originally aimed to be an object-oriented operating system,<br />

but later morphed into an object-oriented environment called CommonPoint that ran<br />

on many modern operating systems such as AIX, HP-UX, <strong>OS</strong>/2, Windows 95, and<br />

Windows NT. It was also meant to run on Apple’s NuKernel. Taligent Object Serv-<br />

ices (Tal<strong>OS</strong>) was the name given to a set <strong>of</strong> lower-level technologies that were to be<br />

built around <strong>Mac</strong>h 3.0. Tal<strong>OS</strong> was meant to be an extensible and portable operating<br />

system, with a small footprint and good performance.<br />

Tal<strong>OS</strong> was object-oriented from the kernel up, with even device drivers and<br />

network protocols implemented in an object-oriented fashion. Taligent’s object-<br />

oriented libraries were known as frameworks. There were frameworks for user in-<br />

terfaces, text, documents, graphics, multimedia, fonts, printing, and low-level serv-<br />

ices such as drivers. These, along with the Tal<strong>OS</strong> development tools, explicitly


86 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

strived to shift the burden <strong>of</strong> programming from application developers to applica-<br />

tion system engineers.<br />

Note that even though there existed other commercial systems such as NEXT-<br />

STEP that had object-oriented application frameworks, Taligent aimed to build its<br />

entire programming model around objects. In NEXTSTEP, the developers who cre-<br />

ated frameworks had to map object behavior to the underlying libraries, Unix sys-<br />

tem calls, Display PostScript, and so on—all <strong>of</strong> which had procedural APIs. In con-<br />

trast, Taligent’s CommonPoint applications were not meant to use the host <strong>OS</strong> APIs<br />

at all.<br />

In 1995, Taligent became a wholly owned subsidiary <strong>of</strong> IBM. The Pink project<br />

did not give Apple the next-generation operating system that Apple had been seek-<br />

ing.<br />

1.6.5. Copland<br />

Apple made an announcement in early 1994 that it would channel more than a dec-<br />

ade <strong>of</strong> experience into the next major release <strong>of</strong> the <strong>Mac</strong>intosh operating system,<br />

<strong>Mac</strong> <strong>OS</strong> 8. The project was codenamed “Copland.” It was expected that Copland<br />

would be Apple’s real response to Micros<strong>of</strong>t Windows. With Copland, Apple hoped<br />

to achieve several goals, many <strong>of</strong> which had been long elusive, such as the follow-<br />

ing:<br />

• Adopt RISC as a key foundation technology by making the system fully<br />

PowerPC-native.<br />

• Integrate, improve, and leverage existing Apple technologies such as<br />

ColorSync, OpenDoc, PowerShare, PowerTalk, QuickDraw 3D, and<br />

QuickDraw GX.<br />

• Retain and improve the ease-<strong>of</strong>-use <strong>of</strong> the <strong>Mac</strong> <strong>OS</strong> interface, while making<br />

it multiuser and fully customizable. In particular, Copland’s implementation<br />

<strong>of</strong> themes allowed customization <strong>of</strong> most user-interface elements<br />

on a per-user basis.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 87<br />

• Extend interoperability with D<strong>OS</strong> and Windows.<br />

• Make <strong>Mac</strong> <strong>OS</strong> systems the best network clients.<br />

• Incorporate active assistance that works across applications and networks—that<br />

is, make it very easy to automate a wide variety <strong>of</strong> tasks.<br />

• Release Copland as a system that may be openly licensed to foster development<br />

<strong>of</strong> <strong>Mac</strong> <strong>OS</strong> compatible clones by third parties.<br />

To achieve these goals, Copland was supposed to have a comprehensive set <strong>of</strong><br />

system-level features, for example:<br />

• A hardware abstraction layer (HAL) that would also help vendors in creating<br />

compatible systems<br />

• A microkernel (the NuKernel) at its core<br />

• Symmetric multiprocessing with preemptive multitasking<br />

• Improved virtual memory with memory protection<br />

• A flexible and powerful system extension mechanism<br />

• Critical subsystems such as I/O, networking, and file systems running as<br />

services on top <strong>of</strong> the kernel<br />

• Built-in low-level networking facilities such as X/Open Transport Interface<br />

(OTI), System V STREAMS, and Data Link Provider Interface<br />

(DLPI)<br />

• File searching based on both metadata and content<br />

• The ability to perform “live upgrades” on a system without affecting the<br />

performance <strong>of</strong> other running programs<br />

Work on Copland gained momentum during the early 1990s, and by the mid<br />

1990s, Copland was heavily counted on to do wonders for Apple. Apple dubbed it<br />

as “The <strong>Mac</strong> <strong>OS</strong> Foundation for the Next Generation <strong>of</strong> Personal Computers.”<br />

However, the project kept slipping. A few prototypical Driver Development Kit<br />

(DDK) releases went out, but a 1996 release, as had been planned and hoped, did<br />

not seem feasible. Due to numerous pressures, full memory protection had not been<br />

included after all. Apple’s CEO Gil Amelio described the state <strong>of</strong> Copland as “...<br />

just a collection <strong>of</strong> separate pieces, each being worked on by a different team... that<br />

were expected to magically come together somehow...”


88 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

A conceptual view <strong>of</strong> Copland is shown in Figure 1–24.<br />

Preemptive Multitasking<br />

with Memory Protection<br />

Task 2<br />

OpenDoc<br />

Component<br />

S<strong>of</strong>tware<br />

Architecture<br />

Task n<br />

Task 1<br />

File System I/O Subystem Networking Subsystem<br />

Preemptive<br />

Multitasking<br />

FIGURE 1–24 Copland architecture<br />

QuickDraw GX QuickDraw 3D PowerTalk PowerShare<br />

APIs/Frameworks/Libraries/Services<br />

Protected<br />

Memory<br />

Copland-aware<br />

Application<br />

Hardware Abstraction<br />

Copland Microkernel<br />

Finder<br />

<strong>Mac</strong>intosh Toolbox Environment<br />

System Extension<br />

Mechanism<br />

<strong>Mac</strong>intosh<br />

System 7.x<br />

Application<br />

Open<br />

Transport<br />

Networking<br />

Architecture<br />

Apple eventually decided to cancel Copland in May 1996. Amelio announced<br />

that Copland’s best pieces would be shipped with future releases <strong>of</strong> their existing<br />

system, beginning with the upcoming System 7.6, whose name was formally<br />

changed to <strong>Mac</strong> <strong>OS</strong> 7.6.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 89<br />

1.6.6. Gershwin<br />

After the Copland debacle, Apple’s need for a new operating system was direr than<br />

ever. Focus shifted briefly to a project named Gershwin, which was to include the<br />

painfully elusive memory protection, among other things. However, it was appar-<br />

ently nothing more than a codename, and it is believed that nobody ever worked on<br />

Gershwin.<br />

1.6.7. Be<strong>OS</strong><br />

Apple briefly considered partnering with Micros<strong>of</strong>t to create an Apple <strong>OS</strong> based on<br />

Windows NT. Other systems under consideration were Solaris from Sun Microsys-<br />

tems and Be<strong>OS</strong> from Be. In fact, Apple’s acquisition <strong>of</strong> Be came rather close to ma-<br />

terializing.<br />

Be was founded in 1990 by Jean-Louis Gassée, Apple’s former head <strong>of</strong> Prod-<br />

uct Development. Be’s capable engineering team had created an impressive operat-<br />

ing system in Be<strong>OS</strong>. It had memory protection, preemptive multitasking, and sym-<br />

metric multiprocessing. It even ran on the PowerPC, 49 thus fitting with Apple’s<br />

hardware agenda. Be<strong>OS</strong> was designed to be especially adept at handling multime-<br />

dia. It had a metadata-rich file system called BeFS that allowed files to be accessed<br />

via multiple attributes. However, Be<strong>OS</strong> was still an unfinished and unproven prod-<br />

uct. For example, it did not yet support file sharing or printing, and only a few ap-<br />

plications had been written for it. Figure 1–25 shows a screenshot <strong>of</strong> Be<strong>OS</strong>.<br />

49 Be<strong>OS</strong> initially ran on Be’s own PowerPC-based machine called the BeBox. It was later ported to the<br />

x86 platform.


90 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

FIGURE 1–25 Be<strong>OS</strong><br />

Gassée and Apple negotiated back and forth over Be’s acquisition. The total<br />

investment in Be at that time was estimated to be about $20 million, and Apple val-<br />

ued Be at $50 million. Gassée sought over $500 million, being confident that Apple<br />

would buy Be. Apple negotiated up to $125 million, and Be negotiated down to<br />

$300 million. When things still did not work out, Apple <strong>of</strong>fered $200 million, and<br />

even though it is rumored that Gassée was actually willing to accept this <strong>of</strong>fer, it is<br />

also said that he came back with a “final price” <strong>of</strong> $275 million, hoping Apple<br />

would bite the bullet. The deal did not happen. In any case, Be had a tough con-<br />

tender in NeXT, a company founded and run by another one-time Apple employee:<br />

Steve Jobs.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 91<br />

Be would eventually fail as a company—its technological assets were acquired<br />

by Palm, Inc. in 2001.<br />

1.6.8. Plan A<br />

Unlike Be, NeXT’s operating systems had at least been proven in the market, de-<br />

spite NeXT not having any resounding successes. In particular, OPENSTEP had<br />

been well received in the enterprise market. Moreover, Steve Jobs pitched NeXT’s<br />

technology strongly to Apple, asserting that OPENSTEP was many years ahead <strong>of</strong><br />

the market. The deal with NeXT did go through: Apple acquired NeXT in February<br />

1997 for over $400 million. Amelio later quipped, "We choose plan A instead <strong>of</strong><br />

Plan Be."<br />

NeXT’s acquisition would prove pivotal to Apple, as NeXT’s operating system<br />

technology would be the basis for what would become <strong>Mac</strong> <strong>OS</strong> X. Let us now look<br />

at the background <strong>of</strong> NeXT’s systems.<br />

1.7. THE NEXT CHAPTER<br />

All <strong>of</strong> Steve Jobs’ operational responsibilities at Apple were “taken away” on May<br />

31, 1985. Around this time, Jobs had come up with an idea for a startup for which<br />

he pulled in five other Apple employees. The idea was to create the perfect research<br />

computer for universities, colleges, and research labs. Jobs had even attempted to<br />

seek the opinion <strong>of</strong> Nobel laureate biochemist Paul Berg on using such a computer<br />

for simulations. Although interested in investing in Jobs’ startup, Apple sued Jobs<br />

upon finding out about the Apple employees joining him. After some mutual<br />

agreements, Apple dropped the suit the year after. The startup was NeXT Computer,<br />

Inc.


92 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

NeXT’s beginnings were promising. Jobs initially used $7 million <strong>of</strong> his per-<br />

sonal money. Several larger investments would be made in NeXT, such as $20 mil-<br />

lion from Ross Perot and $100 million from Canon Inc. a few years later. True to<br />

its original goal, NeXT strived to create a computer that would be perfect in form<br />

and function. The result was the NeXT cube.<br />

The cube’s motherboard had a clever, visually appealing design. Its magne-<br />

sium case was painted black with a matte finish. The monitor stand required an as-<br />

tonishing amount <strong>of</strong> engineering (for a monitor stand). An onboard digital signal-<br />

processing chip allowed the cube to play stereo quality music. The machines were<br />

manufactured in NeXT’s own state-<strong>of</strong>-the-art factory.<br />

1.7.1. NEXTSTEP<br />

Jobs unveiled the NeXT cube on October 12, 1988, at the Davies Symphony Hall in<br />

San Francisco. The computer ran an operating system called NEXTSTEP, which<br />

used as its kernel a port <strong>of</strong> CMU <strong>Mac</strong>h 2.0 with a 4.3BSD environment. 50 NEXT-<br />

STEP’s window server was based on Display PostScript—a marriage <strong>of</strong> the Post-<br />

Script page-description language and window-system technologies.<br />

In 1986, Sun Microsystems had announced their own Display Postscript<br />

Window System called NeWS.<br />

NEXTSTEP <strong>of</strong>fered both a graphical user-interface and a Unix-style<br />

command-line interface. The NEXTSTEP graphical user interface had multilevel<br />

menus, windows whose contents were shown while being dragged, and smooth<br />

scrolling. A dock application always stayed on top and held frequently used applica-<br />

tions. Other NEXTSTEP features included the following.<br />

• The ability to “hide” applications instead <strong>of</strong> quitting them<br />

50 The <strong>Mac</strong>h implementation in NEXTSTEP included NeXT-specific features, as well as some features<br />

from later versions <strong>of</strong> CMU <strong>Mac</strong>h.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 93<br />

• CD-quality sound<br />

• A versatile mail application that supported voice annotation <strong>of</strong> messages,<br />

inline graphics, and dynamic lookup <strong>of</strong> email addresses over the network<br />

• Drag and drop <strong>of</strong> complex objects between applications<br />

• A services menu that could be accessed from various applications to provide<br />

services such as dictionary and thesaurus<br />

• A Digital Librarian application that could build searchable indexes <strong>of</strong><br />

content dragged to it<br />

• A file viewer that extended across the network<br />

• An object-oriented device driver framework called the Driver Kit<br />

NEXTSTEP used drag and drop as a fundamental, powerful operation. It was<br />

possible to drag an image from, say, the mail application, to a document editing ap-<br />

plication such as WordPerfect. Conversely, you could drag a spreadsheet to the mail<br />

application to attach it with a message. Since the file viewer was network capable, a<br />

remote directory could be dragged as a short cut on the user’s desktop (specifically,<br />

on the shelf).<br />

NEXTSTEP used Objective-C as its native programming language. It included<br />

Interface Builder, a tool for designing application user interfaces graphically. A<br />

number <strong>of</strong> s<strong>of</strong>tware kits were provided to aid in application development. A s<strong>of</strong>t-<br />

ware kit was a collection <strong>of</strong> reusable classes (or object templates). Examples in-<br />

clude the Application Kit, the Music Kit, and the Sound Kit.<br />

Objective-C<br />

Objective-C is an object-oriented, compiled programming language invented by<br />

Brad Cox and Tom Love in the early 1980s. It is an object-oriented superset <strong>of</strong> C, with<br />

dynamic binding and a messaging syntax inspired by Smalltalk. It aims to be a simpler<br />

language than C++. Consequently, it does not have many features <strong>of</strong> C++, such as<br />

multiple inheritance and operator overloading.


94 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Cox and Love founded StepStone Corporation, from which NeXT licensed the<br />

language and created its own compiler. In 1995, NeXT acquired all rights to Step-<br />

Stone’s Objective-C related intellectual property.<br />

compiler.<br />

Apple’s Objective-C compiler used in <strong>Mac</strong> <strong>OS</strong> X is a modified version <strong>of</strong> the GNU<br />

At the time <strong>of</strong> the cube’s announcement, NEXTSTEP was at version 0.8. It<br />

would be another year before a 1.0 mature release would be made.<br />

NEXTSTEP 2.0 was released a year after 1.0, with improvements such as sup-<br />

port for CD-ROMs, color monitors, NFS, on-the-fly spell checking, and<br />

dynamically-loadable device drivers.<br />

In the fall <strong>of</strong> 1990, Timothy John “Tim” Berners-Lee at CERN created the<br />

first web browser. It <strong>of</strong>fered WYSIWYG browsing and authoring. The<br />

browser was developed on a NeXT computer. Tim’s collaborator, Robert<br />

Cailliau, later said that “... Tim’s prototype implementation on NEXTSTEP is<br />

made in the space <strong>of</strong> a few months, thanks to the qualities <strong>of</strong> the NEXT-<br />

STEP s<strong>of</strong>tware development system...”<br />

At the 1992 NeXTWORLD Expo, NEXTSTEP 486—a $995 version for the<br />

x86—was announced.<br />

The last version <strong>of</strong> NEXTSTEP—3.3—was released in February 1995. By that<br />

time NEXTSTEP had very powerful application development facilities courtesy <strong>of</strong><br />

tools such as the Project Builder and the Interface Builder. There existed an exten-<br />

sive collection <strong>of</strong> libraries for user interfaces, databases, distributed objects, multi-<br />

media, networking, and so on. NEXTSTEP’s object-oriented device driver toolkit<br />

was especially helpful in driver development.<br />

Figure 1–26 shows a screenshot <strong>of</strong> NEXTSTEP.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 95<br />

FIGURE 1–26 NEXTSTEP<br />

NEXTSTEP ran on the 68K, x86, PA-RISC, and SPARC platforms. It was<br />

possible to create a single version <strong>of</strong> an application containing binaries for all sup-<br />

ported architectures. Such multiple-architecture binaries are known as “fat” binari-<br />

es 51.<br />

Despite the elegance <strong>of</strong> NeXT’s hardware and the virtues <strong>of</strong> NEXTSTEP, the<br />

company had proven to be economically unviable over the years. In early 1993,<br />

NeXT announced its plans to leave the hardware business but continue development<br />

51 <strong>Mac</strong> <strong>OS</strong> X supports fat binaries. In particular, a fat binary can be used to contain 32-bit and 64-bit<br />

versions <strong>of</strong> a program on <strong>Mac</strong> <strong>OS</strong> X 10.4 and later. The so called “Universal Binaries” on the x86<br />

version <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X are simply fat binaries.


96 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

<strong>of</strong> NEXTSTEP for the x86 platform. Figure 1–27 shows the timeline <strong>of</strong> NeXT’s<br />

operating systems.<br />

RIG<br />

! <strong>Mac</strong>h 0.8, mid 1970s<br />

Accent<br />

! <strong>Mac</strong>h 0.9, circa 1979<br />

<strong>Mac</strong>h 1.0<br />

Project started in 1984<br />

USENIX paper in 1986<br />

<strong>Mac</strong>h 2.0<br />

<strong>Mac</strong>h 2.5<br />

<strong>Mac</strong>h 2.6<br />

<strong>Mac</strong>h 3.0<br />

4.3BSD<br />

NeXT additions to <strong>Mac</strong>h<br />

OpenStep<br />

Specification<br />

1994<br />

OPENSTEP 4.0<br />

July 1996<br />

Apple buys NeXT<br />

February 4, 1997<br />

FIGURE 1–27 The timeline <strong>of</strong> NeXT’s operating systems<br />

NEXTSTEP 0.8<br />

October 1988<br />

NEXTSTEP 1.0<br />

September 1989<br />

2.0<br />

September 1990<br />

2.1<br />

March 1991<br />

3.0<br />

September 1992<br />

3.1<br />

May 1993<br />

3.2<br />

October 1993<br />

3.3<br />

February 1995<br />

4.1<br />

December 1996<br />

4.2<br />

January 1997


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 97<br />

Canon had a personal workstation, the object.station 41, which was designed to<br />

run NEXTSTEP. The system’s 100 MHz Intel 486DX4 processor was upgradeable to<br />

an Intel Pentium OverDrive processor. Besides NEXTSTEP as the operating system,<br />

the machine included Insignia Solutions’ S<strong>of</strong>tPC.<br />

1.7.2. OPENSTEP<br />

NeXT partnered with Sun Microsystems to jointly release specifications for Open-<br />

Step, an open platform comprised <strong>of</strong> several APIs and frameworks that anybody<br />

could use to create their own implementation <strong>of</strong> an object-oriented operating sys-<br />

tem—running on any underlying core operating system. The OpenStep API was<br />

implemented on Sun<strong>OS</strong>, HP-UX, and Windows NT. NeXT’s own implementa-<br />

tion—essentially an OpenStep compliant version <strong>of</strong> NEXTSTEP—was released as<br />

OPENSTEP 4.0 in July 1996, with 4.1 and 4.2 following shortly afterwards.<br />

The OpenStep API and the OPENSTEP operating system did not seem to turn<br />

things around for NeXT, even though they caused some excitement in the business,<br />

enterprise, and government markets. NeXT started to shift focus to its WebObjects<br />

product, which was a multiplatform environment for rapidly building and deploying<br />

web-based applications.<br />

As we saw earlier, NeXT was purchased by Apple in early 1997. <strong>Mac</strong> <strong>OS</strong> X<br />

would be based on NeXT’s technology. WebObjects would keep up with advance-<br />

ments in its domain, as exemplified by its support for Web Services and Enterprise<br />

Java. Apple uses WebObjects for its own web sites, such as the Apple Developer<br />

Connection (ADC) site, the online Apple Store, and the .<strong>Mac</strong> <strong>of</strong>fering.<br />

Figure 1–28 shows a screenshot <strong>of</strong> OPENSTEP.


98 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

FIGURE 1–28 OPENSTEP<br />

1.8. THE MACH FACTOR<br />

Along with NeXT’s operating system came its kernel, which became the kernel<br />

foundation <strong>of</strong> Apple’s future systems. Let us now briefly discuss the origins and<br />

evolution <strong>of</strong> <strong>Mac</strong>h—a key component <strong>of</strong> the NEXTSTEP kernel, and in turn, <strong>of</strong> the<br />

<strong>Mac</strong> <strong>OS</strong> X kernel.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 99<br />

1.8.1. Rochester’s Intelligent Gateway<br />

A group <strong>of</strong> researchers at the University <strong>of</strong> Rochester, New York, began develop-<br />

ment <strong>of</strong> an “intelligent” gateway system named RIG (Rochester’s Intelligent Gate-<br />

way) in 1975. Jerry Feldman, who coined the name RIG, largely did the system’s<br />

initial design. RIG was meant to provide uniform access—say, via terminals—to a<br />

variety <strong>of</strong> local and remote computing facilities. Local facilities could be locally<br />

connected disks, magnetic tapes, printers, plotters, batch processing or time-sharing<br />

computers, and so on. Remote facilities could be available through a network such<br />

as the ARPANET. RIG’s operating system—called Aleph—ran on a Data General<br />

Eclipse minicomputer.<br />

The Aleph kernel was structured around an interprocess communication (IPC)<br />

facility. RIG processes could send messages to each other, with a port specifying<br />

the destination. A port was an in-kernel message queue that was globally identified<br />

by a dotted pair <strong>of</strong> integers: a process number and a port number. A process could<br />

have several ports defined within itself, each <strong>of</strong> which could be used to wait for a<br />

message to arrive on. A process X could shadow or interpose another process Y. In<br />

the case <strong>of</strong> shadowing, X received a copy <strong>of</strong> every message sent to Y. While inter-<br />

posing, X intercepted all messages sent to, or originating from Y. This IPC facility<br />

based on messages and ports was a basic building block <strong>of</strong> the operating system.<br />

RIG was killed a few years later due to several fundamental shortcomings in<br />

its design or in the underlying hardware, for example:<br />

• The lack <strong>of</strong> paged virtual memory<br />

• A 2KB limit on the size <strong>of</strong> a message due to the limited address space<br />

provided by the underlying hardware<br />

• Inefficient IPC due to limited message size<br />

• No protection for ports<br />

• No way to notify the failure <strong>of</strong> a process to a dependent process without<br />

explicit registration <strong>of</strong> such dependencies


100 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• Networking not an area <strong>of</strong> emphasis in the original design<br />

RIG port numbers were global, allowing any process to create or use them.<br />

Therefore, any process could send a message to any other process. However, RIG<br />

processes, which were single threaded, did have protected address spaces.<br />

1.8.2. Accent<br />

Richard Rashid was one <strong>of</strong> the people who worked on RIG. In 1979, Rashid moved<br />

to Carnegie Mellon University, where he would work on Accent, a network operat-<br />

ing system kernel. Active development <strong>of</strong> Accent began in April 1981. Like RIG,<br />

Accent was also a communication-oriented system that used IPC as the basic<br />

system-structuring tool, or “glue.” However, Accent addressed many <strong>of</strong> RIG’s<br />

shortcomings, for example:<br />

• Processes had large (4GB), sparse virtual address spaces that were linearly<br />

addressable.<br />

• There was flexible and powerful virtual memory management that was<br />

integrated with IPC and file storage. The kernel itself could be paged,<br />

although certain critical parts <strong>of</strong> the kernel, such as I/O memory and the<br />

virtual memory table, were “wired” in physical memory.<br />

• Copy-on-write (COW) memory mapping was used to facilitate large<br />

message transfers. Based on experience with RIG, it was expected that<br />

most messages would be simple. There were optimizations for the common<br />

case.<br />

• Ports had the semantics <strong>of</strong> capabilities.<br />

• Messages could be sent to processes on another machine through an intermediary<br />

process, thus providing location transparency.<br />

Memory-related API calls in Accent included functions for creating, destroying,<br />

reading, and writing memory segments, with support for copy-on-write. One may<br />

think <strong>of</strong> Accent as RIG enhanced with virtual memory and network-transparent<br />

messaging.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 101<br />

Accent was developed to support two distributed computing projects:<br />

SPICE (distributed personal computing) and DSN (fault-tolerant distributed<br />

sensor network). Accent was also the name <strong>of</strong> a food product (a spice) sold<br />

by Accent International, Inc. The only ingredient <strong>of</strong> this product was mono-<br />

sodium glutamate (MSG). In computing, one <strong>of</strong>ten abbreviates “message”<br />

as “msg”.<br />

Accent ran on PERQ computers, which were commercial graphics worksta-<br />

tions. Three Rivers Corporation delivered the first PERQ in 1980. QNIX was a<br />

UNIX environment based on AT&T System V UNIX that ran under Accent on<br />

PERQ machines. Developed by Spider <strong>Systems</strong>, QNIX used its own microcode, 52<br />

but ran in an Accent window managed by Accent’s Sapphire window manager, with<br />

other Accent programs running alongside. A LISP machine (SPICE LISP) was also<br />

available for Accent, along with other languages such as Ada, PERQ Pascal, C, and<br />

Fortran. PERQ could interpret bytecode in hardware, akin to latter-day mechanisms<br />

for Java.<br />

Within a few years, the future <strong>of</strong> Accent did not look promising as well. It<br />

needed a new hardware base, support for multiprocessors, and portability to other<br />

kinds <strong>of</strong> hardware. Accent also had difficulty supporting UNIX s<strong>of</strong>tware.<br />

Matchmaker<br />

The Matchmaker project was started in 1981 as part <strong>of</strong> the SPICE project.<br />

Matchmaker was an interface-specification language intended for use with existing<br />

programming languages. Using the Matchmaker language, object-oriented remote<br />

procedure call (RPC) interfaces could be specified. The specification would be con-<br />

verted into interface code by a multitarget compiler. Matchmaker is readily comparable<br />

to the rpcgen protocol compiler and its language. The <strong>Mac</strong>h Interface Generator (MIG)<br />

program, which is also used in <strong>Mac</strong> <strong>OS</strong> X, was derived from Matchmaker.<br />

52 The PERQ had s<strong>of</strong>t-microcode, allowing its instruction set to be extended.


102 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.8.3. <strong>Mac</strong>h<br />

The sequel to Accent was called <strong>Mac</strong>h, which was conceived as a UNIX-compatible<br />

Accent-inspired system. In retrospect, with respect to the first version (1.0) <strong>of</strong><br />

<strong>Mac</strong>h, one could consider Accent and RIG to be <strong>Mac</strong>h versions 0.9 and 0.8 respec-<br />

tively.<br />

When <strong>Mac</strong>h was developed, UNIX had been around for over fifteen years.<br />

Although the designers <strong>of</strong> <strong>Mac</strong>h subscribed to the importance and usefulness <strong>of</strong><br />

UNIX, they noted that UNIX was no longer as simple or as easy to modify as it<br />

once had been. Richard Rashid called the UNIX kernel a “dumping ground for vir-<br />

tually every new feature or facility.” <strong>Mac</strong>h’s design goals were partially a response<br />

to the inexorably increasing complexity <strong>of</strong> UNIX.<br />

The <strong>Mac</strong>h project started in 1984 with an overall goal <strong>of</strong> creating a microker-<br />

nel that would be the operating system foundation for other operating systems. The<br />

project’s specific goals included the following.<br />

• Provide full support for multiprocessing.<br />

• Exploit other features <strong>of</strong> modern hardware architectures that were emerging<br />

at that time. <strong>Mac</strong>h aimed to support diverse architectures, including<br />

shared memory access schemes such as Non-Uniform Memory Access<br />

(NUMA) and No-Remote Memory Access (NORMA).<br />

• Support transparent and seamless distributed operation.<br />

• Reduce the number <strong>of</strong> features in the kernel to make it less complex,<br />

while giving the programmer a very small number <strong>of</strong> abstractions to<br />

work with. Nevertheless, the abstractions would be general enough to<br />

allow several operating systems to be implemented on top <strong>of</strong> <strong>Mac</strong>h.<br />

• Provide compatibility with UNIX.<br />

• Address shortcomings <strong>of</strong> previous systems such as Accent.<br />

<strong>Mac</strong>h was intended to primarily implement processor and memory manage-<br />

ment, but no file system, networking, or I/O. The “real” operating system was to run


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 103<br />

as a user-level <strong>Mac</strong>h task. Written in C, the <strong>Mac</strong>h kernel was also meant to be<br />

highly portable.<br />

<strong>Mac</strong>h’s implementation used 4.3BSD as the starting code base. Its designers<br />

had RIG and Accent as references in the area <strong>of</strong> message-passing kernels. DEC’s<br />

TOPS-20 operating system 53 provided some ideas for <strong>Mac</strong>h’s virtual memory sub-<br />

system. As <strong>Mac</strong>h evolved, portions <strong>of</strong> the BSD kernel were replaced by their <strong>Mac</strong>h<br />

equivalents, and various new components were added.<br />

When published in 1986, the original <strong>Mac</strong>h paper hailed <strong>Mac</strong>h as “A New<br />

Kernel Foundation For UNIX Development.” While not everybody saw or sees it<br />

that way, <strong>Mac</strong>h went on to become a rather popular system. From Apple’s stand-<br />

point, the paper’s title might as well have been “A NuKernel Foundation...”<br />

Nomenclature<br />

Avadis Tevanian, one <strong>of</strong> the inventors <strong>of</strong> <strong>Mac</strong>h and Apple’s Chief S<strong>of</strong>tware Tech-<br />

nology Officer, told me the following history about how <strong>Mac</strong>h was named. (Tevanian<br />

qualified the account as his best memory <strong>of</strong> an event that occurred two decades ago.)<br />

On a rainy day in Pittsburgh, Tevanian and some others were on their daily trek to<br />

lunch. As they were thinking <strong>of</strong> names for the yet unnamed <strong>Mac</strong>h kernel, Tevanian,<br />

navigating around one <strong>of</strong> the numerous mud puddles, suggested the name “MUCK” in<br />

jest. MUCK was to stand for “Multi-User Communication Kernel” or “Multiprocessor<br />

Universal Communication Kernel.” As a joke, Richard Rashid passed the name along<br />

to a colleague, Dario Giuse, who was Italian. Guise inadvertently pronounced MUCK<br />

as “<strong>Mac</strong>h,” and Rashid liked it so much that the name stuck.<br />

Initially the <strong>Mac</strong>h designers presented four basic abstractions in the kernel.<br />

53 TOPS-20 was a descendant <strong>of</strong> the TENEX operating system.


104 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

A task is a container for the resources <strong>of</strong> one or more threads. 54 Examples <strong>of</strong><br />

resources include virtual memory, ports, processors, and so on.<br />

A thread is a basic unit <strong>of</strong> execution in a task. The task provides an execution<br />

environment for its threads, whereas the threads actually run. The various threads <strong>of</strong><br />

a task share its resources, although each has its own execution state, which includes<br />

the program counter and various other registers. Thus, unlike a process in Accent, a<br />

<strong>Mac</strong>h “process” is divided 55 into a task and multiple threads.<br />

A port is similar to an Accent port—it is an in-kernel message queue with ca-<br />

pabilities. Ports form the basis for <strong>Mac</strong>h’s interprocess communication facilities.<br />

<strong>Mac</strong>h implements ports as simple integral values.<br />

A message is a collection <strong>of</strong> data that threads in different tasks, or in the same<br />

task, can send to each other using ports.<br />

Another basic <strong>Mac</strong>h abstraction is that <strong>of</strong> a memory object, which could be<br />

thought <strong>of</strong> as a container for data (including file data) mapped into a task’s address<br />

space. <strong>Mac</strong>h requires a paged memory-management unit (PMMU). Through its<br />

pmap (physical map) layer, <strong>Mac</strong>h provides an excellent interface to the machine-<br />

dependent MMU facilities. <strong>Mac</strong>h’s virtual memory subsystem was designed to sup-<br />

port large, sparse virtual address spaces, and was integrated with IPC. In traditional<br />

UNIX, contiguous virtual memory space was implied, with the heap and the stack<br />

growing towards each other. In contrast, <strong>Mac</strong>h allowed for sparse address spaces.<br />

Regions <strong>of</strong> memory could be allocated from anywhere in the address space. Mem-<br />

ory could be shared for reading and writing in a structured manner. Copy-on-write<br />

techniques were used both to optimize copy operations and for sharing physical<br />

memory between tasks. The generalized memory object abstraction allowed for ex-<br />

54 It is possible to have a <strong>Mac</strong>h task with zero threads, although such a task would not be very useful.<br />

55 Certain subsequent versions <strong>of</strong> <strong>Mac</strong>h further subdivided a thread into an “activation” and a “shut-<br />

tle.”


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 105<br />

ternal 56 memory pagers to handle page faults and page-out data requests. The source<br />

or target data could even reside on another machine.<br />

FreeBSD’s virtual memory architecture is based on <strong>Mac</strong>h’s.<br />

As noted earlier, <strong>Mac</strong>h was neither meant to provide, nor provided, any file<br />

system, networking, or I/O capabilities. It was to be used as a service operating sys-<br />

tem to create other operating systems from. It was hoped that this approach would<br />

maintain simplicity and promote portability <strong>of</strong> operating systems. One or more op-<br />

erating systems could run on top <strong>of</strong> <strong>Mac</strong>h as user-level tasks. However, real-life<br />

implementations deviated from this concept. Release 2.0 <strong>of</strong> <strong>Mac</strong>h, as well as the<br />

rather successful Release 2.5, had monolithic implementations in that <strong>Mac</strong>h and<br />

BSD resided in the same address space.<br />

One <strong>of</strong> CMU’s important decisions was to provide all <strong>Mac</strong>h s<strong>of</strong>tware with un-<br />

restrictive licensing—free <strong>of</strong> distribution fees or royalties. The Open S<strong>of</strong>tware<br />

Foundation 57 (<strong>OS</strong>F) used Release 2.5 <strong>of</strong> <strong>Mac</strong>h for providing many <strong>of</strong> the kernel<br />

services in the <strong>OS</strong>F/1 operating system. <strong>Mac</strong>h 2.x was also used in Mt. Xinu,<br />

Multimax (Encore), Omron LUNA/88k, NEXTSTEP, and OPENSTEP.<br />

The <strong>Mac</strong>h 3 project was started at CMU and continued by <strong>OS</strong>F. <strong>Mac</strong>h 3 was<br />

the first true microkernel version—BSD ran as a user-space <strong>Mac</strong>h task, with only<br />

fundamental features being provided by the <strong>Mac</strong>h kernel. Other changes and im-<br />

provements in <strong>Mac</strong>h 3 included the following.<br />

• Kernel preemption and a real-time scheduling framework to provide realtime<br />

support<br />

56 Implies external to the kernel—that is, in user-space<br />

57 The <strong>OS</strong>F was formed in May 1988 to develop core s<strong>of</strong>tware technologies and supply them to the<br />

entire industry on fair and reasonable terms. It went on to have several hundred members from among<br />

commercial end users, s<strong>of</strong>tware companies, computer manufacturers, universities, research laboratories,<br />

and so on. The <strong>OS</strong>F later became the Open Group, and then became Silicomp.


106 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• Low-level device support wherein devices were presented as ports to<br />

which data or control messages could be sent, with support for both synchronous<br />

and asynchronous I/O<br />

• A completely rewritten IPC implementation<br />

• System call redirection that allowed a set <strong>of</strong> system calls to be handled<br />

by user-space code running within the calling task<br />

• Use <strong>of</strong> continuations, a kernel facility that gives a thread the option to<br />

block by specifying a function (the continuation function) that is called<br />

when the thread runs again<br />

Historically, arguments in favor <strong>of</strong> “true” microkernels have emphasized a<br />

greater degree <strong>of</strong> system structure and modularity, improved s<strong>of</strong>tware engineering,<br />

ease <strong>of</strong> debugging, robustness, s<strong>of</strong>tware malleability (for example, the ability to run<br />

multiple operating system personalities), and so on. The intended benefits <strong>of</strong><br />

microkernel-based operating systems such as <strong>Mac</strong>h 3 were <strong>of</strong>fset by the significant<br />

real-life performance problems that occurred due to reasons such as the following.<br />

• The cost <strong>of</strong> maintaining separate protection domains, including the cost<br />

<strong>of</strong> context switching from one domain to another (<strong>of</strong>ten, simple operations<br />

resulted in many s<strong>of</strong>tware or hardware layers to be crossed)<br />

• The cost <strong>of</strong> kernel entry and exit code<br />

• Data copies in MIG-generated stub routines<br />

• The use <strong>of</strong> semantically powerful, but implementation-heavy IPC<br />

mechanisms, even for same-machine RPC<br />

Many operating systems were ported to the conceptual virtual machine pro-<br />

vided by the <strong>Mac</strong>h API, and several user-mode operating system interfaces were<br />

demonstrated to execute on top <strong>of</strong> <strong>Mac</strong>h. The <strong>Mac</strong>h-US symmetric multiserver op-<br />

erating system contained a set <strong>of</strong> server processes that provided generic system<br />

services such as local interprocess communication; networking; and management <strong>of</strong><br />

devices, files, processes, and terminals. Each server typically ran in a separate <strong>Mac</strong>h<br />

task. An emulation library, which was loaded into each user process, provided an<br />

operating system personality. Such libraries used generic services to emulate differ-<br />

ent operating systems by intercepting system calls and redirecting them to the ap-


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 107<br />

propriate handlers. <strong>Mac</strong>h emulators existed for BSD, D<strong>OS</strong>, HP-UX, <strong>OS</strong>/2, <strong>OS</strong>F/1,<br />

SVR4, VMS, and even the <strong>Mac</strong>intosh operating system.<br />

Richard Rashid went on to become the head <strong>of</strong> Micros<strong>of</strong>t Research. <strong>Mac</strong>h<br />

coinventor Avie Tevanian would be the Chief S<strong>of</strong>tware Technology Officer at<br />

Apple.<br />

1.8.4. MkLinux<br />

Apple and <strong>OS</strong>F began a project to port Linux to run on various Power <strong>Mac</strong>intosh<br />

platforms, with Linux hosted on top <strong>of</strong> <strong>OS</strong>F’s <strong>Mac</strong>h implementation. The project<br />

led to a core system called osfmk. The overall system was known as MkLinux. The<br />

first version <strong>of</strong> MkLinux was based on Linux 1.3. It was released as MkLinux DR1<br />

in early 1996. Subsequent releases moved to Linux 2.0 and beyond. One <strong>of</strong> the re-<br />

leases was incorporated into Apple’s Reference Release.<br />

MkLinux used a single server approach: the monolithic Linux kernel ran as a<br />

single <strong>Mac</strong>h task. <strong>Mac</strong> <strong>OS</strong> X uses a kernel base derived from osfmk, and includes<br />

many MkLinux enhancements. However, all kernel components in <strong>Mac</strong> <strong>OS</strong> X, in-<br />

cluding the BSD portions, reside in the same address space.<br />

<strong>Mac</strong>h Ten<br />

Besides A/UX, there was another avenue—a third party one—on which the <strong>Mac</strong>-<br />

intosh had close encounters <strong>of</strong> the Unix kind. The <strong>Mac</strong>h Ten product from Tenon Sys-<br />

tems was introduced as an unobtrusive Unix solution for <strong>Mac</strong><strong>OS</strong>: it ran as an applica-<br />

tion atop Apple’s operating system. In contrast, A/UX ran directly on top <strong>of</strong> hardware.<br />

<strong>Mac</strong>h Ten was based on the <strong>Mac</strong>h kernel with a BSD environment. It provided<br />

preemptive multitasking for Unix applications running within it, although the <strong>Mac</strong><strong>OS</strong><br />

execution environment remained cooperative multitasking.


108 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Although the marriage <strong>of</strong> <strong>Mac</strong>h, BSD, and <strong>Mac</strong>intosh in <strong>Mac</strong>h Ten sounds similar<br />

to the latter-day <strong>Mac</strong> <strong>OS</strong> X, there is a critical difference in design and philosophy. <strong>Mac</strong><br />

<strong>OS</strong> X was a continuation <strong>of</strong> NEXTSTEP technology in several ways. Apple provided<br />

legacy compatibility and ease <strong>of</strong> transition at two primary levels: through APIs such as<br />

Carbon, and through the Classic virtualizer. In contrast, <strong>Mac</strong>h Ten was a logical opposite:<br />

<strong>Mac</strong><strong>OS</strong> remained the first class citizen, whereas Unix ran in a virtual machine (UVM)<br />

that was implemented within a standard <strong>Mac</strong>intosh application. The UVM provided a<br />

preemptive multitasking execution environment with a set <strong>of</strong> Unix APIs (such as PO-<br />

SIX, including the standard C library and P<strong>OS</strong>IX threads), a BSD-style networking<br />

stack, file systems such as UFS and FFS, RPC, NFS, and so on. <strong>Mac</strong>h Ten also in-<br />

cluded an implementation <strong>of</strong> the X Window System.<br />

Although confined within a single application, <strong>Mac</strong>h Ten consisted <strong>of</strong> various sub-<br />

systems similar to a full-fledged operating system. At the logically lowest level, an inter-<br />

face layer talked to <strong>Mac</strong><strong>OS</strong>. The <strong>Mac</strong>h kernel resided above this layer, providing serv-<br />

ices such as memory management, interprocess communication, tasks, and threads.<br />

Other <strong>Mac</strong>h Ten subsystems that directly talked to the <strong>Mac</strong><strong>OS</strong> interface layer included<br />

the window manager and the networking stack’s ARP layer.<br />

1.8.5. Musical Names<br />

Apple’s operating system strategy after acquiring NeXT was two-pronged: it would<br />

keep improving <strong>Mac</strong> <strong>OS</strong> for the consumer desktop market, and would create a high-<br />

end operating system based on NeXT technology. The new system, called Rhap-<br />

sody, would mainly be targeted towards the server and enterprise markets.<br />

In contrast to the chromatic aberrations such as Pink and Red, Apple also had<br />

a string <strong>of</strong> musically inspired code names for its operating system projects. Copland


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 109<br />

and Gershwin were named after Aaron Copland and George Gershwin, 58 both<br />

American composers. Rhapsody in Blue is a famous work <strong>of</strong> Gershwin.<br />

1.9. STRATEGIES<br />

The first release <strong>of</strong> an Apple operating system after NeXT’s purchase was in late<br />

1996 with version 7.6. This release represented the initial stage <strong>of</strong> Apple’s new op-<br />

erating system roadmap. It was the first system to be called <strong>Mac</strong> <strong>OS</strong>. Apple’s plan<br />

was to release full standalone installations once a year, with updates in between.<br />

Many Power <strong>Mac</strong>intosh and PowerBook models that were not supported by <strong>Mac</strong><br />

<strong>OS</strong> 7.6 were supported by the 7.6.1 incremental update. The system originally<br />

slated to be version 7.7 would eventually become <strong>Mac</strong> <strong>OS</strong> 8.<br />

<strong>Mac</strong> <strong>OS</strong> 7.6 required a compatible computer that was 32-bit clean, with at<br />

least a 68030 processor. It <strong>of</strong>fered performance enhancements in several areas such<br />

as virtual memory, memory management, PowerPC Resource Manager routines,<br />

system startup, and the File Manager’s caching scheme. It also integrated key Apple<br />

technologies such as Cyberdog, OpenDoc, Open Transport, and QuickTime.<br />

Two phenomena were sweeping the computer world at that time: the Internet<br />

and Micros<strong>of</strong>t Windows 95. Apple emphasized compatibility <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> 7.6 with<br />

Windows 95 and highlighted the system’s Internet prowess. <strong>Mac</strong> <strong>OS</strong> 7.6 included<br />

built-in support for TCP/IP, PPP, and Apple Remote Access (ARA). Its integrated<br />

Cyberdog technology could be used to incorporate Internet features into documents<br />

that used “Live Objects.” For example, live web links and email addresses could<br />

reside on the Desktop, and could be activated from the Finder.<br />

58 George Gershwin’s brother Ira actually came up with the title Rhapsody in Blue.


110 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

OpenDoc<br />

OpenDoc was a cross-platform component s<strong>of</strong>tware architecture for <strong>Mac</strong> <strong>OS</strong>,<br />

<strong>OS</strong>/2, Windows, and UNIX. It started as collaboration between several companies,<br />

including Apple, IBM, and WordPerfect. An independent association called Component<br />

Integration Laboratories (CI Labs) was founded to act as a forum for the “open” evolu-<br />

tion <strong>of</strong> OpenDoc.<br />

OpenDoc was implemented as a set <strong>of</strong> shared libraries that allowed construction<br />

and sharing <strong>of</strong> compound documents. An OpenDoc document was composed <strong>of</strong> build-<br />

ing blocks <strong>of</strong> content called components, which could be interactively edited. A compo-<br />

nent was a relatively small s<strong>of</strong>tware unit containing a well-defined focused functionality.<br />

OpenDoc aimed to replace large, monolithic applications with applications constructed<br />

by mixing and matching various components. Examples <strong>of</strong> OpenDoc component types<br />

include graphics, Internet, spreadsheet, text, and video components. OpenDoc’s im-<br />

plementation <strong>of</strong> such functionality, which was identified as hitherto being redundant<br />

across complex applications, yielded reusable building blocks that could be embedded<br />

into OpenDoc-aware documents. A document could have features such as editable<br />

portions, live data feed from an Internet source, user-interface elements that linked one<br />

part <strong>of</strong> the document to another, and hot areas where objects could be dragged and<br />

dropped.<br />

OpenDoc was supported by several key technologies: Document Level Services,<br />

Component Level Services, Open Scripting Architecture 59 (<strong>OS</strong>A), System Object Model<br />

(SOM), and Open Linking and Embedding <strong>of</strong> Objects (interoperable with Micros<strong>of</strong>t’s<br />

OLE).<br />

The OLE-inspired COM and DCOM were OpenDoc’s competitors. Whereas<br />

OpenDoc failed, COM is heavily used by modern versions <strong>of</strong> Micros<strong>of</strong>t Windows.<br />

59 <strong>OS</strong>A is an automation and scripting API that also exists in <strong>Mac</strong> <strong>OS</strong> X. It supports applicationindependent<br />

scripting, allowing multiple scripting systems and languages to coexist. AppleScript is the<br />

primary language that supports <strong>OS</strong>A.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 111<br />

1.9.1. <strong>Mac</strong> <strong>OS</strong> 8 and 9<br />

As we saw earlier, Copland and Pink were potential candidates for <strong>Mac</strong> <strong>OS</strong> 8 at one<br />

time or another. Similarly, Gershwin was a candidate for <strong>Mac</strong> <strong>OS</strong> 9. Over the years,<br />

some important features that were either created or improved for Copland were<br />

added to <strong>Mac</strong> <strong>OS</strong> 8 and 9, as was originally intended. The following are examples<br />

<strong>of</strong> such features.<br />

• A search engine that could search on local drives, network servers, and<br />

the Internet (released as Sherlock)<br />

• The Copland API, which gradually evolved into Carbon<br />

• The Platinum-look user interface<br />

• Multiple users, with support for per-user preferences<br />

<strong>Mac</strong> <strong>OS</strong> 8 had a multithreaded Finder that allowed several file-oriented opera-<br />

tions simultaneously. Other notable features included the following.<br />

• The <strong>Mac</strong> <strong>OS</strong> Extended file system (HFS Plus), which was introduced<br />

with <strong>Mac</strong> <strong>OS</strong> 8.1<br />

• Contextual menus activated by a control-click<br />

• Spring-loaded folders 60<br />

• Personal web hosting<br />

• Web browsers (Micros<strong>of</strong>t Internet Explorer and Netscape Navigator)<br />

bundled with the system<br />

• <strong>Mac</strong>intosh Runtime for Java (MRJ—Apple’s implementation <strong>of</strong> the Java<br />

environment) part <strong>of</strong> the system<br />

• Enhancements to power-management, USB, and FireWire<br />

Figure 1–29 shows a screenshot <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> 8.<br />

60 Spring-loaded folders are a feature <strong>of</strong> the Finder’s user interface. If the user pauses briefly while<br />

dragging an item onto a folder icon, a window springs open displaying the folder’s contents. This allows<br />

the user to choose where to put the item. Continuing to hold the item causes a subfolder to spring<br />

open, and so on.


112 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

FIGURE 1–29 <strong>Mac</strong> <strong>OS</strong> 8<br />

<strong>Mac</strong> <strong>OS</strong> 8.5 was PowerPC-only. The nanokernel was overhauled in <strong>Mac</strong> <strong>OS</strong><br />

8.6 to integrate multitasking and multiprocessing. It included a preemption-safe<br />

memory allocator. The multiprocessor (MP) API library could now run with virtual<br />

memory enabled, although virtual memory was still optional.<br />

When <strong>Mac</strong> <strong>OS</strong> 9 was released in 1999, it was hailed by Apple as the “best<br />

Internet operating system ever”. It was the first <strong>Mac</strong> <strong>OS</strong> version that could be up-<br />

dated over the Internet. It could also use the AppleTalk protocol over TCP/IP. Its<br />

useful security features included file encryption and the Keychain mechanism for<br />

storing passwords securely.<br />

An important component <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> 9 was a mature installation <strong>of</strong> the Carbon<br />

APIs, which at the time represented about 70% <strong>of</strong> the legacy <strong>Mac</strong> <strong>OS</strong> APIs. Carbon<br />

provided compatibility with <strong>Mac</strong> <strong>OS</strong> 8.1 and later.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 113<br />

The last release <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> 9 was released in late 2001 as version 9.2.2. With<br />

the advent <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X, this “old” <strong>Mac</strong> <strong>OS</strong> would eventually be referred to as<br />

Classic. Figure 1–30 shows a screenshot <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> 9.<br />

FIGURE 1–30 <strong>Mac</strong> <strong>OS</strong> 9<br />

1.9.2. Rhapsody<br />

We saw that after acquiring NeXT, Apple based its next-generation operating sys-<br />

tem called Rhapsody on NeXT’s OPENSTEP. Rhapsody was first demonstrated at<br />

the 1997 World Wide Developers Conference (WWDC). Figure 1–31 shows a<br />

screenshot <strong>of</strong> Rhapsody.


114 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

FIGURE 1–31 Rhapsody<br />

Rhapsody consisted <strong>of</strong> the following primary components.<br />

• The kernel and related subsystems that were based on <strong>Mac</strong>h and BSD<br />

• A <strong>Mac</strong> <strong>OS</strong> compatibility subsystem (the Blue Box)<br />

• An extended OpenStep API implementation (the Yellow Box)<br />

• A Java virtual machine<br />

• A Display PostScript-based windowing system<br />

• A user interface that was <strong>Mac</strong> <strong>OS</strong>-like, but also had features from<br />

OPENSTEP


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 115<br />

Apple had plans to port to Rhapsody most key <strong>Mac</strong> <strong>OS</strong> frameworks, for ex-<br />

ample, QuickTime, QuickDraw 3D, QuickDraw GX, and ColorSync. Rhapsody<br />

was also to support numerous file systems such as Apple Filing Protocol (AFP),<br />

FAT, HFS, HFS Plus, ISO9660, and UFS.<br />

There were two developer releases <strong>of</strong> Rhapsody, dubbed DR1 and DR2. These<br />

were released both for the PowerPC and the x86 platforms.<br />

1.9.2.1. Blue Box<br />

Shortly after Rhapsody DR1 was released, Apple extended the PowerPC version<br />

with a <strong>Mac</strong> <strong>OS</strong> compatibility environment called the Blue Box. Implemented by a<br />

Rhapsody application (<strong>Mac</strong><strong>OS</strong>.app), Blue Box was a virtual environment that ap-<br />

peared as a new <strong>Mac</strong>intosh hardware model. <strong>Mac</strong><strong>OS</strong>.app loaded a <strong>Mac</strong>intosh ROM<br />

file from disk and created an environment within which <strong>Mac</strong> <strong>OS</strong> ran mostly un-<br />

changed. Blue Box initially ran <strong>Mac</strong> <strong>OS</strong> 8.x, full-screen, with the ability to switch<br />

between Rhapsody and <strong>Mac</strong> <strong>OS</strong> using the key combination. It<br />

placed certain restrictions on the applications that ran within it. For example, an<br />

application could neither access the hardware directly, nor could use undocumented<br />

<strong>Mac</strong> <strong>OS</strong> APIs. The implementers’ initial goal was to achieve 90% to 115% <strong>of</strong> native<br />

<strong>Mac</strong> <strong>OS</strong> performance. Blue Box beta 1.0 used Open Transport—rather than BSD<br />

sockets—for networking. Support for newer versions <strong>of</strong> <strong>Mac</strong> <strong>OS</strong>, as well as for<br />

running the Blue Box windowed, was added later. The Blue Box environment<br />

would be known as the Classic environment in <strong>Mac</strong> <strong>OS</strong> X, provided by an applica-<br />

tion named “Classic Startup.app”. 61<br />

The Blue Box environment is a virtualization layer, and not an emulation<br />

layer. “Harmless” instructions execute natively on the processor, whereas<br />

“harmful” instructions, such as those that can affect the hardware, are<br />

trapped and handled appropriately.<br />

61 The application was called Classic.app in earlier versions <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X.


116 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.9.2.2. Yellow Box<br />

Rhapsody’s development platform was called the Yellow Box. Besides being hosted<br />

on the Power <strong>Mac</strong>intosh and x86 versions <strong>of</strong> Rhapsody, it was also available inde-<br />

pendently for Micros<strong>of</strong>t Windows. Figure 1–32 shows a screenshot <strong>of</strong> Yellow Box<br />

running under Windows XP.<br />

FIGURE 1–32 Yellow Box<br />

Yellow Box included most <strong>of</strong> OPENSTEP’s integrated frameworks, which<br />

were implemented as shared object libraries. These were augmented by a runtime<br />

and development environment. There were three core object frameworks whose<br />

APIs were available in Objective-C and Java.<br />

• Foundation was a collection <strong>of</strong> base classes with APIs for allocating,<br />

deallocating, examining, storing, notifying, and distributing objects.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 117<br />

• Application Kit was a set <strong>of</strong> APIs for creating user interfaces; managing<br />

and processing events; and using services such as color and font management,<br />

printing, cut-and-paste, and text-manipulation.<br />

• Display PostScript was a set <strong>of</strong> APIs for drawing in PostScript, compositing<br />

images, and performing other visual operations. It could be considered<br />

as a subset <strong>of</strong> Application Kit.<br />

Yellow Box included NeXT’s Project Builder integrated development envi-<br />

ronment and the Interface Builder visual tool for creating graphical user-interfaces.<br />

The Windows NT implementation <strong>of</strong> Yellow Box provided a very similar environ-<br />

ment through a combination <strong>of</strong> the following Apple provided Windows system serv-<br />

ices and applications:<br />

• The <strong>Mac</strong>h Emulation Daemon (the machd service)<br />

• The Netname Server (the nmserver service)<br />

• The Window Server (the WindowServer application)<br />

• The Pasteboard Server (the pbs application)<br />

Earlier implementations <strong>of</strong> the OpenStep API for platforms such as Solaris<br />

used a similar architecture. Yellow Box evolved into the <strong>Mac</strong> <strong>OS</strong> X Cocoa APIs.<br />

1.10. TOWARDS MAC <strong>OS</strong> X<br />

After Rhapsody’s DR2 release, Apple would still alter its operating system strategy,<br />

but would finally be on its way towards achieving its goal <strong>of</strong> having a new system.<br />

During the 1998 Worldwide Developer Conference, Adobe’s Photoshop ran on what<br />

would be <strong>Mac</strong> <strong>OS</strong> X. However, the first shipping release <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X would take<br />

another three years. Figure 1–33 shows an approximation <strong>of</strong> the progression from<br />

Rhapsody towards <strong>Mac</strong> <strong>OS</strong> X.


118 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

FreeBSD<br />

NetBSD<br />

<strong>Mac</strong>h 3.0<br />

OPENSTEP 4.4BSD<br />

<strong>Mac</strong> <strong>OS</strong> X Server 1.0<br />

March 1999<br />

1.0-1<br />

1.0-2<br />

1.2<br />

1.2v3<br />

<strong>Mac</strong> <strong>OS</strong> X Server 10.0.3<br />

May 21, 2001<br />

<strong>Mac</strong> <strong>OS</strong> X Server 10.x.y<br />

.<br />

.<br />

.<br />

Rhapsody DR1<br />

September 1997<br />

Rhapsody DR2<br />

May 1998<br />

<strong>Mac</strong> <strong>OS</strong> X DP1<br />

May 1999<br />

<strong>Mac</strong> <strong>OS</strong> X DP2<br />

November 1999<br />

<strong>Mac</strong> <strong>OS</strong> X DP3<br />

January 2000<br />

<strong>Mac</strong> <strong>OS</strong> X DP4<br />

May 2000<br />

<strong>Mac</strong> <strong>OS</strong> X Public Beta<br />

September 13, 2000<br />

<strong>Mac</strong> <strong>OS</strong> X 10.0<br />

March 24, 2001<br />

<strong>Mac</strong> <strong>OS</strong> X 10.x.y<br />

FIGURE 1–33 An approximation <strong>of</strong> the <strong>Mac</strong> <strong>OS</strong> X timeline<br />

.<br />

.<br />

.<br />

Blue Box<br />

October 1997<br />

Darwin 0.1<br />

March 1999<br />

.<br />

.<br />

.<br />

<strong>Mac</strong> <strong>OS</strong><br />

GNU Darwin<br />

OpenDarwin.org


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 119<br />

1.10.1. <strong>Mac</strong> <strong>OS</strong> X Server 1.x<br />

As people were expecting a DR3 release <strong>of</strong> Rhapsody, Apple announced <strong>Mac</strong> <strong>OS</strong> X<br />

Server 1.0 in March 1999. Essentially an improved version <strong>of</strong> Rhapsody, it was<br />

bundled with WebObjects, the QuickTime streaming server, a collection <strong>of</strong> devel-<br />

oper tools, the Apache web server, and facilities for booting or administering over<br />

the network.<br />

Apple also announced an initiative called Darwin: a fork <strong>of</strong> Rhapsody’s de-<br />

veloper release. Darwin would become the open-source core <strong>of</strong> Apple’s systems.<br />

Over the next three years, as updates would be released for the server product,<br />

development <strong>of</strong> the desktop version would continue, with the server sharing many<br />

<strong>of</strong> the desktop improvements.<br />

1.10.2. <strong>Mac</strong> <strong>OS</strong> X Developer Previews<br />

There were four Developer Preview releases <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X: named DP1 through<br />

DP4. Substantial improvements were made during these “DP” releases.<br />

1.10.2.1. DP1<br />

An implementation <strong>of</strong> the Carbon API was added in DP1. Carbon represented an<br />

overhaul <strong>of</strong> the “classic” <strong>Mac</strong> <strong>OS</strong> APIs, which were pruned, extended, and modified<br />

to run in the more modern <strong>Mac</strong> <strong>OS</strong> X environment. Carbon was also meant to help<br />

<strong>Mac</strong> <strong>OS</strong> developers in transitioning to <strong>Mac</strong> <strong>OS</strong> X. A Classic application would re-<br />

quire an installation <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> 9 to run under <strong>Mac</strong> <strong>OS</strong> X, whereas Carbon applica-<br />

tions could be compiled to run as native applications under both <strong>Mac</strong> <strong>OS</strong> 9 and <strong>Mac</strong><br />

<strong>OS</strong> X.


120 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

1.10.2.2. DP2<br />

The Yellow Box evolved into Cocoa, originally alluding to the fact that besides<br />

Objective-C, the API would be available in Java. A version <strong>of</strong> the Java Develop-<br />

ment Kit (JDK) was included, along with a just-in-time (JIT) compiler. The Blue<br />

Box environment was provided via Classic.app (a new version <strong>of</strong> <strong>Mac</strong><strong>OS</strong>.app)<br />

that ran as a process called TruBlueEnvironment. The Unix environment was<br />

based on 4.4BSD. DP2 thus contained a multitude <strong>of</strong> APIs: BSD, Carbon, Classic,<br />

Cocoa, and Java. There was widespread dissatisfaction with the existing user inter-<br />

face. The Aqua user interface had not been introduced yet, although there were ru-<br />

mors that Apple was keeping the “real” user interface a secret. 62<br />

Carbon is sometimes perceived as “the old” API. Although Carbon indeed<br />

contains modernized versions <strong>of</strong> many old APIs, it also provides functional-<br />

ity that may not be available through other APIs. Parts <strong>of</strong> Carbon are com-<br />

plementary to “new” APIs such as Cocoa. Nevertheless, Apple has been<br />

adding more functionality to Cocoa so that dependencies on Carbon can be<br />

eventually eliminated. For example, much <strong>of</strong> the QuickTime functionality<br />

was only available through Carbon in <strong>Mac</strong> <strong>OS</strong> X versions prior to 10.4. Ap-<br />

ple introduced the QTKit framework for Cocoa in <strong>Mac</strong> <strong>OS</strong> X 10.4, which<br />

reduces or eliminates Carbon dependencies for QuickTime.<br />

1.10.2.3. DP3<br />

The Aqua user interface was first demonstrated during the San Francisco <strong>Mac</strong>world<br />

Expo in January 2000. <strong>Mac</strong> <strong>OS</strong> X DP3 included Aqua along with its distinctive<br />

elements: “water-like” elements, pinstripes, pulsating default buttons, “traffic-light”<br />

window buttons, drop shadows, transparency, animations, sheets, and so on. The<br />

62 Apple had referred to the <strong>Mac</strong> <strong>OS</strong> X user interface as “Advanced <strong>Mac</strong> <strong>OS</strong> Look and Feel”.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 121<br />

DP3 Finder was Aqua-based as well. The Dock was introduced with support for<br />

photorealistic icons that were dynamically scalable up to 128×128 pixels.<br />

1.10.2.4. DP4<br />

The Finder was renamed the Desktop in DP4. The System Preferences application<br />

(Preferences.app—the precursor to “System Preferences.app”) made its<br />

first appearance in <strong>Mac</strong> <strong>OS</strong> X, allowing the user to view and set a multitude <strong>of</strong> sys-<br />

tem preferences such as Classic, ColorSync, Date & Time, Energy Saver, Internet,<br />

Keyboard, Login Items, Monitors, Mouse, Network, Password, and others. Prior to<br />

DP4, the Finder and the Dock were implemented within the same application. The<br />

Dock was an independent application (Dock.app) in DP4. It was divided into two<br />

sections: the left side for applications and the right side for the trash can, files, fold-<br />

ers, and minimized windows. Other notable components <strong>of</strong> DP4 included an inte-<br />

grated development environment and OpenGL.<br />

The Dock’s visual indication <strong>of</strong> a running application underwent several changes.<br />

In DP3, an application’s Dock icon had a few pixels high bottom edge that was color-<br />

coded to indicate whether the application was running. This was replaced by an ellipsis<br />

in DP4, and was followed by a triangle in subsequent <strong>Mac</strong> <strong>OS</strong> X versions. DP4 also<br />

introduced the smoke cloud animation that ensues after an item is dragged <strong>of</strong>f the<br />

Dock.<br />

1.10.3. <strong>Mac</strong> <strong>OS</strong> X Public Beta<br />

Apple released a beta version <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X at the Apple Expo in Paris on Septem-<br />

ber 13, 2000. Essentially a publicly available preview release for evaluation and<br />

development purposes, the “<strong>Mac</strong> <strong>OS</strong> X Public Beta” was sold for $29.95 at the Ap-<br />

ple Store. It was available in English, French, and German. The s<strong>of</strong>tware’s packag-<br />

ing contained a message from Apple to the beta testers: “You are holding the future


122 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

<strong>of</strong> the <strong>Mac</strong>intosh in your hands.” Apple also created a <strong>Mac</strong> <strong>OS</strong> X tab on its web site<br />

that would contain information on <strong>Mac</strong> <strong>OS</strong> X, including updates on third-party ap-<br />

plications, tips and tricks, and technical support. Figure 1–34 shows a screenshot <strong>of</strong><br />

<strong>Mac</strong> <strong>OS</strong> X Public Beta.<br />

FIGURE 1–34 <strong>Mac</strong> <strong>OS</strong> X Public Beta<br />

Although the beta release was missing important features and ostensibly<br />

lacked in stability and performance, it demonstrated several important Apple tech-<br />

nologies at work, particularly to those who had not been following the DP releases.<br />

The beta’s key features were the following.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 123<br />

• The Darwin core with its xnu kernel that <strong>of</strong>fered “true” memory protection,<br />

preemptive multitasking, and symmetric multiprocessing<br />

• The PDF-based Quartz 2D drawing engine<br />

• OpenGL support<br />

• The Aqua interface and the Dock<br />

• Apple’s new mail client, with support for IMAP and POP<br />

• A new version <strong>of</strong> the QuickTime player<br />

• The Music Player application for playing MP3s and audio CDs<br />

• A new version <strong>of</strong> the Sherlock Internet searching tool<br />

• A beta version <strong>of</strong> Micros<strong>of</strong>t Internet Explorer<br />

With Darwin, Apple would continually leverage a substantial amount <strong>of</strong> exist-<br />

ing open source s<strong>of</strong>tware by using it for, and <strong>of</strong>ten integrating it with <strong>Mac</strong> <strong>OS</strong> X.<br />

Apple and Internet <strong>Systems</strong> Consortium, Inc. (ISC) jointly founded the OpenDar-<br />

win project in April 2002 for fostering cooperative open source development <strong>of</strong><br />

Darwin. GNU-Darwin is an open source Darwin-based operating system.<br />

The New Kernel<br />

Darwin’s kernel is called “xnu.” It is un<strong>of</strong>ficially an acronym for “X is Not Unix.” It<br />

is also a coincidental tribute to the fact that it is indeed the NuKernel for <strong>Mac</strong> <strong>OS</strong> X.<br />

xnu is largely based on <strong>Mac</strong>h and FreeBSD, but includes code and concepts from<br />

various sources such as the formerly Apple supported MkLinux project, the work done<br />

on <strong>Mac</strong>h at the University <strong>of</strong> Utah, NetBSD, and OpenBSD.<br />

1.10.4. <strong>Mac</strong> <strong>OS</strong> X 10.x<br />

The first version <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> X was released on March 24, 2001 as <strong>Mac</strong> <strong>OS</strong> X 10.0<br />

“Cheetah.” Soon afterwards, the versioning scheme <strong>of</strong> the server product was re-<br />

vised to synchronize it with that <strong>of</strong> the desktop system. Since then, the trend has


124 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

been that a new version <strong>of</strong> the desktop is released first, soon followed by the<br />

equivalent server revision.<br />

The first few major <strong>Mac</strong> <strong>OS</strong> X releases are listed in Table 1–1. Note that the<br />

code names are all taken from felid taxonomy.<br />

TABLE 1–1 <strong>Mac</strong> <strong>OS</strong> X Versions<br />

Version Codename Release Date<br />

10.0 Cheetah March 24, 2001<br />

10.1 Puma September 29, 2001<br />

10.2 Jaguar August 23, 2002<br />

10.3 Panther October 24, 2003<br />

10.4 Tiger April 29, 2005<br />

10.5 Leopard 2006/2007?<br />

Let us look at some notable aspects <strong>of</strong> each major <strong>Mac</strong> <strong>OS</strong> X release.<br />

1.10.4.1. <strong>Mac</strong> <strong>OS</strong> X 10.0<br />

Apple dubbed “Cheetah” as “the world’s most advanced operating system.” Finally,<br />

Apple had shipped an operating system with features that it had long sought. How-<br />

ever, it was clear that Apple had a long way to go in terms <strong>of</strong> performance and sta-<br />

bility. Key features <strong>of</strong> 10.0 included the following.<br />

• The Aqua user interface, with the Dock and the Finder as the primary<br />

user-facing tools<br />

• The PDF-based Quartz 2D graphics engine<br />

• OpenGL for 3D graphics<br />

• QuickTime for streaming audio and video (shipping for the first time as<br />

an integrated feature)<br />

• Java 2 Standard Edition (J2SE)<br />

• Integrated Kerberos


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 125<br />

• <strong>Mac</strong> <strong>OS</strong> X versions <strong>of</strong> the three most popular Apple applications available<br />

as free downloads: iMovie 2, iTunes, and a preview version <strong>of</strong> AppleWorks<br />

• Free IMAP service for .<strong>Mac</strong> email accounts<br />

When <strong>Mac</strong> <strong>OS</strong> X 10.0 was released, there were approximately 350 applica-<br />

tions available for it.<br />

1.10.4.2. <strong>Mac</strong> <strong>OS</strong> X 10.1<br />

“Puma” was a free update released six months after 10.0’s release. It <strong>of</strong>fered sig-<br />

nificant performance enhancements, as indicated by Apple’s following claims.<br />

•<br />

•<br />

•<br />

•<br />

Up to 3× improvement in application launch speed<br />

Up to 5× improvement in menu performance<br />

Up to 3× improvement in window resizing<br />

Up to 2× improvement in file copying<br />

There were substantial performance boosts in other areas such as system<br />

startup, user login, Classic startup, OpenGL, and Java. Other key features <strong>of</strong> this<br />

release included the following.<br />

• The ability to move the Dock from its usual place at the bottom to the<br />

left or right<br />

• System status icons on the menu bar to provide easier access to commonly<br />

used functions such as volume control, display settings, date and<br />

time, Internet connection settings, wireless network monitoring, and battery<br />

charging<br />

• iTunes and iMovie as part <strong>of</strong> system installation, and the introduction <strong>of</strong><br />

iDVD<br />

• A new DVD player with a simplified interface<br />

• Improved iDisk functionality based on WebDAV<br />

• A built-in image capturing application to automatically download and<br />

enhance pictures from digital cameras


126 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

• The ability to burn over 4GB <strong>of</strong> data to a DVD, with support for burning<br />

recordable DVD discs directly in the Finder<br />

• An integrated SMB/CIFS client<br />

The Carbon API implementation in 10.1 was complete enough to allow impor-<br />

tant third party applications to be released. Carbonized versions <strong>of</strong> Micros<strong>of</strong>t Of-<br />

fice, Adobe Photoshop, and <strong>Mac</strong>romedia Freehand were released soon after 10.1’s<br />

release.<br />

1.10.4.3. <strong>Mac</strong> <strong>OS</strong> X 10.2<br />

“Jaguar” was released at 10:20 pm to emphasize its version number. Its important<br />

feature additions included the following.<br />

• Quartz Extreme—an integrated hardware acceleration layer for rendering<br />

on-screen objects by compositing them using primarily the Graphics<br />

Processing Unit (GPU) on supported graphics cards<br />

• iChat—an AOL Instant Messaging (AIM) compatible “IM” client<br />

• An enhanced mail application (Mail.app) with built-in adaptive spam<br />

filtering<br />

• A new Address Book application with support for vCards, Bluetooth, and<br />

iSync synchronization with .<strong>Mac</strong> servers, PDAs, certain cell phones, and<br />

other <strong>Mac</strong> <strong>OS</strong> X computers (the Address Book’s information was accessible<br />

to other applications)<br />

• QuickTime 6, with support for MPEG-4<br />

• An improved Finder with quick file searching from the toolbar and support<br />

for spring-loaded folders<br />

• Inkwell—a handwriting recognition technology integrated with the text<br />

system, allowing text input using a graphics tablet<br />

• Rendezvous, 63 which was Apple’s implementation <strong>of</strong> ZeroConf—a zeroconfiguration<br />

networking technology allowing enabled devices to find<br />

one another on the network<br />

• Better compatibility with Windows networks<br />

• Version 3 <strong>of</strong> the Sherlock Internet services tool<br />

63 Rendezvous was later renamed Bonjour.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 127<br />

Hereafter, Apple introduced new applications and incorporated technologies in<br />

<strong>Mac</strong> <strong>OS</strong> X at a bewildering pace. Other notable additions to <strong>Mac</strong> <strong>OS</strong> X after the<br />

release <strong>of</strong> “Jaguar” included the iPhoto digital photo management application, the<br />

Safari web browser, and an optimized implementation <strong>of</strong> the X Window system.<br />

1.10.4.4. <strong>Mac</strong> <strong>OS</strong> X 10.3<br />

“Panther” added several productivity and security features to <strong>Mac</strong> <strong>OS</strong> X, besides<br />

providing general performance and usability improvements. Notable 10.3 features<br />

included the following.<br />

• An enhanced Finder, with a sidebar and support for labels<br />

• Audio and video conferencing through the iChat AV application<br />

• Exposé—a user-interface feature that can “live shrink” each on-screen<br />

window such that no windows overlap, allowing the user to find a window<br />

visually, after which each window is restored to its original size and<br />

location<br />

• FileVault—encryption <strong>of</strong> a user’s home directory<br />

• Secure deletion <strong>of</strong> files in a user’s trash can via a multipass overwriting<br />

algorithm<br />

• Fast user switching<br />

• Built-in faxing<br />

• Improved Windows compatibility courtesy <strong>of</strong> better support for SMB<br />

shares and Micros<strong>of</strong>t Exchange<br />

• Support for HFSX—a case-sensitive version <strong>of</strong> the HFS Plus file system<br />

The BSD component in “Panther” was based on FreeBSD 5.<br />

1.10.4.5. <strong>Mac</strong> <strong>OS</strong> X 10.4<br />

Besides providing typical evolutionary improvements, “Tiger” introduced several<br />

new technologies such as Spotlight and Dashboard. Spotlight is a search technology<br />

consisting <strong>of</strong> an extensible set <strong>of</strong> metadata importer plug-ins and a query API for


128 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

searching files based on their metadata, even immediately after new files are cre-<br />

ated. Dashboard is an environment for creating and running lightweight desktop<br />

utilities called widgets, which normally remain hidden and can be summoned by a<br />

key-press. Other important “Tiger” features include the following.<br />

• Improved 64-bit support, with the ability to compile 64-bit binaries, and<br />

64-bit support in the libSystem shared library<br />

• Automator—a tool for automating common procedures by visually creating<br />

workflows<br />

• Core Image—a media technology employing GPU-based acceleration<br />

for image processing<br />

• Core Video—a media technology acting as a bridge between QuickTime<br />

and the GPU for hardware-accelerated video processing<br />

• Quartz 2D Extreme—a new set <strong>of</strong> Quartz layer optimizations that use the<br />

GPU for the entire drawing path (from the application to the framebuffer)<br />

• Quartz Composer—a tool for visually creating compositions using both<br />

graphical technologies (such as Quartz 2D, Core Image, OpenGL, and<br />

QuickTime) and non-graphical technologies (such as MIDI System Services<br />

and Rich Site Summary)<br />

• Support for resolution-independent user interface<br />

• Improved iChat AV, with support for multiple simultaneous audio and<br />

video conferences<br />

• PDF Kit—a Cocoa framework for managing and displaying PDF files<br />

from within applications<br />

• Improved Universal Access, with support for an integrated spoken interface<br />

• Improved Sync Services<br />

• An embeddable SQL database engine (SQLite) allowing applications to<br />

use SQL databases without running a separate RDBMS 64 process<br />

• Core Data—a Cocoa technology that integrates with Cocoa bindings and<br />

allows visual description <strong>of</strong> an application’s data entities, whose instances<br />

can persist on a storage medium<br />

• An improved Search Kit<br />

64 Relational Database Management System


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 129<br />

• Fast Logout and Autosave for improved user experience<br />

• Support for Access Control Lists (ACLs)<br />

• New formalized and stable interfaces, particularly for kernel programming<br />

• Improvements to: the Web Kit (including support for creating and editing<br />

content at the DOM level <strong>of</strong> an HTML document), the Safari web<br />

browser (including RSS support), QuickTime (including support for the<br />

H.264 code and a new QuickTime Kit Cocoa framework), the Audio<br />

subsystem (including support for OpenAL, the Open Audio Library), the<br />

<strong>Mac</strong> <strong>OS</strong> X installer application, Xcode, and so on<br />

The first shipping x86-based <strong>Mac</strong>intosh computers used <strong>Mac</strong> <strong>OS</strong> X 10.4.4<br />

as the operating system.<br />

1.11. OTHERS<br />

Besides desktop and server computers, Apple has made various other devices run-<br />

ning operating systems, such as the Pippin multimedia device, hand-held computers<br />

(the MessagePad and the eMate), and the iPod portable music player.<br />

1.11.1. <strong>Mac</strong> <strong>OS</strong> on the Pippin<br />

Apple announced the Pippin platform in Tokyo on December 13, 1994. The Pippin<br />

was dubbed as a multimedia device, a set-top box, and a network computer. It was a<br />

multimedia player platform based on Apple’s second generation Power <strong>Mac</strong>intosh<br />

hardware and s<strong>of</strong>tware.<br />

The nomenclature has fruity connotations and connections. Pippin is also a vari-<br />

ety <strong>of</strong> apples (the fruit). Pippin apples are smaller than the McIntosh variety <strong>of</strong> apples.<br />

The Pippin was meant for activities such as playing back CDs, surfing the<br />

Internet, reading email, and playing games—but not for full-fledged computing. Its<br />

primary display was meant to be a television screen. It was therefore positioned as a


130 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

device that was “more than” a video game console, but “less than” a personal com-<br />

puter. Apple’s plan was to license the Pippin platform to third parties, allowing<br />

manufacturers to build and sell their own versions. The license terms were to in-<br />

clude a per-title royalty.<br />

The Pippin’s technical specifications are shown in Table 1–2. Note that <strong>of</strong> the<br />

6MB RAM, approximately 2MB was used for system s<strong>of</strong>tware and video, and the<br />

rest was available for use by titles. Memory could be added via expansion cards in<br />

increments <strong>of</strong> 2MB, 4MB, or 8MB. The few devices actually made also had 128KB<br />

<strong>of</strong> built-in NVRAM, <strong>of</strong> which the system s<strong>of</strong>tware used 8KB. The NVRAM was<br />

represented as a small HFS volume.<br />

TABLE 1–2 The Pippin’s technical specifications<br />

Area Details<br />

Processor 66 MHz PowerPC 603e processor, with 3 instructions per<br />

clock cycle, 8KB data cache, 8KB instruction cache, and<br />

IEEE standard compliant single/double precision floating-<br />

point unit<br />

Memory 6MB total RAM and 64KB SRAM<br />

Physical Storage 4X CDROM drive, floppy disk drives and disk drives<br />

attachable through an expansion bus<br />

Video Support for NTSC, PAL, S-Video, and VGA (640×480);<br />

up to 16.7 million colors; support for 8-bit and 16-bit<br />

video<br />

Audio Stereo 16-bit 44 kHz sampled input and output<br />

Input Devices Support for up to four simultaneous game controllers over<br />

the Apple Desktop Bus, support for standard ADB key-<br />

board and mice connected through adapters


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 131<br />

Area Details<br />

I/O Serial port and telephony support via an optional GeoPort<br />

The Pippin also <strong>of</strong>fered a proprietary digital filtering technique for improving<br />

text visibility on a standard television screen. Planned connectivity features for the<br />

Pippin included file sharing and other communication with home computers. Inter-<br />

net connectivity was to be provided using an additional adapter or an external mo-<br />

dem.<br />

Apple announced in early 1995 that the Pippin would ship by the end <strong>of</strong> that<br />

year. 65 There were no plans to ship an Apple-branded Pippin. The first third party to<br />

license the Pippin was Bandai 66 Digital Entertainment Corporation—a Japanese toy<br />

manufacturer and CDROM game title publisher. Bandai’s Pippin-based Power<br />

Player product was expected to sell for approximately $500. A “cheap” multimedia<br />

computer’s cost was over $1000 at that point.<br />

The Pippin ran a custom version <strong>of</strong> <strong>Mac</strong> <strong>OS</strong> that had various dedicated fea-<br />

tures. Several <strong>Mac</strong>intosh computer specific features had been removed to minimize<br />

memory footprint. However, highly used or otherwise necessary features were in-<br />

cluded, for example: the <strong>Mac</strong>intosh Toolbox; a built-in 680x0 emulator; integrated<br />

QuickTime; and an integrated, PowerPC-native version <strong>of</strong> QuickDraw. Since the<br />

Pippin did not include a disk drive by default, it typically booted from system s<strong>of</strong>t-<br />

ware residing on the same disc as a Pippin title. Developers could create their own<br />

system s<strong>of</strong>tware bundle by choosing the appropriate system version and configura-<br />

tion.<br />

The Pippin’s intended s<strong>of</strong>tware library was to include games and s<strong>of</strong>tware for<br />

reference, learning, and interactive music. It was believed that the Pippin would<br />

65 Apple eventually provided a Pippin Developer SDK in early 1996.<br />

66 Bandai’s product line included the Power Rangers action figures.


132 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

even run simple versions <strong>of</strong> financial s<strong>of</strong>tware, spreadsheets, and word processors.<br />

In fact, Apple expected many <strong>Mac</strong>intosh applications to run unchanged on the Pip-<br />

pin, 67 with the only requirement being a remastering step to include system s<strong>of</strong>tware<br />

on application discs. Conversely, Pippin titles were expected to work on the <strong>Mac</strong>in-<br />

tosh too.<br />

The Pippin met with a positive reception from the media. An October 1996<br />

article in a Micros<strong>of</strong>t developer column called Pippin “A Real Network Computer.”<br />

The article pointed out that the Pippin’s appeal was that for the price <strong>of</strong> a high-end<br />

VCR, it delivered an almost complete low-end <strong>Mac</strong>intosh. Apple’s licensing plans<br />

were also praised:<br />

“Apple’s go-it-alone attitude has achieved legendary status. That’s why it’s<br />

amazing that the company that once vowed never to license their crown jewels is<br />

neither manufacturing nor marketing the Pippin itself. The Network Computer may<br />

be a joke so far, but Pippin clearly is not.” BYTE magazine proclaimed “Bandai<br />

Digital’s @WORLD Web-browsing system may one day be the <strong>Mac</strong> network com-<br />

puter for corporations.”<br />

However, the Pippin was a failed product—it did not reach most <strong>of</strong> its in-<br />

tended markets. Bandai sold some systems, marketing them as ATMARK in Japan<br />

and @WORLD in USA. The @WORLD system came with a slightly modified ver-<br />

sion <strong>of</strong> the Spyglass Internet browser. A few other variants <strong>of</strong> Pippin existed as<br />

samples or prototypes. Some Pippins had a PowerPC sticker and another stating<br />

“Advanced Technology By Apple Computer.”<br />

Apple also had a set top box product: the Apple Interactive TV Box. It sup-<br />

ported the MPEG-2 video decompression standard, and a variety <strong>of</strong> input<br />

and output ports such as ADB, dual 21-pin EURO-SCART, RF IN and RF<br />

OUT (either NTSC or PAL), RJ-45 connector for either E1 or T1 data<br />

streams, Apple System/Peripheral 8 Cable (serial), S-Video output, RCA<br />

67 Nevertheless, the Pippin was a fundamentally more limited runtime environment as compared to a<br />

<strong>Mac</strong>intosh.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 133<br />

composite video output, RCA stereo audio output, and SCSI HDI-30.<br />

1.11.2. Newton <strong>OS</strong><br />

Newton was a s<strong>of</strong>tware and hardware technology that Apple created for a family <strong>of</strong><br />

PDAs and PDA-like products. Apple’s line <strong>of</strong> hand-held computing devices, such as<br />

models <strong>of</strong> the MessagePad and the eMate 300, ran the Newton operating system.<br />

Newton also ran on clone devices.<br />

The MessagePad was physically similar to a latter-day Personal Digital Assis-<br />

tant (PDA), with an active LCD screen for on-screen tapping, writing, and drawing.<br />

The original model was introduced in 1993 with Newton <strong>OS</strong> 1.0. It had a 20 MHz<br />

ARM 610 processor, 640KB RAM, and 4MB ROM. The last model—the<br />

MP2100—was introduced in late 1997. It had a 161.9 MHz StrongARM processor,<br />

8MB RAM, and 8MB ROM. It ran Newton <strong>OS</strong> 2.1.<br />

The eMate was a portable 68 computer with a 480×320 pixel active LCD screen<br />

and a keyboard. Its screen had a 0.30 mm dot pitch, supported 16 levels <strong>of</strong> gray, and<br />

had a yellow-green luminescent backlight.<br />

The Newton System S<strong>of</strong>tware was logically divided into three parts: Newton<br />

<strong>OS</strong> at the lowest level, System Services, and Application Components.<br />

1.11.2.1. Newton <strong>OS</strong><br />

The operating system was preemptive and multitasking. It could be considered as a<br />

modular set <strong>of</strong> tasks, each dedicated to specific functionality such as scheduling,<br />

task management, inter-task communications, memory management, power man-<br />

agement, and various interactions with hardware. A low-level, extensible communi-<br />

68 The eMate 300 measured 289.6×305.0×53.3 mm, and weighed 4.2 lbs.


134 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

cations subsystem managed serial hardware, infrared, 69 and AppleTalk networking.<br />

This subsystem was extensible in that new protocols could be dynamically added<br />

and removed.<br />

1.11.2.2. System Services<br />

Many system services ran atop the operating system, such as Book Reader, End-<br />

point Communications, Filing, Find, Imaging and Printing, Intelligent Assistant,<br />

Object Storage System, Routing and Transport, Stationery, Text Input and Recogni-<br />

tion, and View System.<br />

1.11.2.3. Application Components<br />

These included the NewtonScript Application Program and the user interface that<br />

ran atop System Services. Newton applications, both built-in and third party, ran in<br />

a single operating system task.<br />

Newton used a sophisticated, modeless input recognition system that could<br />

recognize text, shapes, and gestures. The text recognizer could handle printed, cur-<br />

sive, or mixed handwriting. The shape recognizer could recognize both simple and<br />

complex geometric shapes. A descendant <strong>of</strong> this recognition technology exists as<br />

Inkwell in <strong>Mac</strong> <strong>OS</strong> X.<br />

Dylan<br />

A programming language called Dylan was considered as a candidate for being<br />

the primary language for developing Newton applications. Dylan is an object-oriented,<br />

Lisp-like, dynamic language that combines the features <strong>of</strong> static (such as C and C++)<br />

and dynamic (such as Lisp) languages. It was originally developed at Apple in collabo-<br />

69 Newton devices could exchange information with each other using infrared wireless transmission.


<strong>Mac</strong> <strong>OS</strong> X <strong>Internals</strong> (www.osxbook.com) 135<br />

ration with Carnegie Mellon University and Harlequin Inc. One <strong>of</strong> Dylan’s primary de-<br />

sign goals was to be a suitable language for commercial s<strong>of</strong>tware development. Apple<br />

abandoned Dylan in 1995.<br />

1.11.3. The iPod’s <strong>Operating</strong> System<br />

Apple’s successful iPod portable music player runs a proprietary operating system.<br />

When the first iPod was released in 2001, its s<strong>of</strong>tware’s “About” section mentioned<br />

PortalPlayer, a company that <strong>of</strong>fers platform suites to manufacturers developing<br />

portable digital entertainment devices. A small company called Pixo was also cred-<br />

ited. Pixo’s focus was on developing a wireless s<strong>of</strong>tware platform and services for<br />

phone manufacturers. The Pixo s<strong>of</strong>tware platform consisted <strong>of</strong> components such as<br />

the following:<br />

• Pixo Kernel<br />

• Pixo Toolbox<br />

• Pixo Application Framework<br />

• Pixo User-interface Builder<br />

• Pixo Platform Applications<br />

• Pixo Partner Applications<br />

• Pixo Internet Microbrowser<br />

Pixo was acquired by Sun Microsystems in 2003.<br />

The iPod uses PortalPlayer’s Digital Media Platform, which is marketed as a<br />

turnkey solution consisting <strong>of</strong> System-On-Chip integrated circuits (ICs), a custom-<br />

izable firmware suite, integrated third party services, PC s<strong>of</strong>tware, and other com-<br />

ponents. The iPod uses PortalPlayer’s PP50xx chip, which contains two ARM7T-<br />

DMI processor cores. Its embedded operating system, along with its encoding and<br />

decoding components, also come from PortalPlayer.


136 Chapter 1 A <strong>Technical</strong> <strong>History</strong> <strong>of</strong> Apple’s <strong>Operating</strong> <strong>Systems</strong><br />

Pixo’s s<strong>of</strong>tware, particularly the Toolbox, provided the foundation on which<br />

the iPod’s user interface was originally designed and implemented by Apple. The<br />

Pixo Toolbox provided modules for memory management, low-level graphics such<br />

as bitmaps, boxes, lines, and text, Unicode, collection classes, resource database,<br />

and standard libraries. Pixo’s range <strong>of</strong> applications included Address Book, Calcula-<br />

tor, Calendar, Email, Graphical World Clock, Memo Maker, Todo List, and PC Syn-<br />

chronization.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!