Mac OS X Internals ( PDFDrive )

THThiNganHang
0 次下载
1260
0

资料内容

第 1 页

Mac OS X Internals: A Systems Approach By Amit Singh ............................................... Publisher: Addison Wesley Professional Pub Date: June 19, 2006 Print ISBN-10: 0-321-27854-2 Print ISBN-13: 978-0-321-27854-8 Pages: 1680 Table of Contents Mac OS X was released in March 2001, but many components, such as Mach and BSD, are considerably older. Understanding the design, implementation, and workings of Mac OS X requires examination of several technologies that differ in their age, origins, philosophies, and roles. Mac OS X Internals: A Systems Approach is the first book that dissects the internals of the system, presenting a detailed picture that grows incrementally as you read. For example, you will learn the roles of the firmware, the bootloader, the Mach and BSD kernel components (including the process, virtual memory, IPC, and file system layers), the object-oriented I/O Kit driver framework, user libraries, and other core pieces of software. You will learn how these pieces connect and work internally, where they originated, and how they evolved. The book also covers several key areas of the Intel-based Macintosh computers. A solid understanding of system internals is immensely useful in design, development, and debugging for programmers of various skill levels. System programmers can use the book as a reference and to construct a better picture of how the core system works. Application programmers can gain a deeper understanding of how their applications interact with the system. System administrators and power users can use the book to harness the power of the rich environment offered by Mac OS X. Finally, members of the Windows, Linux, BSD, and other Unix communities will find the book valuable in comparing and contrasting Mac OS X with their respective systems. Mac OS X Internals focuses on the technical aspects of OS X and is so full of extremely useful information and programming examples that it will definitely become a mandatory tool for every Mac OS X programmer.

第 2 页

Mac OS X Internals: A Systems Approach By Amit Singh ............................................... Publisher: Addison Wesley Professional Pub Date: June 19, 2006 Print ISBN-10: 0-321-27854-2 Print ISBN-13: 978-0-321-27854-8 Pages: 1680 Table of Contents Copyright Preface Acknowledgments About the Author Chapter 1. Origins of Mac OS X Section 1.1. Apple's Quest for the Operating System Section 1.2. The NeXT Chapter Section 1.3. The Mach Factor Section 1.4. Strategies Section 1.5. Toward Mac OS X Chapter 2. An Overview of Mac OS X Section 2.1. Firmware Section 2.2. Bootloader Section 2.3. Darwin Section 2.4. The xnu Kernel Section 2.5. A User-Space View of the File System Section 2.6. The Runtime Architecture Section 2.7. The C Library Section 2.8. Bundles and Frameworks Section 2.9. Core Services Section 2.10. Application Services Section 2.11. Application Environments Section 2.12. User Interface Section 2.13. Programming Section 2.14. Security Section 2.15. Mac OS X Server Section 2.16. Networking Chapter 3. Inside an Apple Section 3.1. The Power Mac G5 Section 3.2. The G5: Lineage and Roadmap Section 3.3. The PowerPC 970FX Section 3.4. Software Conventions Section 3.5. Examples Chapter 4. The Firmware and the Bootloader

第 3 页

Section 4.1. Introduction Section 4.2. A Whole New World Section 4.3. Power-On Reset Section 4.4. Open Firmware Section 4.5. Forth Section 4.6. The Device Tree Section 4.7. Open Firmware Interfaces Section 4.8. Programming Examples Section 4.9. Firmware Boot Sequence Section 4.10. BootX Section 4.11. Alternate Booting Scenarios Section 4.12. Firmware Security Section 4.13. Launching the Kernel Section 4.14. The BootCache Optimization Section 4.15. Boot-Time Kernel Arguments Section 4.16. The Extensible Firmware Interface Chapter 5. Kernel and User-Level Startup Section 5.1. Arranging for the Kernel to Execute Section 5.2. Low-Level Processor Initialization Section 5.3. High-Level Processor Initialization Section 5.4. Mach Subsystem Initialization Section 5.5. The First Thread Section 5.6. I/O Kit Initialization Section 5.7. BSD Initialization Section 5.8. Launching the First User-Space Program Section 5.9. Slave Processors Section 5.10. User-Level Startup Chapter 6. The xnu Kernel Section 6.1. xnu Source Section 6.2. Mach Section 6.3. A Flavor of the Mach APIs Section 6.4. Entering the Kernel Section 6.5. Exception Processing Section 6.6. System Call Processing Section 6.7. System Call Categories Section 6.8. Kernel Support for Debugging, Diagnostics, and Tracing Section 6.9. Virtual Machine Monitor Section 6.10. Compiling the Kernel Chapter 7. Processes Section 7.1. Processes: From Early UNIX to Mac OS X Section 7.2. Mach Abstractions, Data Structures, and APIs Section 7.3. Many Threads of a New System Section 7.4. Scheduling Section 7.5. The execve() System Call Section 7.6. Launching Applications Chapter 8. Memory

