Kernel and Device Drivers Layer

The lowest layer of OS X includes the kernel, drivers, and BSD portions of the system and is based primarily on open up source technologies. Os X extends this low-level surround with several cadre infrastructure technologies that make information technology easier for you to develop software.

../art/osx_architecture-kernels_drivers_2x.png

High-Level Features

The following sections describe features in the Kernel and Device Drivers layer of OS 10.

XPC Interprocess Advice and Services

XPC is an Os X interprocess communication technology that complements App Sandbox past enabling privilege separation. Privilege separation, in turn, is a evolution strategy in which you dissever an app into pieces according to the system resource access that each slice needs. The component pieces that you create are called XPC services.

You create an XPC service as an private target in your Xcode projection. Each service gets its own sandbox—specifically, information technology gets its own container and its own set of entitlements. In addition, an XPC service that you lot include with your app is attainable only by your app. These advantages add together upwardly to making XPC the best technology for implementing privilege separation in an Bone Ten app.

XPC is integrated with Thousand Fundamental Dispatch (GCD). When you create a connectedness, you associate it with a dispatch queue on which message traffic executes.

When the app is launched, the arrangement automatically registers each XPC service it finds into the namespace visible to the app. An app establishes a connection with 1 of its XPC services and sends it messages containing events that the service then handles.

For more on XPC Services, read Creating XPC Services in Daemons and Services Programming Guide. To larn more than about App Sandbox, read App Sandbox Design Guide.

Caching API

The libcache API is a low-level purgeable caching API. Ambitious caching is an important technique in maximizing app performance. However, when caching demands exceed available memory, the system must costless up memory as necessary to handle new demands. Typically, this ways paging buried data to and from relatively tiresome storage devices, sometimes even resulting in systemwide performance degradation. Your app should avoid potential paging overhead past actively managing its information caches, releasing them every bit before long as information technology no longer needs the cached data.

In the wider organization context, your app can also help by creating caches that the operating arrangement tin merely purge on a priority basis as retentivity pressure necessitates. The libcache library and Foundation framework's NSCache class aid you to create these purgeable caches.

For more information about the functions of the libcache library, see libcache Reference . For more than information almost the NSCache class, see NSCache Class Reference.

In-Kernel Video Capture

I/O Video provides a kernel-level C++ programming interface for writing video capture device drivers. I/O Video replaces the QuickTime sequence grabber API equally a ways of getting video into Os X.

I/O Video consists of the IOVideoDevice class on the kernel side (along with various related minor classes) that your driver should subclass, and a user infinite device interface for communicating with the driver.

For more information, meet the IOVideoDevice.h header file in the Kernel framework.

The Kernel

Beneath the appealing, easy-to-employ interface of Os X is a stone-solid, UNIX-based foundation that is engineered for stability, reliability, and performance. The kernel environment is built on top of Mach 3.0 and provides high-performance networking facilities and back up for multiple, integrated file systems.

The following sections describe some of the key features of the kernel and driver portions of Darwin.

Mach

Mach is at the heart of Darwin because it provides some of the most critical functions of the operating system. Much of what Mach provides is transparent to apps. Information technology manages processor resources such equally CPU usage and retentivity, handles scheduling, enforces memory protection, and implements a messaging-centered infrastructure for untyped interprocess communication, both local and remote. Mach provides the post-obit important advantages to Mac computing:

  • Protected retentiveness. The stability of an operating system should not depend on all executing apps being expert citizens. Even a well-behaved process can accidentally write information into the address space of the system or some other procedure, which can effect in the loss or corruption of data or even precipitate system crashes. Mach ensures that an app cannot write in another app's retentivity or in the operating arrangement's retention. By walling off apps from each other and from system processes, Mach makes it virtually incommunicable for a single poorly behaved app to damage the rest of the system. All-time of all, if an app crashes as the result of its own misbehavior, the crash affects merely that app and not the remainder of the system.

  • Preemptive multitasking. With Mach, processes share the CPU efficiently. Mach watches over the figurer's processor, prioritizing tasks, making certain activity levels are at the maximum, and ensuring that every task gets the resources it needs. It uses certain criteria to decide how important a task is and therefore how much fourth dimension to allocate to it before giving another job its plow. Your process is not dependent on some other process yielding its processing fourth dimension.

  • Advanced virtual retention. In OS X, virtual memory is "on" all the time. The Mach virtual retention system gives each process its own private virtual address infinite. For 64-chip apps, the theoretical maximum is approximately xviii exabytes, or xviii billion billion bytes. Mach maintains address maps that control the translation of a task's virtual addresses into physical retentivity. Typically just a portion of the information or lawmaking contained in a job'southward virtual accost space resides in concrete memory at whatsoever given time. Every bit pages are needed, they are loaded into concrete retentivity from storage. Mach augments these semantics with the abstraction of memory objects. Named memory objects enable one task (at a sufficiently low level) to map a range of memory, unmap it, and ship information technology to some other task. This adequacy is essential for implementing separate execution environments on the same system.

  • Existent-time support. This feature guarantees low-latency admission to processor resources for time-sensitive media apps.

