Framework

Kernel

Develop kernel-resident device drivers and kernel extensions.

Overview

The Kernel Framework provides the APIs and support for kernel-resident device drivers and other kernel extensions. It defines the base class for I/O Kit device drivers (IOService), several helper classes, and the families supporting many types of devices.

Topics

Protocols

Reference

IOVideoDeviceInterface

Interface for accessing kernel-space video drivers from user space.

ATADeviceNub

ATADeviceNub is a concrete implementation of IOATADevice.

ATATimerEventSource

Extend the timer event source to allow checking for timer expiration from behind the workloop.

IOAGPDevice

An IOService class representing an AGP master device.

IOATABusInfo

used to indicate the capabilities of the bus the device is connected to, PIO and DMA modes supported, etc.

IOATAController

The base class for ata controller family. Provides the interface common to all ata bus controllers.

IOATADevConfig

used for configuring and communicating the desired transfer modes of a device. A disk driver would typically use this object in conjunction with the 512-bytes of identification data from the drive and the IOATABusInfo object for the bus it is connected to. This object will determine the best matching transfer speeds available. the device driver will then send a series of Set Features commands to configure the drive and this object to the bus through the IOATADevice nub in order to configure the optimum transfer mode. The driver for the disk drive may choose to populate this object with whatever transfer mode desired, in the event that a different mode is required.

IOATADevice

This object implements a relay to an ATA Bus where a drive is attached.

IOATAPIProtocolTransport

SCSI Protocol Driver Family for ATAPI Devices.

IOAudioControl

Represents any controllable attribute of an IOAudioDevice.

IOAudioDevice

Abstract base class for a single piece of audio hardware. The IOAudioDevice provides the central coordination point for an audio driver.

IOAudioPort

Represents a logical or physical port or functional unit in an audio device.

IOAudioStream

This class wraps a single sample buffer in an audio driver.

IOAudioTimeIntervalFilterFIR

A concrete IOAudioTimeIntervalFilter class that provides an FIR-based filtered timeline based on snapshots from jittery time captures

IOAudioTimeIntervalFilterIIR

A concrete IOAudioTimeIntervalFilter class that provides an IIR-based filtered timeline based on snapshots from jittery time captures

IOBDBlockStorageDevice

The IOBDBlockStorageDevice class is a generic BD block storage device abstraction.

IOBDMedia

The IOBDMedia class is a random-access disk device abstraction for BDs.

IOBasicOutputQueue

A concrete implementation of an IOOutputQueue.

IOBigMemoryCursor

An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the big endian byte order.

IOBlockStorageDevice

A generic block storage device abstraction.

IOBlockStorageDriver

The common base class for generic block storage drivers.

IOBufferMemoryDescriptor

Provides a simple memory descriptor that allocates its own buffer memory.

IOCDBlockStorageDevice

The IOCDBlockStorageDevice class is a generic CD block storage device abstraction.

IOCDMedia

The IOCDMedia class is a random-access disk device abstraction for CDs.

IOCatalogue

In-kernel database for IOKit driver personalities.

IOCommand

This class is an abstract class which represents an I/O command.

IOCommandGate

Single-threaded work-loop client request mechanism.

IOCommandPool

Manipulates a pool of commands which inherit from IOCommand.

IODMACommand

A mechanism to convert memory references to I/O bus addresses.

IODVDBlockStorageDevice

The IODVDBlockStorageDevice class is a generic DVD block storage device abstraction.

IODVDMedia

The IODVDMedia class is a random-access disk device abstraction for DVDs.

IODataQueue

A generic queue designed to pass data from the kernel to a user process.

IODeviceMemory

An IOMemoryDescriptor used for device physical memory ranges.

IOEthernetController

Abstract superclass for Ethernet controllers.

IOEthernetInterface

The Ethernet interface object.

IOEventSource

Abstract class for all work-loop event sources.

IOExtendedLBA

If 48-bit LBAs are supported, IOExtendedLBA is used to represent a 48-bit LBA. The driver examines the ATA identify data to determine if 48-bit addressing is supported.

IOFWAsyncCommand

Send an async request to a device

IOFWAsyncPHYCommand

Send an async PHY packet

IOFWAsyncStreamCommand

Send an async stream packet

IOFWBusCommand

Bus control commands

IOFWCommand

Base class for FireWire commands

IOFWDCLPool

You should never subclass IOFWDCLPool

IOFWDelayCommand

Command to execute some code after a specified delay (in microseconds) All it does is timeout after the specified delay, hence calling the completion callback.

IOFWReadQuadCommand

An easier to use version of IOFWReadCommand for use when the data to be transferred is an integer number of quads. Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) is called.