第 4 页

Section 8.1. Looking Back Section 8.2. An Overview of Mac OS X Memory Management Section 8.3. Mach VM Section 8.4. Resident Memory Section 8.5. Virtual Memory Initialization during Bootstrap Section 8.6. The Mach VM User-Space Interface Section 8.7. Using the Mach VM Interfaces Section 8.8. Kernel and User Address Space Layouts Section 8.9. Universal Page Lists (UPLs) Section 8.10. Unified Buffer Cache (UBC) Section 8.11. The Dynamic Pager Program Section 8.12. The Update Daemon Section 8.13. System Shared Memory Section 8.14. Task Working Set Detection and Maintenance Section 8.15. Memory Allocation in User Space Section 8.16. Memory Allocation in the Kernel Section 8.17. Memory-Mapped Files Section 8.18. 64-bit Computing Chapter 9. Interprocess Communication Section 9.1. Introduction Section 9.2. Mach IPC: An Overview Section 9.3. Mach IPC: The Mac OS X Implementation Section 9.4. Name and Bootstrap Servers Section 9.5. Using Mach IPC Section 9.6. MIG Section 9.7. Mach Exceptions Section 9.8. Signals Section 9.9. Pipes Section 9.10. Named Pipes (Fifos) Section 9.11. File Descriptor Passing Section 9.12. XSI IPC Section 9.13. POSIX IPC Section 9.14. Distributed Objects Section 9.15. Apple Events Section 9.16. Notifications Section 9.17. Core Foundation IPC Section 9.18. Synchronization Chapter 10. Extending the Kernel Section 10.1. A Driver down the Memory Lane Section 10.2. The I/O Kit Section 10.3. DART Section 10.4. Dynamically Extending the Kernel Section 10.5. Communicating with the Kernel Section 10.6. Creating Kernel Extensions Section 10.7. A Programming Tour of the I/O Kit's Functionality Section 10.8. Debugging

第 5 页

Chapter 11. File Systems Section 11.1. Disks and Partitions Section 11.2. Disk Arbitration Section 11.3. The Implementation of Disk Devices Section 11.4. Disk Images Section 11.5. Files and File Descriptors Section 11.6. The VFS Layer Section 11.7. File System Types Section 11.8. Spotlight Section 11.9. Access Control Lists Section 11.10. The Kauth Authorization Subsystem Chapter 12. The HFS Plus File System Section 12.1. Analysis Tools Section 12.2. Fundamental Concepts Section 12.3. The Structure of an HFS+ Volume Section 12.4. Reserved Areas Section 12.5. The Volume Header Section 12.6. The HFS Wrapper Section 12.7. Special Files Section 12.8. Examining HFS+ Features Section 12.9. Optimizations Section 12.10. Miscellaneous Features Section 12.11. Comparing Mac OS X File Systems Section 12.12. Comparing HFS+ and NTFS Appendix A. Mac OS X on x86-Based Macintosh Computers Section A.1. Hardware Differences Section A.2. Firmware and Booting Section A.3. Partitioning Section A.4. Universal Binaries Section A.5. Rosetta Section A.6. Byte Ordering Section A.7. Miscellaneous Changes

