The hardware serial port will need to be configured to match the settings used by the device on the other end of the serial connection. Configurable settings include parameters such as the baud rate at which data is sent, the number of bits in a data character, whether parity bits are transmitted, and the number of stop bits that are sent at the end of each character.
These serial port settings are determined by the user space process that has opened the serial port and are configured through functions such as
tcgetattr(). These functions enter the kernel through the I/O Kit's
IOSerialBSDClient class, which passes the individual configuration options to the serial port driver through its
executeEvent() method. ...