IOFWWriteQuadCommand

An easier to use version of IOFWWriteCommand for use when the data to be transferred is small and an integer number of quads. Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) is called. kMaxWriteQuads is the largest legal number of quads that this object can be asked to transfer (the data is copied into an internal buffer in init() and reinit()).

IOFilterInterruptEventSource

Filtering varient of the $link IOInterruptEventSource.

IOFilterScheme

The common base class for all filter scheme objects.

IOFireWireAVCNub

nub for AVC devices

IOFireWireAVCSubUnit

nub for sub unit of AVC devices. Just for matching, calls the AVC unit for all functions.

IOFireWireAVCTargetSpace

object to centralize the AVC Target mode support

IOFireWireAVCUnit

nub for AVC devices

IOFireWireBus

IOFireWireBus is a public class the provides access to general FireWire functionality...

IOFireWireDevice

Represents a FireWire device.

IOFireWirePCRSpace

object to multiplex users of the PCR plug registers

IOFireWireSBP2LSIWorkaroundDescriptor

This is a subclass of IOGeneralMemoryDescriptor. It is designed to work around a hardware problem in a common SBP2 target. It takes a memory descriptor as an argument. It retains this descriptor and returns a new one with resegmented physical segments and potentially some "unfixable" segments double buffered.

IOFireWireSBP2LUN

Provider for most drivers.

IOFireWireSBP2Login

Supplies the login maintenance and Normal Command ORB execution portions of the API.

IOFireWireSBP2ManagementORB

Supplies non login related management ORBs. Management ORBs can be executed independent of a login, if necessary. Management ORBs are created using the IOFireWireSBP2LUN interface.

IOFireWireSBP2ORB

Represents an SBP2 normal command ORB. Supplies the APIs for configuring normal command ORBs. This includes setting the command block and writing the page tables for I/O. The ORBs are executed using the submitORB method in IOFireWireSBP2Login.

IOFireWireSBP2Target

Serves as bridge between IOFireWireUnit and IOFireWireLUN.

IOFireWireSerialBusProtocolTransport

SCSI Protocol Driver Family for FireWire SBP2 Devices.

IOFramebuffer

The base class for graphics devices to be made available as part of the desktop.

IOGatedOutputQueue

An extension of an IOBasicOutputQueue.

IOHIDDevice

IOHIDDevice defines a Human Interface Device (HID) object, which will interact with the HID Manager by publishing static properties in the registry, and also by reporting HID events through shared memory. IOHIDDevice is an abstract class that must be subclassed to support a specific type of HID devices, such as USB HID class devices.

IOHIDInterface

In kernel interface to a HID device.

IOInterleavedMemoryDescriptor

The IOInterleavedMemoryDescriptor object describes a memory area made up of portions of several other IOMemoryDescriptors.

IOInterruptEventSource

Event source for interrupt delivery to work-loop based drivers.

IOKernelDebugger

Kernel debugger nub.

IOLittleMemoryCursor

An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the little endian byte order.

IOMbufBigMemoryCursor

An IOMbufMemoryCursor subclass that outputs a vector of IOPhysicalSegments in the big endian byte order.

IOMbufDBDMAMemoryCursor

An IOMbufMemoryCursor subclass that outputs a vector of IODBDMADescriptors.

IOMbufLittleMemoryCursor

An IOMbufMemoryCursor subclass that outputs a vector of IOPhysicalSegments in the little endian byte order.

IOMbufMemoryCursor

A mechanism to convert mbuf chains to physical addresses.

IOMbufNaturalMemoryCursor

An IOMbufMemoryCursor subclass that outputs a vector of IOPhysicalSegments in the natural byte orientation for the cpu.

IOMedia

A random-access disk device abstraction.

IOMemoryCursor

A mechanism to convert memory references to physical addresses.

IOMemoryDescriptor

An abstract base class defining common methods for describing physical or virtual memory.

IOMemoryMap

A class defining common methods for describing a memory mapping.

IOMultiMemoryDescriptor

The IOMultiMemoryDescriptor object describes a memory area made up of several other IOMemoryDescriptors.

IONaturalMemoryCursor

An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the natural byte orientation for the CPU.

IONetworkController

Implements the framework for a generic network controller.

IONetworkData

An object that manages a fixed-size named buffer.

IONetworkInterface

Abstract class that manages the connection between an IONetworkController and the data link interface layer.

IONetworkMedium

An object that encapsulates information about a network medium (i.e. 10Base-T, or 100Base-T Full Duplex).

IONotifier

An abstract base class defining common methods for controlling a notification request.

IOOutputQueue