第 6 页

Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales, (800) 382-3419, corpsales@pearsontechgroup.com For sales outside the United States, please contact: International Sales, international@pearsoned.com FREE 45-day online access A searchable electronic version of this book's content is available for a limited time through Safari Bookshelf. Safari Bookshelf is an electronic reference library that lets you easily search thousands of technical books, find code samples, download chapters, and access technical information whenever and wherever you need it. To gain 45-day FREE Safari access to this book: Go to http://www.awprofessional.com/safarienabled Complete the brief registration form Enter the coupon code EUMQ-IH3L-XVUX-T1L6-E6JZ If you have difficulty registering on Safari Bookshelf or accessing the online edition, please e-mail customer- service@safaribooksonline.com. Visit us on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data Singh, Amit. Mac OS X internals : a systems approach / Amit Singh. p. cm. Includes bibliographical references and index. ISBN 0-321-27854-2 (hardback : alk. paper) 1. Mac OS. 2. Operating systems (Computers) 3. Macintosh (Computer)--Programming. I. Title. QA76.76.O63S5645 2006 005.4'4682dc22 2006014901 Copyright © 2007 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and

第 7 页

permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 75 Arlington Street, Suite 300 Boston, MA 02116 Fax: (617) 848-7047 Text printed in the United States on recycled paper at Courier in Westford, Massachusetts. First printing, June 2006 Dedication To my parents, Sharda and Amar Singh, for teaching me everything I know about learning, for giving me everything that I ever needed (or wanted) from them, and for always being in my way without becoming an obstacle.

第 8 页

Preface Although Mac OS X is a relatively new operating system, its lineage is rather colorful, and the history of most of its components is much older. Mac OS X, and Apple in general, has attracted a lot of attention in recent years. Given Apple's "cult-like" status, and the unique cultural and technical composition of Mac OS X, it is not surprising that people with vastly different backgrounds and interestsboth users and non-users of Mac OS Xare curious about the system. After working on, programming on, and extending several operating systems over the years, I was introduced to Mac OS X on April 1, 2003.[1] I was soon curious about the structure of the system. Despite the availability of several good books on Mac OS X, I was dismayed to find that I could not learn the details of Mac OS X internals from a bookno such book existed. There are books describing how to perform various tasks on Mac OS X; how to configure, customize, and tweak the system; and how certain user-visible aspects differ between Mac OS X and Windows. There are also books covering specific Mac OS X programming topics, such as the Cocoa and Carbon APIs. Other books make life easier for a Unix[2] user migrating to Mac OS Xsuch books typically discuss the command-line interface to the operating system. Although these books play important roles in making Mac OS X accessible, the core architecture and implementation of Mac OS X and its components have remained mysteries. To make matters worse, besides the lack of information, it is common to find misinformation on the composition of Mac OS X. Consequently, the system is often misunderstood because of long-standing myths and stereotypes, or is perceived as a black box. [1] The date is interesting because coincidentally, Apple was founded on April 1, 1976. [2] I use the term "Unix" to represent one of a UNIX system, a UNIX-derived system, or a UNIX-like system. The purpose of this book is to deconstruct and demystify Mac OS X by describing it from a system-design perspective. It takes an implementation-oriented approach to understanding the system. Consider the example of interprocess communication (IPC). Mac OS X has numerous user-level and kernel-level IPC mechanisms, some of which are well known and documented. Rather than just showing how to use these mechanisms, the book explains the design and implementation of the most fundamental mechanism (Mach IPC), and then discusses how the other mechanisms are layered on top of one another. My goal is not to teach you how to do something specificmy goal is to provide you with enough knowledge and examples so that after reading the book, depending on your interests and background, you can build upon your newly gained knowledge and do what you choose. Along with text, the book uses detailed illustrations, function call graphs, annotated code excerpts, and programming examples to present a detailed examination of Mac OS X. To keep the subject matter interesting and accessibleeven to the casual readerthe book contains relevant trivia, digressions, and other tidbits.[3] [3] And a healthy dose of footnotes, too! Who This Book Is For I hope the book will be useful to anyone curious about the composition and working of Mac OS X. Application programmers can gain a deeper understanding of how their applications interact with the system. System programmers can use the book as a reference and to construct a better picture of how the core system works. In my experience as a programmer, a solid understanding of system internals is immensely useful in design, development, and debugging. For example, you know what the system is capable of, what is feasible and what is not, what the "best" option is in a given situation, and what the plausible reasons are for certain program behavior. This book's primary goal is to build a strong foundation for anyone who programs on Mac OS X.