Mach as well enables cooperative multitasking, preemptive threading, and cooperative threading.

64-Scrap Kernel

As of v10.eight, Bone X requires a Mac that uses the 64-chip kernel. A 64-bit kernel provides several benefits:

  • The kernel can back up large memory configurations more efficiently.

  • The maximum size of the buffer enshroud is increased, potentially improving I/O performance.

  • Performance is improved when working with specialized networking hardware that emulates retention mapping beyond a wire or with multiple video cards containing over 2 GB of video RAM.

Because a 64-bit kernel does not back up 32-flake drivers and kernel extensions (KEXTs), those items must be built for 64-bit. Fortunately, for most drivers and KEXTs, edifice for a 64-bit kernel is ordinarily not as hard as yous might think. For the most function, transitioning a driver or KEXT to be 64-bit capable is but like transitioning any other piece of lawmaking. For details most how to make the transition, including what things to check for in your code, encounter 64-Bit Transition Guide.

Device-Commuter Support

Darwin offers an object-oriented framework for developing device drivers called the I/O Kit framework. This framework facilitates the cosmos of drivers for Os 10 and provides much of the infrastructure that they demand. Written in a restricted subset of C++ and designed to support a range of device families, the I/O Kit is both modular and extensible.

Device drivers created with the I/O Kit acquire several important features:

  • True plug and play

  • Dynamic device management ("hot plugging")

  • Power management (for both desktops and portables)

If your device conforms to standard specifications—such equally those for mice, keyboards, audio input devices, mod MIDI devices, and then on—it should just piece of work when yous plug it in. If your device doesn't adapt to a published standard, you can use the I/O Kit resources to create a custom driver to run into your needs. Devices such equally AGP cards, PCI and PCIe cards, scanners, and printers usually require custom drivers or other support software in order to work with Os X.

For information on creating device drivers, encounter IOKit Device Driver Design Guidelines.

Network Kernel Extensions

Darwin allows kernel developers to add networking capabilities to the operating system past creating network kernel extensions (NKEs). The NKE facility allows you to create networking modules and even entire protocol stacks that can be dynamically loaded into the kernel and unloaded from it. NKEs also make it possible to configure protocol stacks automatically.

NKE modules have congenital-in capabilities for monitoring and modifying network traffic. At the data-link and network layers, they can besides receive notifications of asynchronous events from device drivers, such as when there is a modify in the condition of a network interface.

For information on how to write an NKE, see Network Kernel Extensions Programming Guide.

BSD

Integrated with Darwin is a customized version of the Berkeley Software Distribution (BSD) operating system. Darwin's implementation of BSD includes much of the POSIX API, which college-level apps can besides use to implement basic app features. BSD serves as the ground for the file systems and networking facilities of Os 10. In addition, it provides several programming interfaces and services, including:

  • The process model (process IDs, signals, and and so on)

  • Bones security policies such every bit file permissions and user and group IDs

  • Threading back up (POSIX threads)

  • Networking support (BSD sockets)

The following sections describe some of the key features of the BSD layer of Os 10.

IPC and Notification Mechanisms