A packet queue that supports multiple producers and a single consumer.

IOPCIATA

The base class for PCI-IDE ata controller family.

IOPCIDevice

An IOService class representing a PCI device.

IOPacketQueue

Implements a bounded FIFO queue of mbuf packets.

IOPartitionScheme

The common base class for all partition scheme objects.

IORangeAllocator

A utility class to manage allocations from a range.

IORegistryEntry

The base class for all objects in the registry.

IORegistryIterator

An iterator over the registry.

IOSCSIParallelInterfaceController

Class that represents a SCSI Host Bus Adapter.

IOSCSIProtocolInterface

This class defines the public SCSI Protocol Layer API for any class that provides Protocol services or needs to provide the Protocol Service API for passing service requests to a Protocol Service driver.

IOSCSIProtocolServices

This class defines the public SCSI Protocol Services Layer API for any class that implements SCSI protocol services. A protocol services layer driver is responsible for taking incoming SCSITaskIdentifier objects and translating them to the native command type for the native protocol interface (e.g. SBP-2 ORB on FireWire).

IOService

The base class for most I/O Kit families, devices, and drivers.

IOSharedDataQueue

A generic queue designed to pass data both from the kernel to a user process and from a user process to the kernel.

IOStorage

The common base class for mass storage objects.

IOStream

A class representing a stream of data buffers passed from kernel to user space and back again.

IOStreamBuffer

A class representing a data buffer that is part of an IOStream.

IOSubMemoryDescriptor

The IOSubMemoryDescriptor object describes a memory area made up of a portion of another IOMemoryDescriptor.

IOTimerEventSource

Time based event source mechanism.

IOUSBCompositeDriver

Driver that matches to USB composite devices.

IOUSBController

Base class for USB hardware driver

IOUSBControllerV2

subclass of the IOUSBController to provide support for high speed devices and split transactions.

IOUSBControllerV3

subclass of the IOUSBControllerV2 to provide support for new USB Power Management techniques.

IOUSBDevice

The IOService object representing a device on the USB bus.

IOUSBHIDDriver

Driver that matches to USB HID devices.

IOUSBHubDevice

New in OS X 10.5. The IOKit object representing a hub device on the USB bus. It is a subclass of IOUSBDevice.

IOUSBInterface

The object representing an interface of a device on the USB bus.

IOUSBPipe

The object representing an open pipe for a device.

IOUSBPipeV2

The object representing an open pipe for a device.

IOUserClient

Provides a basis for communication between client applications and I/O Kit objects.

IOVideoDevice

A class that represents a video device.

IOVideoStream

A class representing a stream of video data buffers passed from kernel to user space and back again.

OSArray

OSArray provides an indexed store of objects.

OSBoolean

OSBoolean wraps a boolean value in a C++ object for use in Libkern collections.

OSCollection

The abstract superclass for Libkern collections.

OSData

OSData wraps an array of bytes in a C++ object for use in Libkern collections.

OSDictionary

OSDictionary provides an associative store using strings for keys.

OSIterator

The abstract superclass for Libkern iterators.

OSMetaClassBase

OSMetaClassBase is the abstract bootstrap class for the Libkern and I/O Kit run-time type information system.

OSNumber

OSNumber wraps an integer value in a C++ object for use in Libkern collections.

OSObject

OSObject is the concrete root class of the Libkern and I/O Kit C++ class hierarchy.

OSOrderedSet

OSOrderedSet provides an ordered set store of objects.

OSSerialize

OSSerialize coordinates serialization of Libkern C++ objects into an XML stream.

OSSet

OSSet provides an unordered set store of objects.

OSString

OSString wraps a C string in a C++ object for use in Libkern collections.

OSSymbol

OSSymbol wraps a C string in a unique C++ object for use as keys in Libkern collections.

Bluetooth.h

Bluetooth wireless technology

IOATAPIProtocolTransport.h

Contains the class definition for IOATAPIProtocolTransport.

IOBDBlockStorageDevice.h

This header contains the IOBDBlockStorageDevice class definition.

IOBDMedia.h

This header contains the IOBDMedia class definition.

IOBlockStorageDevice.h

This header contains the IOBlockStorageDevice class definition.

IOBlockStorageDriver.h

This header contains the IOBlockStorageDriver class definition.

IOCDBlockStorageDevice.h

This header contains the IOCDBlockStorageDevice class definition.

IOCDMedia.h

This header contains the IOCDMedia class definition.

IODVDBlockStorageDevice.h

This header contains the IODVDBlockStorageDevice class definition.

IODVDMedia.h

This header contains the IODVDMedia class definition.