第 9 页

Mac OS X users can read the book to better understand how the system is designed and how it comes together. System administrators and technical support staff will also find value in the book. Besides those who use Mac OS X, the intended audience includes members of other technical communities, such as the BSD, Linux, and Windows communities. Given that many internal aspects of Mac OS X are radically different from these systems (for example, how the Mach kernel is used), the book will help such readers broaden their knowledge, and will assist them in comparing and contrasting Mac OS X with other operating systems. The book will also be useful in an advanced operating systems course, particularly if you wish to do a case study on Mac OS X. The book is not suitable, however, as an introductory text. Most of the material is not presented at an introductory level, although I introduce many of the advanced topics with at least some background information. The Book's Structure Modern operating systems have become so large and complex that it is impossible to reasonably describe an entire system in a book. This book is somewhat ambitious in that it attempts to cover Mac OS X in substantial breadth and depth. The most important contributors to the book's depth are the carefully selected programming examples. The book is organized into twelve chapters. Although much of the book's content is rather technical, each chapter has sections that should be accessible to non-programmers. Chapter 1, "Origins of Mac OS X," describes the technical history of Mac OS X and the systems it derives from. An unabridged version of Chapter 1, which covers all of Apple's past and present operating systems, is available on this book's accompanying web site. Chapter 2, "An Overview of Mac OS X," is an eclectic tour of Mac OS X and its important features. It contains brief overviews of various layers that constitute the system. Chapter 3, "Inside an Apple," describes the PowerPC architecture, using the PowerPC 970 ("G5") processor line as a specific example. It also discusses the PowerPC assembly language and calling conventions. Chapter 4, "The Firmware and the Bootloader," describes both Open Firmware and the Extensible Firmware Interface (EFI), along with their respective bootloaders. It discusses the roles the firmware and the bootloader play in the system's operation, usage scenarios, and events that occur during early bootstrapping. Chapter 5, "Kernel and User-Level Startup," describes the sequence of eventsincluding initializations of kernel subsystemsfrom where the kernel starts executing to the point where the first user-space program (launchd) is run by the kernel. The discussion includes launchd's function and implementation. Chapter 6, "The xnu Kernel," describes the core kernel architecture of Mac OS X. The discussion includes system call families and their implementation, low-level tracing and debugging mechanisms, and special features such as the virtual machine monitor in the PowerPC version of the kernel. Chapter 7, "Processes," describes abstractions such as tasks, threads, and processes, the various forms in which they exist in Mac OS X subsystems, and processor scheduling. The discussion includes using various kernel-level and user-level interfaces for manipulating the aforementioned abstractions. Chapter 8, "Memory," describes the Mac OS X memory subsystem's architecture, including discussions of the Mach virtual memory architecture, paging, the unified buffer cache, the working-set detection mechanism, kernel-level and user-level memory allocators, and support for 64-bit addressing. Chapter 9, "Interprocess Communication," describes various IPC and synchronization mechanisms available in Mac OS X. In particular, it discusses the implementation and usage of Mach IPC. Chapter 10, "Extending the Kernel," describes the I/O Kit, the object-oriented driver subsystem in Mac OS X. Chapter 11, "File Systems," describes the overall file system layer in Mac OS X, including brief discussions of each file system type. The discussion also covers partitioning schemes, disk management, and the Spotlight search technology. Chapter 12, "The HFS Plus File System," describes the internals of the HFS Plus file system. The discussion is aided by the use of a custom file system debugger written for this chapter.

第 10 页