Os Ten supports the following technologies for interprocess advice (IPC) and for delivering notifications across the system:

  • File System Events. File System Events (FSEvents) is a mechanism for notifying your app when changes occur in the file organization, such as at the cosmos, modification, or removal of files and directories. The FSEvents API gives you a way to monitor many directories at in one case and detect general changes to a file hierarchy. For example, you might utilize this technology in backup software to detect what files changed. The FSEvents API is not intended for detecting fine-grained changes to individual files.

    To learn how to use the FSEvents API, meet File System Events Programming Guide.

  • Kernel queues and kernel events. These mechanisms allow you lot to intercept kernel-level events to receive notifications about changes to sockets, processes, the file organization, and other aspects of the system. Kernel queues and events are part of the FreeBSD layer of the operating system and are described in the kqueue and kevent man pages.

  • BSD notifications. BSD notifications have a few advantages over the notification services that are offered past Cadre Foundation and Foundation. For example, your plan can receive BSD notifications through mechanisms that include Mach ports, signals, and file descriptors. Moreover, this applied science is lightweight, efficient, and capable of coalescing notifications.

    Yous can add support for BSD notifications to any blazon of program, including Cocoa apps. For more than information, see Mac Notification Overview or the notify man folio. For a give-and-take of Cocoa and Cadre Foundation interfaces for interprocess notification, see Distributed Notifications.

  • Sockets and ports. Sockets and ports are portable mechanisms for interprocess communication. A socket represents ane end of a communications channel between ii processes either locally or across the network. A port is a aqueduct between processes or threads on the local computer. Cadre Foundation and Foundation provide higher-level abstractions for ports and sockets that make them easier to implement and offering additional features. For example, you tin can use a CFSocket with a CFRunLoop to multiplex information received from a socket with information received from other sources (or more information, run across CFSocket Reference and CFRunLoop Reference).

  • Streams. A stream is machinery for transferring data between processes when you are communicating using an established send mechanism such as Bonjour or HTTP. Higher-level interfaces of Core Foundation and Foundation (which work with CFNetwork) provide a stream-based way to read and write network information and can be used with run loops to operate efficiently in a network environment.

  • Pipes. A piping is a communications channel typically created betwixt a parent and a child process when the child procedure is forked. Data written to a pipe is buffered and read in first-in, first-out (FIFO) guild. You tin create named pipes (pipe part) for communication between related processes or named pipes for communication between any two processes. A named pipage must be created with a unique name known to both the sending and the receiving process.

  • Shared retentiveness. Shared retention is a region of memory that has been allocated past a process specifically for the purpose of beingness readable and possibly writable among several processes. Y'all tin create regions of shared memory using several BSD approaches, including the shm_open and shm_unlink routines, and the mmap routine. Access to shared memory is controlled through POSIX semaphores, which implement a kind of locking mechanism.

    Although shared retentivity permits whatever process with the advisable permissions to read or write a shared retention region directly, it is very fragile—leading to the dangers of information corruption and security breaches—and should be used with care. It is best used only as a repository for raw data (such as pixels or audio), with the controlling data structures accessed through more conventional interprocess communication.

    For information near shm_open, shm_unlink, and mmap, see the shm_open, shm_unlink, and mmap human being pages.

  • Apple tree event. An Apple outcome is a high-level semantic effect that an app tin send to itself, to other apps on the same computer, or to apps on a remote computer. Apps can use Apple events to asking services and information from other apps. To supply services, you ascertain objects in your app that can be accessed using Apple events and then provide Apple event handlers to reply to requests for those objects.

    Although Apple events are not a BSD applied science, they are a low-level culling for interprocess communication. To learn how to apply Apple tree events, run across Apple tree Events Programming Guide.

Network Support

OS Ten is one of the premier platforms for computing in an interconnected globe. It supports the dominant media types, protocols, and services in the industry, every bit well as differentiated and innovative services from Apple.

The Os X network protocol stack is based on BSD. The extensible compages provided by network kernel extensions, summarized in Network Kernel Extensions, facilitates the creation of modules implementing new or existing protocols that can be added to this stack.

Standard Network Protocols

Os 10 provides built-in support for a large number of network protocols that are standard in the calculating industry. Table 6-i summarizes these protocols.

Tabular array half dozen-one  Network protocols

Protocol

Description

802.1x

802.1x is a protocol for implementing port-based network access over wired or wireless LANs. Information technology supports a wide range of authentication methods, including TLS, TTLS, Leap, MDS, and PEAP (MSCHAPv2, MD5, GTC).

DHCP and BOOTP

The Dynamic Host Configuration Protocol and the Bootstrap Protocol automate the assignment of IP addresses in a particular network.

DNS