IOFilterScheme.h

This header contains the IOFilterScheme class definition.

IOFireWireFamilyCommon.h

This file contains useful definitions for working with FireWire in the kernel and in user space

IOFireWireSBP2Login.h

Contains the class definition for IOFireWireSBP2Login.

IOFireWireSBP2ManagementORB.h

Contains the class definition for IOFireWireSBP2ManagementORB.

IOMedia.h

This header contains the IOMedia class definition.

IOMessage.h

Defines message type constants for several IOKit messaging API's.

IONetworkStats.h

Generic network statistics.

IOPM.h

Defines power management constants and keys used by both in-kernel and user space power management.

IOPMpowerState.h

Defines the struct IOPMPowerState that power managed drivers should use to describe their power states.

IOPartitionScheme.h

This header contains the IOPartitionScheme class definition.

IOSCSIProtocolInterface.h

This file contains definitions for the IOSCSIProtocolInterface class, SCSI Protocol Features used by this interface, and additional constants used by this interface.

IOService.h

This header contains the definition of the IOService class. IOService is the sole direct subclass of IORegistryEntry and is the base class of almost all I/O Kit family superclasses. IOService defines methods that support the life cycle of I/O Kit drivers. For more information on IOService, see IOKit Fundamentals.

IOStorage.h

This header contains the IOStorage class definition.

IOStreamShared.h

IOStream definitions shared between kernel and user space.

IOVideoDeviceShared.h

IOVideoDevice definitions shared between kernel and user space.

OSAtomic.h

This header declares the OSAtomic group of functions for atomic reading and updating of values.

OSBoolean.h

This header declares the OSBoolean container class.

OSKextLib.h

Declares functions, basic return values, and other constants related to kernel extensions (kexts).

OSMalloc.h

This header declares the OSMalloc memory-allocation KPI.

OSReturn.h

Declares functions, basic return values, and other constants related to kernel extensions (kexts).

OSUnserialize.h

This header declares the OSUnserializeXML function.

SCSICmds_INQUIRY_Definitions.h

This file contains all definitions for the data returned from the INQUIRY (0x12) command.

SCSICmds_MODE_Definitions.h

This file contains all definitions for the data returned from the MODE_SENSE_6 and MODE_SENSE_10 commands.

SCSICmds_READ_CAPACITY_Definitions.h

This file contains all definitions for the data returned from the READ CAPACITY 10 (0x25) and READ CAPACITY 16 (0x9E) commands.

SCSICmds_REPORT_LUNS_Definitions.h

This file contains all definitions for the data returned from the REPORT_LUNS (0xA0) command.

SCSICmds_REQUEST_SENSE_Defs.h

This file contains all definitions for the data returned from the REQUEST SENSE (0x03) command and from auto sense on protocols that support it.

SCSIPort.h

This file contains all the definitions for SCSIPort notifications and status.

USBHub.h

Constants and definitions used with Hub devices.

init.h

This header defines an API to register a function that will be called when the network stack is being initialized. This gives a kernel extensions an opportunity to install filters before sockets are created and network operations occur.

kern_control.h

This header defines an API to communicate between a kernel extension and a process outside of the kernel.

kern_event.h

This header defines in-kernel functions for generating kernel events as well as functions for receiving kernel events using a kernel event socket.

kpi_interface.h

This header defines an API to interact with network interfaces in the kernel. The network interface KPI may be used to implement network interfaces or to attach protocols to existing interfaces.

kpi_interfacefilter.h

This header defines an API to attach interface filters. Interface filters may be attached to a specific interface. The filters can intercept all packets in to and out of the specific interface. In addition, the filters may intercept interface specific events and ioctls.

kpi_ipfilter.h

This header defines an API to attach IP filters. IP filters may be attached to intercept either IPv4 or IPv6 packets. The filters can intercept all IP packets in to and out of the host regardless of interface.

kpi_protocol.h

This header defines an API to interact with protocols in the kernel. The KPIs in this header file can be used to interact with protocols that already exist in the stack. These KPIs can be used to support existing protocols over media types that are not natively supported in the kernel, such as ATM.

kpi_socket.h

This header defines an API for creating and interacting with sockets in the kernel. It is possible to create sockets in the kernel without an associated file descriptor. In some cases, a reference to the socket may be known while the file descriptor is not. These functions can be used for interacting with sockets in the kernel. The API is similar to the user space socket API.

mac_policy.h

Kernel Interfaces for MAC policy modules

thread_call.h

Facilities for executing work asynchronously.

Classes

IOAudioEngine

Abstract base class for a single audio audio / I/O engine.

IORTCBeta

See Also

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software