Appendix A, "Mac OS X on x86-Based Macintosh Computers," highlights the key differences between the x86-based and PowerPC-based versions of Mac OS X. Besides this appendix, the book covers the details of several key x86-specific topics, such as EFI, GUID-based partitioning, and Universal Binaries. Most of Mac OS X is architecture-independent, and consequently, the majority of the book is architecture-independent. Given the book's length, I chose to exclude several topics that are well covered in other texts. The TCP/IP stack is an examplethere is no "networking" chapter in the book since the Mac OS X TCP/IP stack is largely a derivative of the FreeBSD stack, which is already well documented. In general, information that is generic across Unix variants and can be found in standard texts is not included in this book. How to Read This Book Since the first two chapters provide the background and overall picture of Mac OS X, respectively, I recommend that you read these chapters first. The subsequent chapters are best read sequentially, although, depending on your interests and familiarity with the topics, you can skip certain sections (and perhaps even chapters) and still gain value from the book. It will help if you have some familiarity with operating system concepts and have used a Unix operating system. Given that the book has a large number of C programs and program excerpts, you should have some programming experience, and in particular, knowledge of the C programming language. I sometimes use code not only to demonstrate the working of a concept, but also to describe the concept. I realize that it is usually considered "difficult" to "read" code, and authors often expect that many readers will simply skip the code. My belief is that reading the code (as opposed to only running it) in this book will be particularly helpful to programmers. Despite the book's technical nature, several parts of the book can be read casually by both programmers and non-programmers. I hope that as a reference on Mac OS X internals, the book and its examples will be useful to its readers for a long time to come. How to Use the Examples I have included a number of self-contained examples in the book. Many of these examples are non-trivial in that they do something that is both useful and interesting. I hope that these examples will serve as food for thought and building blocks for other projects. Almost all of the examples in the book are shown along with the command lines used to compile and run them. The examples were tested on both PowerPC-based and x86-based Macintosh computers where applicable. It is interesting to note that in the cases where the code is PowerPC-only, say, in a PowerPC assembly language example, it can usually be both compiled and run on an x86-based Macintoshsuch code will run under the Rosetta binary translation software. However, a small number of examples in the book require a PowerPC Macintoshthey will not run under Rosetta. Related Material Technology moves so fast these days that it is almost impossible to publish a fully up-to-date book. Thankfully, Internet access allows the author and publisher to make various materials available to readers after the book is published. The most useful resource for this book is its accompanying web site, www.osxbook.com, which includes the following: Errata and updates Source code from the book The book's blog, with news and announcements about the availability of new material

第 11 页

A set of discussion forums where topics related to the book (and to Mac OS X in general) can be discussed A bonus content section, which contains additional articles, presentations, binaries, and source code relevant to the book Sample content from the book, including a detailed table of contents

第 12 页

Acknowledgments This book was the most arduous, time-consuming, and energy-sapping project I have ever done. The only reason I could get through this was the love and support I received from my wife, Gowri. Around the same time as I decided to write this book, we learned that we were expecting a baby. As all of my free time went to the book, Gowri's responsibilities increased exponentially, especially after little Arjun arrived. With her seemingly infinite strength and patience, Gowri made it all work eventually. My greatest thanks go to her. Arjun continually gave me energy through his wonderful smile and antics. I also thank our families for their love and support, and especially Gowri's mom and her sister, Gayethri, for traveling halfway across the worldseveral times during the two years I spent on the bookto help us when we needed family support. Very special thanks to Steve Welch, my manager at IBM Research, who was incredibly supportive and put up with my erratic schedule at work. I can't thank Snorri Gylfason enough. He is single-handedly responsible for introducing me to the Macintosh. Had it not been for him, I would not have begun to use Mac OS X, would not have been curious about the system, and would not have written this book. Snorri was also the most prolific and hard-working reviewer for the bookhe meticulously went through each page, each illustration, and each example, using his rather easy flowing red markers to great effect. We had countless all-night reviewing sessions. On many other occasions (essentially every day), Snorri patiently listened to the frustrated whining of an overworked author. Even after he moved back to his native Iceland, Snorri fulfilled all his reviewing commitments. Thanks to Mark A. Smith for reviewing almost the entire book despite having no initial interest in Mac OS X. Mark provided valuable feedback, often reading at a bewildering pace but catching errors so subtle that it defied logic. Thanks to Ted Bonkenburg, Úlfar Erlingsson, and Anurag Sharma for reviewing several chapters with uncompromising scrutiny. Ted graciously had numerous discussions with me, as I stole time from his extremely busy schedule. Thanks to Anita Holmgren of Tenon Systems for sending me a copy of MachTen. Thanks to the team at Addison-Wesley for all their hard work and dedication. In particular, thanks to my editor Catherine Nolan for managing this project (and for dealing with me). Thanks to Mark Taub, John Wait, Denise Mickelsen, Stephane Nakib, Kim Spilker, Beth Wickenhiser, Lara Wysong, and all others whose names I do not know for the roles they played in the making of this book. Finally, thanks to my copy editor, Chrysta Meadowbrooke, for her top-notch work.