Domain Proper noun Services is the standard Cyberspace service for mapping host names to IP addresses.

FTP and SFTP

The File Transfer Protocol and Secure File Transfer Protocol are two standard ways of moving files between computers on TCP/IP networks.

HTTP and HTTPS

The Hypertext Transport Protocol is the standard protocol for transferring webpages between a web server and browser. Bone 10 provides support for both the insecure and secure versions of the protocol.

LDAP

The Lightweight Directory Access Protocol lets users locate groups, individuals, and resource such equally files and devices in a network, whether on the Internet or on a corporate intranet.

NBP

The Name Bounden Protocol is used to demark processes across a network.

NTP

The Network Time Protocol is used for synchronizing client clocks.

PAP

The Printer Access Protocol is used for spooling print jobs and printing to network printers.

PPP

For dial-up (modem) access, OS Ten includes PPP (Signal-to-Point Protocol). PPP back up includes TCP/IP equally well equally the PAP and CHAP authentication protocols.

PPPoE

The Signal-to-Point Protocol over Ethernet protocol provides an Ethernet-based dial-upward connexion for broadband users.

S/MIME

The Secure/Multipurpose Internet Mail Extensions protocol supports encryption of email and the attachment of digital signatures to validate email addresses.

SLP

Service Location Protocol is designed for the automatic discovery of resources (servers, fax machines, and so on) on an IP network.

SOAP

The Elementary Object Access Protocol is a lightweight protocol for exchanging encapsulated messages over the web or other networks.

SSH

The Secure Beat out protocol is a prophylactic way to perform a remote login to some other estimator. Session information is encrypted to prevent unauthorized access of data.

TCP/IP and UDP/IP

OS 10 provides two transmission-layer protocols, TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), to piece of work with the network-layer Internet Protocol (IP). (Bone Ten includes back up for IPv6 and IPSec.)

XML-RPC

XML-RPC is a protocol for sending remote procedure calls using XML over the web.

OS Ten also implements a number of file-sharing protocols; see Tabular array 6-4 for a summary of these protocols.

Network Technologies

Bone Ten supports the network technologies listed in Tabular array vi-2.

Table 6-ii  Network engineering support

Technology

Description

Ethernet 10/100Base-T

For the Ethernet ports congenital into every new Macintosh.

Ethernet 1000Base-T

Too known as Gigabit Ethernet. For data transmission over cobweb-optic cablevision and standardized copper wiring.

Colossal Frame

This Ethernet format uses 9 KB frames for interserver links rather than the standard 1.5 KB frame. Jumbo Frame decreases network overhead and increases the period of server-to-server and server-to-app data.

Serial

Supports modem and ISDN capabilities.

Wireless

Supports the 802.11b, 802.11g, 80211n, and 802.11ac wireless network technologies using Airdrome Extreme and AirPort Limited.

IP Routing/RIP

IP routing provides routing services for small networks. Information technology uses Routing Information Protocol (RIP) in its implementation.

Multihoming

Enables a computer host to be physically connected to multiple data links that can be on the aforementioned or different networks.

IP aliasing

Allows a network administrator to assign multiple IP addresses to a single network interface.

Zippo-configuration networking

Encounter Bonjour.

NetBoot

Allows computers to share a single System folder, which is installed on a centralized server that the system administrator controls. Users store their information in abode directories on the server and have access to a common Applications binder, both of which are also commonly installed on the server.

Personal web sharing

Allows users to share information with other users on an intranet, no matter what type of estimator or browser they are using. The Apache spider web server is integrated as the organisation'due south HTTP service.

Network Diagnostics

Network diagnostics is a style of helping the user solve network problems. Although mod networks are more often than not reliable, at that place are still times when network services may neglect. Sometimes the cause of the failure is beyond the ability of the desktop user to fix, but sometimes the problem is in the way the user's computer is configured. The network diagnostics feature provides a diagnostic app to help the user locate problems and correct them.

If your app encounters a network error, y'all can use the diagnostic interfaces of CFNetwork to launch the diagnostic app and attempt to solve the problem interactively. Y'all tin can also choose to study diagnostic issues to the user without attempting to solve them.

For more information on using this feature, see Using Network Diagnostics.

File-Arrangement Support

