Buy new:
-21% $73.79$73.79
$5 delivery November 21 - 23
Ships from: Page Masters Sold by: Page Masters
Save with Used - Good
$12.10$12.10
Ships from: Amazon Sold by: The Grapevine Picker
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
MAC OS X Internals: A Systems Approach 1st Edition
Purchase options and add-ons
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.
- ISBN-100321278542
- ISBN-13978-0321278548
- Edition1st
- PublisherAddison-Wesley Professional
- Publication dateJanuary 1, 2006
- LanguageEnglish
- Dimensions7 x 2.75 x 9.25 inches
- Print length1641 pages
Frequently bought together

Similar items that ship from close to you
Editorial Reviews
Review
"Overall, I recommend this book to anyone that wants a deeper understanding of the internals of the Macintosh. If you are a developer, this is a must-have book."--Justin Williams, Founder, Maczealots.com
"It's a book that every administrator and developer of almost any kind of hardware and software would want to own. It explains the how as opposed to the what of OS X more clearly, thoroughly and intelligently than any other book on the market."--Mark Sealey, Contributing Editor, ThinkSecret.com
About the Author
Excerpt. © Reprinted by permission. All rights reserved.
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 interests—both users and non-users of Mac OS X—are 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. 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 book—no 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 user migrating to Mac OS X—such 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.
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 specific—my 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 accessible—even to the casual reader—the book contains relevant trivia, digressions, and other tidbits.
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.
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 boot-loaders. 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 events—including initializations of kernel subsystems—from 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.
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 example—there 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 Macintosh—such code will run under the Rosetta binary translation software. However, a small number of examples in the book require a PowerPC Macintosh—they 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, http://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
- 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
Product details
- Publisher : Addison-Wesley Professional; 1st edition (January 1, 2006)
- Language : English
- Hardcover : 1641 pages
- ISBN-10 : 0321278542
- ISBN-13 : 978-0321278548
- Item Weight : 5.5 pounds
- Dimensions : 7 x 2.75 x 9.25 inches
- Best Sellers Rank: #1,479,008 in Books (See Top 100 in Books)
- #249 in Macintosh Operating System
- #276 in Computer Operating Systems (Books)
- #4,604 in Computer Software (Books)
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read book recommendations and more.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers find the book excellent and informative. They say it's the ultimate tome of reference for serious Mac developers. Readers also mention the technical information and programming examples are extremely helpful in better understanding how things work under the hood.
AI-generated from the text of customer reviews
Customers find the information in the book excellent and informative. They say it's the ultimate tome of reference for serious Mac developers. Readers also mention the technical information and programming examples are extremely helpful in better understanding how things work under the hood.
"Seems like a good book. Learned some useful stuff. Only one problem: pages 127-190 are missing and now I need them! Um, what...?..." Read more
"It's enormous! And every page has information useful to someone who develops on the Mac...." Read more
"...It can still be useful reading material if you run into intricacies of OS X where it becomes essential to know the history and evolution of the OS." Read more
"It's a great book on the internal workings of the Mac Os" Read more
Customers find the book to be readable for a technical textbook. They say it's a great read for Apple software developers.
"Seems like a good book. Learned some useful stuff. Only one problem: pages 127-190 are missing and now I need them! Um, what...?..." Read more
"It reads pretty well for a technical textbook. Must read for software enthusiasts especially for those wanting insight into the history and makings..." Read more
"Great book, but a little old...." Read more
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
UPDATE 9/30/2015:
The author got in touch with me and sent me the missing pages--thank you! I got some much needed information on OS X's keychain storage.
In other news, I just want to say that this book is top notch in terms of the breadth and depth of technical information on OS X. I originally purchased it for information on OS X's boot sequence and crypto facilities. It has detailed information on all this an much more.
Kudos to Mr. Singh who went out of his way to help and on having written an excellent guide to OS X internals.
All the gory details of how a Mac OS is put together from Mach to Cocoa are covered and then some. The author is a hard-core expert who put a lot into this book. Well worth the price!
(Full disclosure: Back in Feb. 2004 I reviewed Singh's proposal to Addison-Wesley for this book, gave it an enthusiastic recommendation, and was paid a small sum.)
I have a bunch of OS internals books, but this one at 1600 pages is more than twice as big as the next biggest. There are two reasons: Mac OS X is the most functionally rich of any OS I know of, and Singh covers it in amazing detail.
I'm only up to page 50, but I've already learned a lot about Mac OS X's fascinating history, which goes back to NextStep and Mach (mid-1980s), and includes parts from the original Mac OS (now represented in Classic and Carbon) and BSD, as well as newer subsystems developed entirely at Apple. The UNIX-like part is called Darwin, and I discussed its API in my own book, Advanced UNIX Programming (available from Amazon). But Darwin is only a fragment of what Singh takes on.
It can still be useful reading material if you run into intricacies of OS X where it becomes essential to know the history and evolution of the OS.
2. This book only contained chapters 8-12.
3. The print is very light -- too light to read any of the code samples without extreme eye strain.
4. This book looks and feels counter-fit.
Top reviews from other countries
Auf dem Buch welches geliefert wurde, prangte bei mir unten rechts "Volume 2". Das hatte ich nicht bemerkt, als ich Amazon erstmals wegen des Gebrauchtcharakters anschrieb. Das Buch hatte oben einen eingerissenen Rücken, Eselsohren, beschmutzten Schnitt und war von allen Seiten bestoßen. Selbst in Antiquariaten finden sich besser erhaltene "Taschenbücher" (Softcover).
Einerlei, Amazon gibt die Seitenzahl mit 1680 an. Mein geliefertes Exemplar beginnt aber - eben ganz "Volume 2" - erst mit Kapitel 8 und Seite 835 (direkt unter dem Umschlag) und endet mit Seitennummer 1641 plus "Werbung" für das Buchsortiment des Verlags auf der Rückseite von 1641 und zwei weitere Blätter mit noch mehr "Werbung". Hier wurde also quasi ein halbes Buch (und dazu noch im Zustand gebraucht) ausgeliefert.
Seltsam ist auch der Satz, welcher schmierig und pixelig erscheint. Man sieht also die Punkte der Druckmatrix und das nicht nur bei Codebeispielen sondern auch im Lauftext. Alles sehr seltsam.
Ich habe Amazon von dieser Tatsache in Kenntnis gesetzt und eine Ersatzlieferung ist veranlaßt. Ich aktualisiere meine Rezension, sobald diese eintrifft. Aber Vorsicht: es kann sein, daß man nur Volume 1 ODER 2 geliefert bekommt, statt das vollständige Buch. Dessen sollte man sich offenbar bewußt sein. Offenbar gibt es aber auch das vollständige Buch mit über 1600 Seiten als ein Buch, wie man diversen Rezensionen entnehmen kann. Wie es hierzu kam, ist mir also rätselhaft.
IMHO you really do need a firm understanding of hardware architecture to get the most from this book.
In places this book reads like an academic course book, and can be too 'dry'.
Intel is covered, but not in great depth. The focus is really on G4 and G5 class.
I'm left wondering who the intended audience really is for this book.
So, it gets 5 stars for being the definitive Mac hardware reference, and 3 stars for being far too 'academic' in tone.







