A2A I can’t say there’s a best one, as there are so many and they run from lightweight (Tkinter) to enterprise-ready (PyQt) and mobile-oriented (Kivy). I’d recommend trying Tkinter first to see if it provides what you need. If not, then look at wx. NOV Framework Overview NOV provides the solid foundations that are needed for a presentation layer that is 100% identical on Windows (WinForms and WPF), Silverlight and Mac OS X (MonoMac and Xamarin.Mac). Net framework 3 5 free download - Apple Mac OS Update 8.6, Apple Mac OS Update 9.0.4, Karaoke 5, and many more programs.
The OS X frameworks provide the interfaces you need to write software for Mac. Some of these frameworks contain simple sets of interfaces while others contain multiple subframeworks. Where applicable, the tables in this appendix list the key prefixes used by the classes, methods, functions, types, or constants of the framework. You should avoid using any of the specified prefixes in your own symbol names.
System Frameworks
Table A-1 describes the frameworks located in the /System/Library/Frameworks
directory and lists the first version of OS X in which each became available.
Name | First available | Prefixes | Description | |||
---|---|---|---|---|---|---|
| 10.3 |
| Umbrella framework for vector-optimized operations. See Accelerate Framework. | |||
| 10.8 |
| Provides access to user accounts stored in the Accounts database. See Accounts Framework Reference. | |||
| 10.2 |
| Provides access to the Address Book, which is a centralized database of user contact information. Apps that target OS X v10.11 or greater should use | |||
| 10.0 |
| Contains Carbon interfaces for OpenGL. See AGL Reference. | |||
| 10.0 |
| Contains classes and methods for the Cocoa user-interface layer. In general, link to | |||
| 10.0 | N/A | Deprecated. Use | |||
| 10.0 |
| Contains interfaces for creating AppleScript plug-ins. | |||
| 10.6 |
| Contains Objective-C extensions for creating AppleScript plug-ins. | |||
| 10.0 |
| Umbrella framework for several app-level services. See Application Services Framework. | |||
| 10.0 |
| Contains interfaces for getting audio stream data, routing audio signals through audio units, converting between audio formats, and playing back music. See Audio Toolbox Framework Reference. | |||
| 10.0 |
| Contains interfaces for defining Core Audio plug-ins. See Audio Unit Framework Reference. | |||
| 10.8 |
| Supports Audio Video Bridging (AVB) and implements the IEEE P1722.1 draft standard. | |||
| 10.4 |
| Umbrella framework for creating Automator plug-ins. See Automator Framework. | |||
| 10.7 |
| Provides interfaces for playing, recording, inspecting, and editing audiovisual media. See AVFoundation Audio Functions. | |||
| 10.9 |
| Provides API for media playback including user controls, chapter navigation, subtitles, and closed captioning. See AV Kit Framework Reference | |||
| 10.5 |
| Deprecated. Use Event Kit instead. See Event Kit. | |||
| 10.0 |
| Umbrella framework for Carbon-level services. See Carbon Framework. | |||
| 10.3 |
| Contains interfaces for network communication using HTTP, sockets, and Bonjour. See CFNetwork Framework Reference. | |||
| 10.10 |
| Provides a conduit for moving data between your app and iCloud that can be used for all types of data. It also gives you control of when transfers occur. See CloudKit Quick Start or CloudKit Framework Reference. | |||
| 10.0 |
| Wrapper for including the Cocoa frameworks | |||
| 10.5 |
| Contains interfaces for managing identity information. See Collaboration Framework Reference. | |||
| 10.11 |
| Provides access to the Contacts store, which is a centralized database of user contact information. See Contacts Framework Reference. | |||
| 10.0 |
| Contains the hardware abstraction layer interface for manipulating audio. See Core Audio Framework Reference. | |||
| 10.10 |
| Contains the classes used for communicating with Bluetooth Low Energy devices. See Core Bluetooth Framework Reference | |||
| 10.4 |
| Contains Objective-C interfaces for audio unit custom views. See CoreAudioKit Framework Reference. | |||
| 10.4 |
| Contains interfaces for managing your app’s data model. See Core Data Framework Reference. | |||
| 10.0 |
| Provides fundamental software services, including abstractions for common data types, string utilities, collection utilities, plug-in support, resource management, preferences, and XML parsing. See Core Foundation Framework Reference. | |||
| 10.0 |
| Contains the Quartz interfaces for creating graphic content and rendering that content to the screen. See Core Graphics Framework Reference. | |||
| 10.4 |
| An image processing and analysis technology designed to provide near real-time processing for still and video images. See Core Image Programming Guide. | |||
| 10.6 |
| Provides interfaces for determining the geographical location of a computer. See Core Location Framework Reference. | |||
| 10.7 |
| Contains low-level interfaces for for managing and and playing audio-visual media in an app. See Core Media Framework Reference. | |||
| 10.7 |
| Contains interfaces of the Device Abstraction Layer (DAL) used for creating plug-ins that can access media hardware. | |||
| 10.0 |
| Contains utilities for implementing MIDI client programs. See Core MIDI Framework Reference. | |||
| 10.0 |
| Deprecated in OS X v10.6. Use | |||
| 10.0 |
| Umbrella framework for system-level services. See Core Services Framework. | |||
| 10.5 |
| Contains the interfaces for performing text layout and display. See Core Text Reference Collection. | |||
| 10.5 |
| Contains interfaces for managing video-based content. See Core Video Framework Reference. | |||
| 10.6 |
| Contains interfaces for managing wireless networks. See CoreWLAN Framework Reference. | |||
| 10.10 |
| Contains interface for using smart cards. See CryptoTokenKit Framework Reference. | |||
| 10.0 |
| Deprecated in OS X v10.6. Use | |||
| 10.2 |
| Contains interfaces for burning data to CDs and DVDs. See Disc Recording Framework Reference. | |||
| 10.2 |
| Contains the user interface layer for interacting with users during the burning of CDs and DVDs. See Disc Recording UI Framework Reference. | |||
| 10.4 |
| Contains interfaces for getting information related to local and remote volumes. See Disk Arbitration Framework Reference. | |||
| 10.0 |
| Contains the game sprocket component for drawing content to the screen. | |||
| 10.0 |
| Contains interfaces for communicating with digital video devices, such as video cameras. | |||
| 10.3 |
| Contains interfaces for embedding DVD playback features into your app. See DVD Playback Framework Reference. | |||
| 10.8 |
| Provides an interface for accessing a user’s calendar events and reminder items. See Event Kit Framework Reference. | |||
| 10.0 |
| Contains exception-handling classes for Cocoa apps. See Exception Handling Framework Reference. | |||
| 10.10 |
| Provides API for enhancing the Finder’s user interface by adding badges, shortcut menu items, and toolbar buttons. See Finder Sync Framework Reference | |||
| 10.2 |
| Contains interfaces for communicating with force feedback–enabled devices. See Force Feedback Framework Reference. | |||
| 10.0 |
| Contains the classes and methods for the Cocoa Foundation layer. If you are creating a Cocoa app, linking to the Cocoa framework is preferable. See Foundation Framework Reference. | |||
| 10.2 |
| Contains interfaces for communicating with FireWire-based audio devices. See FWAUserLib.h Reference. | |||
| 10.9 |
| A collection of classes for discovering and interacting with connected game controllers. See Game Controller Programming Guide | |||
| 10.8 |
| Provides APIs that allow your app to participate in Game Center. See Game Kit Framework Reference. | |||
| 10.8 |
| Provides functions and classes that reduce the effort required to create new shader-based apps or to port existing apps that rely on fixed-function vertex or fragment processing provided by earlier versions of OpenGL ES or OpenGL. See GLKit Framework Reference. | |||
| 10.0 |
| Contains interfaces for the OpenGL Utility Toolkit, which provides a platform-independent interface for managing windows. | |||
| 10.7 |
| Contains interfaces for Generic Security Services Application Program Interface (GSSAPI). | |||
| 10.10 |
| Allows virtualization vendors to build virtualization solutions on top of OS X without needing to deploy third-party kernel extensions (KEXTs). See Hypervisor Framework Reference. | |||
| 10.3 |
| Contains low-level interfaces for communicating with digital devices such as scanners and cameras. See Carbon Framework. | |||
| 10.6 |
| Contains Objective-C interfaces for communicating with digital devices such as scanners and cameras. | |||
| 10.4 |
| Contains interfaces for importing and exporting image data. | |||
| 10.7 |
| Contains interfaces for building third-party plug-ins for Chat services. Umbrella framework for | |||
| 10.5 |
| Contains interfaces for developing new input methods, which are modules that handle text entry for complex languages. See Input Method Kit Framework Reference. | |||
| 10.4 |
| Contains interfaces for creating plug-ins that run during software installation sessions. See Installer JavaScript Reference. | |||
| 10.4 |
| Deprecated in OS X v10.9. Do not use. | |||
| 10.2 |
| Contains interfaces for communicating with Bluetooth devices. | |||
| 10.2 |
| Contains the user interface layer for interacting with users manipulating Bluetooth devices. | |||
| 10.0 |
| Contains the main interfaces for creating user-space device drivers and for interacting with kernel-resident drivers from user space. See IOKitLib.h Reference. | |||
| 10.6 |
| Contains low-level interfaces for sharing graphics surfaces between apps. See IOSurface Framework Reference. | |||
| 10.5 | N/A | Contains interfaces for embedding Java frames in Objective-C code. | |||
| 10.5 |
| Contains the library and resources for executing JavaScript code within an HTML page. (Prior to OS X v10.5, this framework was part of | |||
| 10.0 |
| Deprecated in OS X v10.7. Use Oracle Java instead. | |||
| 10.0 |
| Contains interfaces for using the Kerberos network authentication protocol. | |||
| 10.0 | numerous | Contains the interfaces for kernel-extension development, including Mach, BSD, | |||
| 10.5 |
| Contains interfaces for classifying text based on latent semantic information. See Latent Semantic Mapping Reference. | |||
| 10.0 | N/A | Do not use. | |||
| 10.10 |
| Contains API for requesting authentication from users using specified policies. See Local Authentication Framework Reference | |||
| 10.9 |
| Provides classes and protocols for embedding maps into the windows and views of your apps. Includes support for annotations, overlays, and reverse-geocoding lookups. See Map Kit Framework Reference | |||
| 10.9 |
| Provides API to access user preferences for captions that can accompany media, such as closed captioning. See Media Accessibility Framework Reference | |||
| 10.9 |
| Provides a read-only data model representing a user’s collections of images, audio, and video. See Media Library Framework Reference | |||
| 10.0 |
| Contains Cocoa extensions for mail delivery. | |||
| 10.11 | MTL | Provides GPU-accelerated 3D graphics rendering and>
| 10.11 | MTK | Contains functions and classes that reduce the effort required to create a Metal application. See MetalKit Framework Reference and MetalKit Functions Reference. |
| 10.11 | MDL | Provides classes that support import, export, and editing of 3D model assets and related resources. See ModelIO Framework Reference. | |||
| 10.10 |
| Contains API for finding and communicating with services provided by nearby devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks. See Multipeer Connectivity Framework Reference. | |||
| 10.6 |
| Contains interfaces for working with network file systems. | |||
| 10.11 |
| Provides support for configuring and controlling Virtual Private Network (VPN) tunnels. See Network Extension Framework Reference. | |||
| 10.10 |
| Contains the interfaces for creating and managing extensions in the Today view of the Notification Center. See Notification Center Framework Reference | |||
| 10.4 |
| Contains the interfaces for OpenAL, a cross-platform 3D audio delivery library. | |||
| 10.6 |
| Contains the interfaces for distributing general-purpose computational tasks across the available GPUs and CPUs of a computer. See OpenCL Programming Guide for Mac. | |||
| 10.6 |
| Contains Objective-C interfaces for managing Open Directory information. See Open Directory Programming Guide. | |||
| 10.0 |
| Contains the interfaces for OpenGL, which is a cross-platform 2D and 3D graphics rendering library. See OpenGL Programming Guide for Mac. | |||
| 10.4 |
| Contains Objective-C interfaces for managing and executing OSA-compliant scripts from Cocoa apps. | |||
| 10.0 |
| Contains interfaces for interacting with smart card devices. | |||
| 10.0 |
| Contains interfaces for implementing custom modules for the System Preferences app. See Preference Panes Framework Reference. | |||
| 10.5 |
| Contains interfaces for subscribing to RSS and Atom feeds. See Publication Subscription Framework Reference. | |||
| 10.4 |
| Deprecated in OS X v10.9. Use | |||
| 10.4 |
| Umbrella framework for Quartz services. See Quartz Framework. | |||
| 10.4 |
| Contains the interfaces for Core Image, Core Animation, and Core Video. See Quartz Core Framework Reference. | |||
| 10.5 |
| Contains interfaces for generating thumbnail previews of documents. See Quick Look Framework Reference for Mac. | |||
| 10.0 | N/A | Deprecated in OS X v10.9. Use | |||
| 10.5 | N/A | Contains interfaces for the Ruby scripting language. | |||
| 10.8 |
| Provides a high-level, Objective-C API to efficiently load, manipulate, and render 3D scenes in an app. See SceneKit Framework Reference. | |||
| 10.0 | N/A | Contains interfaces for writing screen savers. See Screen Saver Framework Reference. | |||
| 10.0 |
| Deprecated. Use | |||
| 10.5 |
| Contains interfaces for running scripts from Objective-C code. See Scripting Bridge Framework Reference. | |||
| 10.0 |
| Contains interfaces for system-level user authentication and authorization. See Security Framework Reference. | |||
| 10.3 |
| Contains Cocoa interfaces for authorizing users. See Security Foundation Framework Reference. | |||
| 10.3 |
| Contains the user interface layer for authorizing users in Cocoa apps. See Security Interface Framework Reference. | |||
| 10.6 |
| Contains interfaces for loading, unloading and managing | |||
| 10.8 |
| Provides an API for sending requests to supported social networking services that can perform operations on behalf of users. See Social Framework Reference. | |||
| 10.9 |
| Provides API for animating arbitrary textured images, or sprites. It includes sound playback, a physics engine, and a rendering loop. See SpriteKit Programming Guide | |||
| 10.7 |
| Supports requesting payment from a user to purchase additional functionality or content from the Mac App Store. See Store Kit Framework Reference. | |||
| 10.4 |
| Deprecated in OS X v10.7. Use | |||
| 10.0 | N/A | Do not use. | |||
| 10.0 |
| Contains interfaces for accessing network configuration and reachability information. See System Configuration Framework Reference. | |||
| 10.3 |
| Contains interfaces for accessing the system’s Tcl interpreter from an app. | |||
| 10.4 |
| Contains interfaces for accessing the system’s Tk toolbox from an app. | |||
| 10.2 |
| Contains interfaces for accessing TWAIN-compliant image-scanning hardware. | |||
| 10.0 | N/A | Deprecated. Use | |||
| 10.7 |
| Deprecated in OS X v10.11. Use | |||
| 10.8 |
| Comprises the 64-bit replacement for the QuickTime Image Compression Manager. | |||
| 10.2 |
| Umbrella framework for rendering HTML content. See WebKit Framework. | |||
| 10.4 |
| Deprecated in OS X v10.8. Contains interfaces for connecting to and managing computing cluster software. |
OS X contains several umbrella frameworks for major areas of functionality. Umbrella frameworks group several related frameworks into a larger framework that can be included in your project. When writing software, link your project against the umbrella framework; do not try to link directly to any of its subframeworks. The following sections describe the contents of the umbrella frameworks in OS X.
Accelerate Framework
Table A-2 lists the subframeworks of the Accelerate framework (Accelerate.framework
). If you are developing apps for earlier versions of OS X, vecLib.framework
is available as a standalone framework.
Subframework | Description |
---|---|
| Contains vector-optimized interfaces for performing math, big-number, and DSP calculations, among others. |
| Contains vector-optimized interfaces for manipulating image data. |
Application Services Framework
Table A-3 lists the subframeworks of the Application Services framework (ApplicationServices.framework
) that are not links to top level frameworks. These frameworks provide C-based interfaces and are intended primarily for Carbon apps, although other programs can use them. The listed frameworks are available in all versions of OS X unless otherwise noted.
Subframework | Description |
---|---|
| Deprecated in OS X v10.8. Use |
| Contains interfaces for color matching using ColorSync. |
| Contains interfaces for accessibility, Internet Config, the pasteboard, the Process Manager, and the Translation Manager. Available in OS X v10.2 and later. |
| Contains the Language Analysis Manager interfaces. |
| Contains the Core Printing Manager interfaces. |
| Contains the QuickDraw interfaces. |
| Contains the Speech Manager interfaces. |
Automator Framework
Table A-4 lists the subframeworks of the Automator framework (Automator.framework
).
Subframework | Description |
---|---|
| Contains private interfaces for managing Automator plug-ins. |
Carbon Framework
Table A-5 lists the subframeworks of the Carbon framework (Carbon.framework
). The listed frameworks are available in all versions of OS X unless otherwise noted.
Subframework | Description |
---|---|
| Deprecated in OS X v10.5. Use |
| Contains interfaces for displaying the Font window, Color window, and some network-related dialogs. |
| Contains interfaces for launching and searching Apple Help. |
| Deprecated in OS X v10.7. Use |
| Contains interfaces for rendering HTML content. The WebKit framework is the preferred framework for HTML rendering. See WebKit Framework. |
| Contains interfaces for capturing images from digital cameras. This framework works in conjunction with the Image Capture Devices framework ( |
| Contains interfaces for managing pen-based input. (Ink events are defined with the Carbon Event Manager.) |
| Contains interfaces for displaying file navigation dialogs. |
| Contains interfaces for writing scripting components and interacting with those components to manipulate and execute scripts. |
| Contains the Carbon Printing Manager interfaces for displaying printing dialogs and extensions. |
| Deprecated in OS X v10.9. Use |
| Contains the Speech Recognition Manager interfaces. |
Core Services Framework
Table A-6 lists the subframeworks of the Core Services framework (CoreServices.framework
). These frameworks provide C-based interfaces and are intended primarily for Carbon apps, although other programs can use them. The listed frameworks are available in all versions of OS X unless otherwise noted.
Subframework | Description |
---|---|
| Contains interfaces for creating and manipulating Apple events and making apps scriptable. |
| Contains interfaces for many legacy Carbon Managers. Most of the APIs in this framework are deprecated in OS X v10.8 (for more information, see Carbon Core Deprecations). |
| Provides dictionary lookup capabilities. |
| Provides a mechanism to notify clients about directories to re-scan to keep internal data structures up-to-date with the true state of the file system. |
| Contains interfaces for launching apps. |
| Contains interfaces for managing Spotlight metadata. |
| Contains interfaces for Open Transport and many hardware-related legacy Carbon managers. |
| Contains interfaces for the Search Kit. |
Quartz Framework
Table A-7 lists the subframeworks of the Quartz framework (Quartz.framework
).
Subframework | Description |
---|---|
| Contains Objective-C interfaces for finding, browsing, and displaying images. |
| Contains Objective-C interfaces for displaying and managing PDF content. |
| Contains Objective-C interfaces for playing Quartz Composer compositions in an app. |
| Contains Objective-C interfaces for managing and applying filter effects to a graphics context. |
| Contains Objective-C interfaces for creating and managing a Quick Look preview panel, which is a UI object that displays preview items. |
WebKit Framework
Table A-8 lists the subframeworks of the WebKit framework (WebKit.framework
).
Subframework | Description |
---|---|
| Contains the library and resources for rendering HTML content in an HTMLView control. |
Xcode Frameworks
Xcode and all of its supporting tools and libraries reside in a portable directory structure. This directory structure makes it possible to have multiple versions of Xcode installed on a single system or to have Xcode installed on a portable hard drive that you plug in to your computer when you need to do development. This portability means that the frameworks required by the developer tools are installed in the <Xcode>/Library/Frameworks
directory, where <Xcode>
is the path to the Xcode installation directory. Table A-9 lists the frameworks that are located in this directory.
Framework | First available | Prefixes | Description |
---|---|---|---|
| Xcode 5 |
| Interfaces for implementing unit tests in Objective-C. |
System Libraries
Some specialty libraries at the BSD level are not packaged as frameworks. Instead, OS X includes many dynamic libraries in the /usr/lib
directory and its subdirectories. Dynamic shared libraries are identified by their .dylib
extension. Header files for the libraries are located in the /usr/include
directory.
OS X uses symbolic links to point to the most current version of most libraries. When linking to a dynamic shared library, use the symbolic link instead of a link to a specific version of the library. Library versions may change in future versions of OS X. If your software is linked to a specific version, that version might not always be available on the user’s system.
Copyright © 2004, 2015 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2015-09-16
Those of you who are already familiar with writing device drivers for Mac OS 9 or for BSD will discover that writing drivers for OS X requires some new ways of thinking. In creating OS X, Apple has completely redesigned the Macintosh I/O architecture, providing a framework for simplified driver development that supports many categories of devices. This framework is called the I/O Kit.
From a programming perspective, the I/O Kit provides an abstract view of the system hardware to the upper layers of OS X. The I/O Kit uses an object-oriented programming model, implemented in a restricted subset of C++ to promote increased code reuse.
By starting with properly designed base classes, you gain a head start in writing a new driver; with much of the driver code already written, you need only to fill in the specific code that makes your driver different. For example, all SCSI controllers deliver a fairly standard set of commands to a device, but do so via different low-level mechanisms. By properly using object-oriented programming methodology, a SCSI driver can implement those low-level transport portions without reimplementing the higher level SCSI protocol code. Similar opportunities for code reuse can be found in most types of drivers.
Part of the philosophy of the I/O Kit is to make the design completely open. Rather than hiding parts of the API in an attempt to protect developers from themselves, all of the I/O Kit source is available as part of Darwin. You can use the source code as an aid to designing (and debugging) new drivers.
Instead of hiding the interfaces, Apple’s designers have chosen to lead by example. Sample code and classes show the recommended (easy) way to write a driver. However, you are not prevented from doing things the hard way (or the wrong way). Instead, attention has been concentrated on making the “best” ways easy to follow.
Redesigning the I/O Model
You might ask why Apple chose to redesign the I/O model. At first glance, it might seem that reusing the model from Mac OS 9 or FreeBSD would have been an easier choice. There are several reasons for the decision, however.
Neither the Mac OS 9 driver model nor the FreeBSD model offered a feature set rich enough to meet the needs of OS X. The underlying operating-system technology of OS X is very different from that of Mac OS 9. The OS X kernel is significantly more advanced than the previous Mac OS system architecture; OS X needs to handle memory protection, preemption, multiprocessing, and other features not present (or substantially less pervasive) in previous versions of the Mac OS.
Although FreeBSD supports these features, the BSD driver model did not offer the automatic configuration, stacking, power management, or dynamic device-loading features required in a modern, consumer-oriented operating system.
By redesigning the I/O architecture, Apple’s engineers can take best advantage of the operating-system features in OS X. For example, virtual memory (VM) is not a fundamental part of the operating system in Mac OS 9. Thus, every driver writer must know about (and write for) VM. This has presented certain complications for developers. In contrast, OS X has simplified driver interaction with VM. VM capability is inherent in the OS X operating system and cannot be turned off by the user. Thus, VM capabilities can be abstracted into the I/O Kit, and the code for handling VM need not be written for every driver.
OS X offers an unprecedented opportunity to reuse code. In Mac OS 9, for example, all software development kits (SDKs) were independent of each other, duplicating functionality between them. In OS X, the I/O Kit is delivered as part of the basic developer tools, and code is shared among its various parts.
In contrast with traditional I/O models, the reusable code model provided by the I/O Kit can decrease your development work substantially. In porting drivers from Mac OS 9, for example, the OS X counterparts have been up to 75% smaller.
In general, all hardware support is provided directly by I/O Kit entities. One exception to this rule is imaging devices such as printers, scanners, and digital cameras (although these do make some use of I/O Kit functionality). Specifically, although communication with these devices is handled by the I/O Kit (for instance, under the FireWire or USB families), support for particular device characteristics is handled by user-space code (see For More Information for further discussion). If you need to support imaging devices, you should employ the appropriate imaging software development kit (SDK).
The I/O Kit attempts to represent, in software, the same hierarchy that exists in hardware. Some things are difficult to abstract, however. When the hardware hierarchy is difficult to represent (for example, if layering violations occur), then the I/O Kit abstractions provide less help for writing drivers.
In addition, all drivers exist to drive hardware; all hardware is different. Even with the reusable model provided by the I/O Kit, you still need to be aware of any hardware quirks that may impact a higher-level view of the device. The code to support those quirks still needs to be unique from driver to driver.
Although most developers should be able to take full advantage of I/O Kit device families (see Families), there will occasionally be some who cannot. Even those developers should be able to make use of parts of the I/O Kit, however. In any case, the source code is always available. You can replace functionality and modify the classes yourself if you need to do so.
In designing the I/O Kit, one goal has been to make developers’ lives easier. Unfortunately, it is not possible to make all developers’ lives uniformly easy. Therefore, a second goal of the I/O Kit design is to meet the needs of the majority of developers, without getting in the way of the minority who need lower level access to the hardware.
I/O Kit Architecture
The I/O Kit provides a model of system hardware in an object-oriented framework. Each type of service or device is represented by a C++ class; each discrete service or device is represented by an instance (object) of that class.
There are three major conceptual elements of the I/O Kit architecture:
Families
A family defines a collection of high-level abstractions common to all devices of a particular category that takes the form of C code and C++ classes. Families may include headers, libraries, sample code, test harnesses, and documentation. They provide the API, generic support code, and at least one example driver (in the documentation).
Families provide services for many different categories of devices. For example, there are protocol families (such as SCSI, USB, and FireWire), storage families (disk), network families, and families to describe human interface devices (mouse and keyboard). When devices have features in common, the software that supports those features is most likely found in a family.
Common abstractions are defined and implemented by the family, allowing all drivers in a family to share similar features easily. For example, all SCSI controllers have certain things they must do, such as scanning the SCSI bus. The SCSI family defines and implements the functionality that is common to SCSI controllers. Because this functionality has been included in the SCSI family, you do not need to include scanning code (for example) in your new SCSI controller driver.
Instead, you can concentrate on device-specific details that make your driver different from other SCSI drivers. The use of families means there is less code for you to write.
Families are dynamically loadable; they are loaded when needed and unloaded when no longer needed. Although some common families may be preloaded at system startup, all families should be considered to be dynamically loadable (and, therefore, potentially unloaded). See the Connection Example for an illustration.
Drivers
A driver is an I/O Kit object that manages a specific device or bus, presenting a more abstract view of that device to other parts of the system. When a driver is loaded, its required families are also loaded to provide necessary, common functionality. The request to load a driver causes all of its dependent requirements (and their requirements) to be loaded first. After all requirements are met, the requested driver is loaded as well. See Connection Example for an illustration.
Note that families are loaded upon demand of the driver, not the other way around. Occasionally, a family may already be loaded when a driver demands it; however, you should never assume this. To ensure that all requirements are met, each device driver should list all of its requirements in its property list.
Most drivers are in a client-provider relationship, wherein the driver must know about both the family from which it inherits and the family to which it connects. A SCSI controller driver, for example, must be able to communicate with both the SCSI family and the PCI family (as a client of PCI and provider of SCSI). A SCSI disk driver communicates with both the SCSI and storage families.
Nubs
A nub is an I/O Kit object that represents a point of connection for a driver. It represents a controllable entity such as a disk or a bus.
A nub is loaded as part of the family that instantiates it. Each nub provides access to the device or service that it represents and provides services such as matching, arbitration, and power management.
The concept of nubs can be more easily visualized by imagining a TV set. There is a wire attached to your wall that provides TV service from somewhere. For all practical purposes, it is permanently associated with that provider, the instantiating class (the cable company who installed the line). It can be attached to the TV to provide a service (cable TV). That wire is a nub.
Each nub provides a bridge between two drivers (and, by extension, between two families). It is most common that a driver publishes one nub for each individual device or service it controls. (In this example, imagine one wire for every home serviced by the cable company.)
It is also possible for a driver that controls only a single device or service to act as its own nub. (Imagine the antenna on the back of your TV that has a built-in wire.) See the Connection Example for an illustration of the relationship between nubs and drivers.
Connection Example
Figure 12-1 illustrates the I/O Kit architecture, using several example drivers and their corresponding nubs. Note that many different driver combinations are possible; this diagram shows only one possibility.
In this case, a SCSI stack is shown, with a PCI controller, a disk, and a SCSI scanner. The SCSI disk is controlled by a kernel-resident driver. The SCSI scanner is controlled by a driver that is part of a user application.
This example illustrates how a SCSI disk driver (Storage family) is connected to the PCI bus. The connection is made in several steps.
The PCI bus driver discovers a PCI device and announces its presence by creating a nub (
IOPCIDevice
). The nub’s class is defined by the PCI family.The bus driver identifies (matches) the correct device driver and requests that the driver be loaded. At the end of this matching process, a SCSI controller driver has been found and loaded. Loading the controller driver causes all required families to be loaded as well. In this case, the SCSI family is loaded; the PCI family (also required) is already present. The SCSI controller driver is given a reference to the
IOPCIDevice
nub.The SCSI controller driver scans the SCSI bus for devices. Upon finding a device, it announces the presence of the device by creating a nub (
IOSCSIDevice
). The class of this nub is defined by the SCSI family.The controller driver identifies (matches) the correct device driver and requests that the driver be loaded. At the end of this matching process, a disk driver has been found and loaded. Loading the disk driver causes all required families to be loaded as well. In this case, the Storage family is loaded; the SCSI family (also required) is already present. The disk driver is given a reference to the
IOSCSIDevice
nub.
For More Information
For more information on the I/O Kit, you should read the document IOKit Fundamentals, available from Apple’s developer documentation website, http://developer.apple.com/documentation. It provides a good general overview of the I/O Kit.
Opencv Framework Mac Os X
In addition to IOKit Fundamentals, the website contains a number of HOWTO documents and topic-specific documents that describe issues specific to particular technology areas such as FireWire and USB.
Os X Version Mac For Free
Copyright © 2002, 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-08-08