<!--
{
  "documentType" : "article",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/driverkit-sample-code",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "DriverKit sample code"
}
-->

# DriverKit sample code

Explore projects that demonstrate how to write macOS device drivers with the DriverKit family of frameworks.

## Discussion

The DriverKit SDK provide a stable, secure platform on which to build device drivers for macOS and iPadOS. It provides the interfaces you need to support many types of hardware, including USB devices, HID devices, networking devices, audio devices, and more. Package your custom code in a DriverKit extension, which runs in user space and communicates with the kernel through the framework APIs. To install your DriverKit extension on macOS, deliver it inside an app and install it using the <doc://com.apple.documentation/documentation/SystemExtensions> framework. For projects that run on iPadOS, the system locates the driver in your app bundle and installs the driver for you.

The DriverKit SDK includes several practical examples that show you how to write a typical driver. Use these samples as a starting point to write your own custom drivers. The SDK’s classes provide the base code you need to support standard hardware protocols such as USB, HID, Ethernet, PCI, Thunderbolt, and more. Use your custom driver code to support proprietary features of your hardware devices.

## Topics

### Essentials

[Communicating between a DriverKit extension and a client app](/documentation/DriverKit/communicating-between-a-driverkit-extension-and-a-client-app)

Send and receive different kinds of data securely by validating inputs and asynchronously by storing and using a callback.

### Audio samples

  <doc://com.apple.documentation/documentation/AudioDriverKit/creating-an-audio-device-driver>

### HID samples

  <doc://com.apple.documentation/documentation/HIDDriverKit/handling-stylus-input-from-a-human-interface-device>

  <doc://com.apple.documentation/documentation/HIDDriverKit/handling-keyboard-events-from-a-human-interface-device>

### Networking samples

  <doc://com.apple.documentation/documentation/PCIDriverKit/connecting-a-network-driver>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)