第 13 页

About the Author Amit Singh is an operating systems researcher currently working at Google. Amit was formerly with the IBM Almaden Research Center. Previously, he worked for a Silicon Valley startup that did cutting-edge work in the virtualization of operating systems. Amit also was a member of technical staff in the Information Sciences Research Center at Bell Laboratories, where he worked on operating systems and networking. He created and maintains www.osxbook.com and www.kernelthread.com.

第 14 页

Chapter 1. Origins of Mac OS X "Most ideas come from previous ideas." Alan Curtis Kay The Mac OS X operating system represents a rather successful coming together of paradigms, ideologies, and technologies that have often resisted each other in the past. A good example is the cordial relationship that exists between the command-line and graphical interfaces in Mac OS X. The system is a result of the trials and tribulations of Apple and NeXT, as well as their user and developer communities. Mac OS X exemplifies how a capable system can result from the direct or indirect efforts of corporations, academic and research communities, the Open Source and Free Software movements, and, of course, individuals. Apple has been around since 1976, and many accounts of its history have been told. If the story of Apple as a company is fascinating, so is the technical history of Apple's operating systems. In this chapter,[1] we will trace the history of Mac OS X, discussing several technologies whose confluence eventually led to the modern-day Apple operating system. [1] This book's accompanying web site (www.osxbook.com) provides a more detailed technical history of all of Apple's operating systems.

第 15 页

1.1. Apple's Quest for the[2] Operating System [2] Whereas the word "the" is used here to designate prominence and desirability, it is an interesting coincidence that "THE" was the name of a multiprogramming system described by Edsger W. Dijkstra in a 1968 paper. It was March 1988. The Macintosh had been around for four years. Some Apple engineers and managers had an offsite meeting. As they brainstormed to come up with future operating system strategies, they noted down their ideas on three sets of index cards that were colored blue, pink, and red. Blue would be the project for improving the existing Macintosh operating system. It would eventually form the core of System 7. Pink would soon become a revolutionary operating system project at Apple. The operating system was planned to be object-oriented. It would have full memory protection, multitasking with lightweight threads, a large number of protected address spaces, and several other modern features. After languishing for many years at Apple, Pink would move out to Taligent, a company jointly run by Apple and IBM. Since the color red is "pinker than pink," ideas considered too advanced even for Pink were made part of the Red project. As the 1980s drew to an end, the Macintosh system software was at major version 6. System 7, a result of the Blue project, would be Apple's most significant system yet. However, that would not appear until 1991. Meanwhile, Microsoft had developed its Windows 3.x operating system, which became extremely successful after its release in 1990. Microsoft had also been working on a new operating system codenamed Chicago. Initially slated for release in 1993, Chicago kept slipping. It was eventually released as Windows 95. However, Microsoft did release another Windows operating systemWindows NTin 1993 (Figure 11). NT was an advanced operating system meant for high-end client-server applications. It had various important features such as symmetric multiprocessing support, a preemptive scheduler, integrated networking, subsystems for OS/2 and POSIX, virtual machines for DOS and 16-bit Windows, a new file system called NTFS, and support for the Win32 API. Figure 11. Microsoft Windows NT 3.1 [View full size image]