The file-organisation component of Darwin is based on extensions to BSD and an enhanced Virtual File System (VFS) design. The file-arrangement component includes the post-obit features:

  • Permissions on removable media. This characteristic is based on a globally unique ID registered for each connected removable device (including USB and FireWire devices) in the system.

  • Access control lists, which support fine-grained access to file-arrangement objects.

  • URL-based volume mounts, which enable users (via a Finder command) to mount such things every bit AppleShare and web servers

  • Unified buffer cache, which consolidates the buffer cache with the virtual-memory cache

  • Long filenames (255 characters or 755 bytes, based on UTF-eight)

  • Back up for hiding filename extensions on a per-file basis

  • Journaling of all file-system types to aid in data recovery after a crash

Because of its multiple app environments and the various kinds of devices it supports, Os X handles file data in many standard volume formats. Table 6-3 lists the supported formats.

Tabular array 6-three  Supported local book formats

Volume format

Clarification

Mac Os Extended Format

Also called HFS (hierarchical file organization) Plus, or HFS+. This is the default root and booting book format in Bone X. This extended version of HFS optimizes the storage capacity of big difficult disks by decreasing the minimum size of a single file.

Mac Bone Standard Format

Also called hierarchical file organization, or HFS. This is the legacy book format in Mac OS systems prior to Mac OS 8.1. HFS (like HFS+) stores resources and information in separate forks of a file and makes utilise of various file attributes, including type and creator codes.

UDF

Universal Disk Format, used for hard drives and optical disks, including almost types of CDs and DVDs. Os 10 supports reading UDF revisions 1.02 through 2.60 on both block devices and well-nigh optical media, and it supports writing to block devices and to DVD-RW and DVD+RW media using UDF two.00 through 2.50 (except for mirrored metadata partitions in 2.l). You lot can detect the UDF specification at http://www.osta.org.

ISO 9660

The standard format for CD-ROM volumes.

NTFS

The NT File System, used by Windows computers. Os X can read NTFS-formatted volumes merely cannot write to them.

UFS

UNIX File System, a flat (that is, single-fork) deejay volume format, based on the BSD FFS (Fast File System), that is similar to the standard volume format of most UNIX operating systems; it supports POSIX file-system semantics, which are important for many server applications. Although UFS is supported in OS X, its use is discouraged.

MS-DOS (Fat)

The FAT file system is used past many Windows computers, digital cameras, video cameras, SD and SDHC retentivity cards, and other digital devices. Bone X can read and write FAT-formatted volumes.

ExFAT

The ExFAT file system is an extension of the Fat file system, and is as well used on Windows computers, some digital cameras and video cameras, SDXC memory cards, and other digital devices. OS 10 can read and write ExFAT-formatted volumes.

HFS+ volumes support aliases, symbolic links, and hard links, whereas UFS volumes support symbolic links and difficult links only non aliases. Although an alias and a symbolic link are both lightweight references to a file or directory elsewhere in the file organisation, they are semantically different in significant ways. For more information, see Aliases and Symbolic Links in File System Overview.

Considering Bone Ten is intended to be deployed in heterogeneous networks, it also supports several network file-sharing protocols. Table 6-4 lists these protocols.

Table 6-4  Supported network file-sharing protocols

File protocol

Description

AFP

Apple Filing Protocol, the principal file-sharing protocol in Mac OS 9 systems (bachelor only over TCP/IP transport).

NFS

Network File Organization, the ascendant file-sharing protocol in the UNIX world.

WebDAV

Spider web-based Distributed Authoring and Versioning, an HTTP extension that allows collaborative file management on the web.

SMB/CIFS

SMB/CIFS, a file-sharing protocol used on Windows and UNIX systems.

Security

The roots of OS Ten in the UNIX operating system provide a robust and secure computing surround whose track record extends dorsum many decades. Os 10 security services are built on top of BSD (Berkeley Software Distribution), an open-source standard. BSD is a class of the UNIX operating organisation that provides basic security for primal services, such equally file and network access.

The CommonCrypto library, which is office of libSystem, provides raw cryptographic algorithms. It is intended to replace like OpenSSL interfaces.

