Section 3.1. The World s Most Advanced Operating System


3.1. The World's Most Advanced Operating System

As discussed in Chapter 1, Mac OS X is the convoluted product of two parents: the original Mac OS and the NEXTSTEP operating system. For the most part, however, NEXTSTEP had the dominant genes, giving Mac OS X its Unix underpinnings and a significant portion of its system libraries. From the Mac OS of yesterday, Mac OS X inherited QuickTime, Carbon, and many other tools. Plus, Apple has developed several technologies that have made their debut on Mac OS X, like Spotlight, CoreAudio, and Quartz Extreme.

To understand how Mac OS X is structured, it's helpful to have an understanding of its components and their relationships with one another. Operating systems are made up of many small blocks that fit together like bricks in a wall, arranged in rows or layers. Figure 3-1 shows what a wall made of Mac OS X "bricks" might look like.

While Chapter 1 approached many of these topics from a historical perspective, the following sections will dissect and discuss Mac OS X from the bottom up.

Figure 3-1. A layered view of Mac OS X


3.1.1. Darwin

If you were to strip away all of the beauty of Aqua and all of the programming libraries Apple includes with Mac OS X, you'd be left with Darwin. As a matter of fact, you can even acquire Darwin in this raw form from Apple. While you won't be able to run iTunes on it without the rest of Mac OS X, Darwin still provides a capablethough spartancomputing environment, similar to a very basic install of Linux or FreeBSD .

At the core of Darwin is the Mach kernel . Mach is responsible for most of the low-level tasks on your system. It manages the CPU, scheduling, prioritizing, and sending instructions to your Mac's processor. It handles your Mac's memory, employing virtual memory when needed and ensuring applications can't overwrite each other's address spaces. It uses device driversor kernel extensions, in Mach parlanceto access hardware devices like hard disk drives and network cards. Essentially, the Mach kernel provides the bridge between the logical and the physical. It is the intermediary between the software and hardware that make up a Macintosh.

Around this powerful core, Apple has employed a highly modified version of FreeBSD. Although Mach has raw access to system hardware, it still needs some sort of abstraction to turn those raw bits into something meaningful. This is where the BSD components of Darwin take charge and provide logical structures such as networking sockets and process threads. This BSD wrapper provides the same kind of structure to Mach's raw data as consonants and vowels provide to the raw sounds of your voice box.

Darwin is what sets Mac OS X apart from previous generations of the Mac OS and makes it a Unix. Even though the Finder and other applications may look familiar from the Mac OS 9 days, what's going on behind the scenes has drastically changed, all the way down to the way the operating system talks to the hardware. Darwin provides a stable and reliable foundation for the rest of Mac OS X, much like the lowest layer of a brick wall supports the crushing force of the layers above it.

3.1.2. Core Foundation

Similar to how the BSD components of Darwin make sense of the raw bits handled by the Mach kernel, the Core Foundation of Mac OS X provides structure to the bytes coming out of the Darwin layer. Or, carrying on with the analogy of speech, this layer of the operating system structures data similar to how words are made up of letters. Part of Core Foundation's responsibility is to employ a set of common data types to be used by the various programming libraries, allowing data to move seamlessly between different processes on the system. In addition, the Core Foundation layer implements features like process management and simple access to network and I/O data streams.

3.1.3. Application and Multimedia Services

Sitting above the Core Foundation layer is a series of technologies designed to make programmers' lives easier. These interfaces provide developers with an optimized, standardized, and robust set of tools to accomplish common programming tasks. For example, prior to Mac OS X 10.2, many applications kept a unique and often proprietary set of information pertaining to a user's contacts. When you opened your email client, its address book was a separate affair from any other application's address book. By including a centralized repository for contact information and giving programmers a way to access and extend it, Apple made life easier for the user, who no longer has to detail his contacts within each program, and for developers, who get all of that information and capability "for free."

Mac OS X includes a lot of these complimentary and complementary tools. You can find some information on the more prevalent ones below:


CoreAudio

Introduced with Mac OS X Panther, CoreAudio offers developers a way to get great audio out of the Mac without having to reinvent the wheel. Apple designed CoreAudio to have a very low latency as well as to be extensible. CoreAudio is a modular system for which programmers can create special Audio Units. Audio Units provide effects processing, such as reverberation or equalization. And since CoreAudio has such a low latency, these types of effects can be applied in real time to an audio signal. CoreAudio also includes libraries for sequencing MIDI data, encoding and decoding audio streams, and converting between different audio formats.