第 16 页

Apple needed an answer to Microsoft's onslaught, particularly in the face of the upcoming Windows 95, which was to be an end-user operating system. The Pink and Red projects would turn out to be rather unsuccessful. Apple would continue to attempt to solve the "OS problem" one way or another. 1.1.1. Star Trek Star Trek was a bold project that Apple ran jointly with Novell to port Mac OS to run on the x86 platform. A team consisting of engineers from both Apple and Novell succeeded in creating a very reasonable prototype in an incredibly short amount of time. The project was canceled, however, for various reasons: Apple had already committed to the PowerPC; many within and outside of Apple thought that adding support for the x86 platform would disrupt Apple's existing business model; and vendor feedback was not encouraging. Many years later, Darwinthe core of Apple's far more successful Mac OS Xruns on both the PowerPC and the x86. Whereas the Star Trek prototype showed the "Happy Mac" logo while booting up, Darwin/x86 prints the message "Welcome to Macintosh" during boot. Star Trek was finally vindicated with Apple's mid-2005 announcement of transitioning Mac OS X to the x86 platform. The first x86-based Macintosh computersthe iMac and the MacBook Pro (the successor to the PowerBook)were unveiled at the San Francisco Macworld Conference & Expo in January 2006. 1.1.2. Raptor Raptor was, in many respects, the Red project. It was supposed to provide Apple with a next-generation

第 17 页

microkernel that would run on any architecture. As the Star Trek project was being canceled, it was considered for absorption by Raptor, which itself died later due to budgetary limitations and employee attrition, among other reasons. 1.1.3. NuKernel NuKernel was a kernel project at Apple that was meant to result in a modern operating system kernel on more than one occasion. NuKernel was meant to be an efficient microkernel that would facilitate features such as preemptive multitasking, protected memory, an efficient memory model, a high degree of system extensibility, and most significantly, a hardware abstraction layer (HAL) that was expected to allow any computer vendor to easily design Mac OScompatible systems. 1.1.4. TalOS Apple and IBM formed a company called Taligent in early 1992 to continue work on the Pink project. Pink originally aimed to be an object-oriented operating system but later morphed into an object-oriented environment called CommonPoint that ran on many modern operating systems such as AIX, HP-UX, OS/2, Windows 95, and Windows NT. It was also meant to run on Apple's NuKernel. Taligent Object Services (TalOS) was the name given to a set of lower-level technologies to be built around version 3.0 of the Mach kernel. TalOS was meant to be an extensible and portable operating system, with a small footprint and good performance. TalOS was object-oriented from the kernel up, with even device drivers and network protocols implemented in an object-oriented fashion. Taligent's object-oriented libraries were known as frameworks. There were frameworks for user interfaces, text, documents, graphics, multimedia, fonts, printing, and low-level services such as drivers. These, along with the TalOS development tools, explicitly strived to shift the burden of programming from application developers to application system engineers. Note that even though there existed other commercial systems such as NEXTSTEP that had object-oriented application frameworks, Taligent aimed to build its entire programming model around objects. In NEXTSTEP, the developers who created frameworks had to map object behavior to the underlying libraries, Unix system calls, Display PostScript, and so onall of which had procedural APIs. In contrast, Taligent's CommonPoint applications were not meant to use the host operating system APIs at all. In 1995, Taligent became a wholly owned subsidiary of IBM. The Pink project did not give Apple the next- generation operating system that Apple had been seeking. 1.1.5. Copland Apple made an announcement in early 1994 that it would channel more than a decade of experience into the next major release of the Macintosh operating system: Mac OS 8. The project was codenamed Copland. It was expected that Copland would be Apple's real response to Microsoft Windows. With Copland, Apple hoped to achieve several goals, many of which had been long elusive. Adopt RISC[3] as a key foundation technology by making the system fully PowerPC-native. [3] Reduced instruction -set computing. Integrate, improve, and leverage existing Apple technologies such as ColorSync, OpenDoc, PowerShare, PowerTalk, QuickDraw 3D, and QuickDraw GX. Retain and improve the Mac OS interface's ease of use while making it multiuser and fully customizable. In particular, Copland's implementation of themes allowed customization of most user- interface elements on a per-user basis.