Os 10 too includes the following security features:

  • Adoption of Mandatory Access Control, which provides a fine-grained security architecture for controlling the execution of processes at the kernel level. This characteristic enables the "sandboxing" of apps, which lets you limit the access of a given app to only those features you designate.

  • Support for code signing and installer package signing. This feature lets the system validate apps using a digital signature and warn the user if an app is tampered with.

  • Compiler support for fortifying your source code against potential security threats. This support includes options to disallow the execution of code located on the stack or other portions of retention containing information.

  • Support for putting unknown files into quarantine. This is particularly useful for developers of web browsers or other network-based apps that receive files from unknown sources. The organisation prevents access to quarantined files unless the user explicitly approves that access.

For an introduction to OS X security features, encounter Security Overview.

Scripting Support

Darwin includes all of the scripting languages commonly found in UNIX-based operating systems. In add-on to the scripting languages associated with command-line shells (such as bash and csh), Darwin also includes support for Perl, Python, Ruby, Cherry-red on Rails, and others.

Bone 10 provides scripting bridges to the Objective-C classes of Cocoa. These bridges let you use Cocoa classes from within your Python and Scarlet scripts. For data near using these bridges, see Ruby and Python Programming Topics for Mac.

Threading Back up

OS Ten provides full support for creating multiple preemptive threads of execution inside a unmarried process. Threads permit your program perform multiple tasks in parallel. For example, you might create a thread to perform some lengthy calculations in the background while a separate thread responds to user events and updates the windows in your app. Using multiple threads can ofttimes pb to significant performance improvements in your app, especially on computers with multiple CPU cores. Multithreaded programming is non without its dangers though. Information technology requires careful coordination to ensure your app's state does not get corrupted.

All user-level threads in Bone 10 are based on POSIX threads (also known equally pthreads). A pthread is a lightweight wrapper around a Mach thread, which is the kernel implementation of a thread. You can utilise the pthreads API directly or use any of the threading packages offered by Cocoa. Although each threading package offers a different combination of flexibility versus ease-of-use, all packages offer roughly the same performance.

In general, you should try to use Grand Central Dispatch or operation objects to perform work concurrently. Notwithstanding, there might still exist situations where you need to create threads explicitly. For more than information most threading support and guidelines on how to use threads safely, run into Threading Programming Guide.

X11

The X11 windowing arrangement is provided as an optional installation component for the system. This windowing organization is used past many UNIX applications to draw windows, controls, and other elements of graphical user interfaces. The Bone X implementation of X11 uses the Quartz drawing environment to requite X11 windows a native Os X feel. This integration also makes information technology possible to display X11 windows alongside windows from native apps written in Cocoa.

Software Development Support

The following sections describe some additional features of OS 10 that touch the software development process.

Binary File Compages

The underlying compages of Bone X executables was built from the beginning with flexibility in mind. This flexibility became important equally Mac computers have transitioned from using PowerPC to Intel CPUs and from supporting only 32-bit apps to 64-bit apps. The following sections provide an overview of the types of architectures you can support in your Os X executables along with other information about the runtime and debugging environments available to you.

Hardware Architectures

When OS X was get-go introduced, it was built to support a 32-flake PowerPC hardware architecture. With Apple's transition to Intel-based Mac computers, OS 10 added initial support for 32-chip Intel hardware architectures. In addition to 32-bit support, Bone 10 v10.4 added some basic support for 64-bit architectures also and this back up was expanded in Os X v10.5. This means that apps and libraries can now back up two different architectures:

  • 32-flake Intel (i386)

  • 64-chip Intel (x86_64)

Although apps can support all of these architectures in a unmarried binary, doing and so is not required. The power to create "universal binaries" that run natively on all supported architectures gives Bone 10 the flexibility information technology needs for the future.

Supporting multiple architectures requires careful planning and testing of your code for each architecture. At that place are subtle differences from ane compages to the next that can crusade problems if non accounted for in your lawmaking. For example, some born information types have different sizes in 32-scrap and 64-bit architectures. Bookkeeping for these differences is not difficult but requires consideration to avert coding errors.

Xcode provides integral support for creating apps that back up multiple hardware architectures. For information about tools support and creating universal binaries. For information well-nigh 64-flake back up in Bone X, including links to documentation for how to make the transition, run into 64-Bit Support.

64-Flake Support

Bone X was initially designed to support binary files on computers using a 32-flake architecture. In Os X v10.four, however, support was introduced for compiling, linking, and debugging binaries on a 64-chip architecture. This initial support was express to code written using C or C++ only. In addition, 64-fleck binaries could link against the Accelerate framework and libSystem.dylib only.

