Mac OS X and iOS Internals is the first major work covering OS X internals since Amit Singh’s very fine and well-known Mac OS X Internals: A Systems Approach. It is also an excellent alternative and companion to the iOS Hacker’s Handbook.
Levin’s stated ambition is to lay open the OS X’s core XNU and do for XNU what Bovet & Cesati’s Understanding the Linux Kernel, Third Edition does for Linux and Russinovich’s Windows Internals does for Windows (p. xxv). That’s very ambitious, but then Levin is an expert and consultant on the system and kernel levels of the «Big Three»—Windows, Linux, and OS X, and he has spent years researching for this book. The book covers OS X up to Lion and iOS up to iOS 5. Given Apple’s rapid-fire release schedule, being completely up to date is virtually impossible, so this is fine.
It is a magnificent book. It starts with a very interesting overview chapter entitled “Darwinism — The Evolution of OS X” which shows how OS X developed out of Mac OS Classic and NeXTSTEP and how it has since evolved. The second and third chapters too may be said to primarily provide an overview of structure and architecture of OS X and iOS – how the various elements of the OS are linked and how they depart from BSD. From there, the book digs deeper.
- The boot process: Mac’s EFI, iOS’s iBoot, and kernel startup
- Processes, threads, and virtual memory management
- Debugging and profiling, using DTrace, ptrace, and hidden system calls
- The system level APIs: POSIX calls, Mach traps, and OS X/iOS proprietary
- File system architecture, including VFS and HFS+
- Network architecture: from sockets to interfaces, and network drivers
- Kernel extensions, drivers, and a discussion of I/O Kit architecture
- Security features, Mandatory Access Control, and iOS jail
The book also has an interesting companion web site (link to the book website) that includes sample programs, freely downloadable tools, updated references, and bonus additions.
This is not a book for the average Mac or iPhone user wanting to learn how to use the device better: It is for system administrators, system-level developers, kernel mode developers, and perhaps even hackers and intrigued, tech-savvy Apple-lytes. In my opinion, Jonathan Levin has done a big, important and excellent job. Mac OS X and iOS Internals: To the Apple’s Core is dense, versatile and very information packed. If you want to dive deep and get real close, this is it!