第 18 页

Extend interoperability with DOS and Windows. Make Mac OS systems the best network clients. Incorporate active assistance that works across applications and networksthat is, make it very easy to automate a wide variety of tasks. Release Copland as a system that may be openly licensed to foster development of Mac OScompatible clones by third parties. To achieve these goals, Copland was supposed to have a comprehensive set of system-level features, for example: A hardware abstraction layer that would also help vendors in creating compatible systems A microkernel (the NuKernel) at its core Symmetric multiprocessing with preemptive multitasking Improved virtual memory with memory protection A flexible and powerful system extension mechanism Critical subsystems such as I/O, networking, and file systems running as services on top of the kernel Built-in low-level networking facilities such as X/Open Transport Interface (OTI), System V STREAMS, and Data Link Provider Interface (DLPI) File searching based on both metadata and content The ability to perform "live upgrades" on a system without affecting the performance of other running programs Figure 12 shows a conceptual view of Copland. Figure 12. Copland architecture [View full size image]

第 19 页

Work on Copland gained momentum during the early 1990s, and by the mid-1990s, Copland was heavily counted on to do wonders for the company. Apple dubbed it as "The Mac OS Foundation for the Next Generation of Personal Computers." However, the project kept slipping. A few prototypical Driver Development Kit (DDK) releases went out, but a 1996 releaseas had been planned and hoped fordid not seem feasible. Due to numerous pressures, full memory protection had not been included after all. Apple's CEO Gil Amelio described the state of Copland as "just a collection of separate pieces, each being worked on by a different team . . . that were expected to magically come together somehow. . . ."[4] [4] On the Firing Line, by Gil Amelio and William L. Simon (New York: Harper Business, 1998). Apple eventually decided to cancel Copland in May 1996. Amelio announced that Copland's best pieces would be shipped with future releases of their existing system, beginning with the upcoming System 7.6, whose name was formally changed to Mac OS 7.6. 1.1.6. Gershwin After the Copland debacle, Apple's need for a new operating system was direr than ever. Focus shifted briefly to a project named Gershwin, which was to include the painfully elusive memory protection, among other things. However, it was apparently nothing more than a codename, and it is believed that nobody ever worked on Gershwin.

第 20 页

1.1.7. BeOS Apple briefly considered partnering with Microsoft to create an Apple OS based on Windows NT. Other systems under consideration were Solaris from Sun Microsystems and BeOS from Be. In fact, Apple's acquisition of Be came rather close to materializing. Be was founded in 1990 by Jean-Louis Gassée, Apple's former head of product development. Be's capable engineering team had created an impressive operating system in BeOS (Figure 13). It had memory protection, preemptive multitasking, and symmetric multiprocessing. It even ran on the PowerPC,[5] thus fitting with Apple's hardware agenda. BeOS was designed to be especially adept at handling multimedia. It had a metadata-rich file system called BeFS that allowed files to be accessed via multiple attributes. However, BeOS was still an unfinished and unproven product. For example, it did not yet support file sharing or printing, and only a few applications had been written for it. [5] BeOS initially ran on Be's own PowerPC -based machine called the BeBox. It was later ported to the x86 platform. Figure 13. BeOS [View full size image] Gassée and Apple negotiated back and forth over Be's acquisition. The total investment in Be at that time was estimated at about $20 million, and Apple valued Be at $50 million. Gassée sought over $500 million, confident that Apple would buy Be. Apple negotiated up to $125 million, and Be negotiated down to $300 million. When things still did not work out, Apple offered $200 million, and even though it is rumored that Gassée was actually willing to accept this offer, it is also said that he came back with a "final price" of $275 million, hoping Apple would bite the bullet. The deal did not happen. In any case, Be had a tough contender

显示前 20 页。下载资料查看完整内容。

评论 (0)

登录 以加入讨论

暂无评论。快来抢沙发吧!