Starting in Os 10 v10.v, most system libraries and frameworks are 64-fleck ready, pregnant they can be used in both 32-fleck and 64-fleck apps. Frameworks built for 64-bit means you tin create apps that address extremely big information sets, up to 128 TB on the current Intel-based CPUs. On Intel-based Macintosh computers, some 64-bit apps may even run faster than their 32-bit equivalents because of the availability of extra processor resources in 64-bit way.

There are a few technologies that accept not been ported to 64-chip. Development of 32-scrap apps with these APIs is nevertheless supported, but if you want to create a 64-bit app, you lot must use alternative technologies. Among these APIs are the following:

  • The entire QuickTime C API (deprecated in Bone X v10.ix; in a 64-bit app, use AV Foundation instead)

  • HIToolbox, Window Manager, and most other user interface APIs (in general, use Cocoa UI classes and other alternatives); run across 64-Scrap Guide for Carbon Developers for the list of specific APIs and transition paths.

Bone X uses the LP64 model that is in use by other 64-bit UNIX systems, which ways fewer headaches when porting from other operating systems. For general information on the LP64 model and how to write 64-scrap apps, encounter 64-Chip Transition Guide. For Cocoa-specific transition information, see 64-Flake Transition Guide for Cocoa.

Object File Formats

Os Ten is capable of loading object files that use several unlike object-file formats. Mach-O format is the format used for all native OS X app evolution.

For information nearly the Mach-O file format, run across Os X ABI Mach-O File Format Reference . For additional information about using Mach-O files, run across Mach-O Programming Topics.

Debug File Formats

Whenever y'all debug an executable file, the debugger uses symbol information generated by the compiler to associate user-readable names with the procedure and information address it finds in memory. Normally, this user-readable information is non needed by a running program and is stripped out (or never generated) by the compiler to save space in the resulting binary file. For debugging, even so, this information is very of import to be able to sympathise what the program is doing.

Os X supports ii dissimilar debug file formats for compiled executables: Stabs and DWARF. The Stabs format is present in all versions of Os X and until the introduction of Xcode 2.4 was the default debugging format. Code compiled with Xcode 2.4 and later uses the DWARF debugging format by default. When using the Stabs format, debugging symbols, like other symbols are stored in the symbol table of the executable; see Bone X ABI Mach-O File Format Reference . With the DWARF format, debugging symbols are stored either in a specialized segment of the executable or in a separate debug-information file.

For information nigh the DWARF standard, go to The DWARF Debugging Standard; for information about the Stabs debug file format, see STABS Debug Format . For additional information about Mach-O files and their stored symbols, see Mach-O Programming Topics.

Runtime Environments

Since its first release, OS X has supported several unlike environments for running apps. The well-nigh prominent of these environments is the dynamic link editor (dyld) environment, which is likewise the only environment supported for active development. Most of the other environments provided legacy support during the transition from Mac Os ix to OS X and are no longer supported for agile development. The following sections describe the runtime environments you may see in various versions of OS 10.

dyld Runtime Surround

The dyld runtime environs is the native environment in OS X and is used to load, link, and execute Mach-O files. At the eye of this surround is the dyld dynamic loader program, which handles the loading of a plan's code modules and associated dynamic libraries, resolves any dependencies between those libraries and modules, and begins the execution of the program.

Upon loading a program's code modules, the dynamic loader performs the minimal amount of symbol binding needed to launch your plan and go it running. This bounden process involves resolving links to external libraries and loading them as their symbols are used. The dynamic loader takes a lazy approach to binding individual symbols, doing and so only as they are used by your code. Symbols in your lawmaking can exist strongly linked or weakly linked. Strongly linked symbols cause the dynamic loader to finish your programme if the library containing the symbol cannot be found or the symbol is non nowadays in the library. Weakly linked symbols terminate your programme only if the symbol is not present and an attempt is made to use it.

For more information near the dynamic loader program, see the dyld man page. For data near building and working with Mach-O executable files, run into Mach-O Programming Topics.

Language Support

The tools that come with Bone Ten provide direct support for developing software using the Swift, C, C++, Objective-C, and Objective-C++ languages along with numerous scripting languages. Support for other languages may also be provided by third-party developers. For more information on the primal features of Swift and Objective-C, run across Development Languages