CoreImage and CoreVideo

New to Tiger, CoreImage does for pictures what CoreAudio does for sound. CoreImage's Image Units can be used to apply various types of filters to an image, such as sharpening an image or making it black and white. Like CoreAudio, these filters are applied in real time to the image. As a matter of fact, Mac OS X can apply these filters so quickly that CoreImage's sibling, CoreVideo, can take advantage of the effects in real time as well. While still a nascent technology, it's not difficult to see how CoreImage and CoreVideo can give new power to applications like Adobe's Photoshop or Apple's own Final Cut Pro.


QuickTime

Apple's venerable media player is more than just an application sitting on your Mac's hard drive. Developers can work the power of QuickTime into their own applications using the QuickTime APIs. Capable of handling a variety of audio, image, and video formats, QuickTime is used heavily within many applications, including the popular iTunes and iLife suite.


Spotlight

Not all of the services present in Mac OS X are based around multimedia. Also new to Tiger, the Spotlight libraries enable programmers to not only harness the power of Spotlight searching in their applications, but also to extend Spotlight to work with their custom file formats. Looking ahead, Mac users may reach a point where a file's location on a drive simply won't matter, much as iLife users don't have to worry about where their audio files or digital pictures are stored. No more having to remember where you stored that important documentfuture Spotlight-enabled applications will extract the files from the filesystem.


Sync Services

Another library making its debut in Tiger, Sync Services are used by developers to synchronize an application's data using Apple's .Mac service. While iSync was used by Apple's apps in the past for this purpose, Sync Services are now exposed to developers and can be employed within their applications as well.


WebKit

WebKit is the powerful HTML processing engine that the Safari web browser uses to render web sites. Many applications in Tiger have taken advantage of WebKit as well, such as the new Mail. In addition, third-party developers have started to employ WebKit, for example, the Omni Group's OmniWeb browser.

3.1.4. Application Environments

Mac OS X includes several different application environments that developers can use to create their software. Application environments make up the most basic libraries and data structures that programmers can use. In many ways, the application environment is where the magic of Mac OS X development happens. Programmers pick an environment with which they are familiar or, in some cases, one that works best for a given task. For programmers coming from Mac OS 9 and earlier, they're likely used to using Carbon . Since Carbon is available on both Mac OS 9 and Mac OS X, applications written using Carbon can be run on either underlying OS, making it easy for developers to port an app from the OS of yesteryear.

For those developers who are new to Mac programming, Apple recommends using Cocoa . Cocoa was the application environment used in NEXTSTEP and is perhaps more "native" to Mac OS X. Before Mac OS X was on Apple's radar, NEXTSTEP was hailed for its easy programming environments. As mentioned in Chapter 1, NEXTSTEP was used by Tim Berners-Lee to create the first web browser and web server.

In addition to the Cocoa and Carbon application environments, Mac OS X has Java and POSIX environments. For many computer users, their only exposure to Java comes in the form of applets found on the Web. However, full-fledged applications can be written in Java and can run alongside other Mac OS X apps. Apple also includes a bridge between Java and Cocoa, though it hasn't been used in many applications.

The POSIX environment is provided for developers who are writing applications that conform to the POSIX standard. This includes software that runs in the X11 environment and other software that can trace its roots in Unix programming. The inclusion of a POSIX environment is what enables Mac OS X to run Unix applications after a simple recompile and what empowers projects like Fink and DarwinPorts (both discussed in Chapter 2).

3.1.5. Aqua

The top-most layer of Mac OS X is that with which you are most familiar. Mac OS X's user interface has been described as "lickable," and even if it might not pleasure one's taste buds, it's certainly a joy to look at. This beauty is provided by Aqua, Mac OS X's graphical user interface and the successor to Platinum. Aqua is rendered using the Quartz engine, which uses PDF technologies to move data to the screen. On Macs that support it, Quartz is accelerated using your Mac's video card, and thus is known as Quartz Extreme.




Running Mac OS X Tiger
Running Mac OS X Tiger: A No-Compromise Power Users Guide to the Mac (Animal Guide)
ISBN: 0596009135
EAN: 2147483647
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net