Serial Data Transfer

The remaining methods to be implemented from the IOSerialDriverSync interface are the data transfer methods. The serial driver will be provided with data to be transmitted over the serial port through the method enqueueData(), and the data that the driver has received from the serial port is provided to clients through the dequeueData() method.

When a user space process writes data to a serial port, it is first handled in the kernel by the IOSerialBSDClient class, which is responsible for passing the data on to the serial port driver. The IOSerialBSDClient will provide the data to the serial driver by calling its enqueueData() method, which has the following signature:

IOReturn  enqueueData(UInt8 *buffer, UInt32 size, UInt32 ...

Get OS X and iOS Kernel Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.