If I plug a USB-serial adapter into my Mac, a new device shows up in /dev, such as /dev/tty.usbmodem1421 or /dev/tty.usbserial-A7048O1O.
If this were Linux, I'd be looking for an udev rule that explains where the device name came from, and why it was created.
But this is OSX. How are device names allocated on the Mac (e.g. why those funny numbers in the device name), and which piece of code does that?
Device names in Mac OS X, where present, are assigned by the specific driver involved. There's no single mechanism involved, particularly as most classes of device don't get nodes in
/dev
at all.In the case of FTDI devices, the "funny numbers" in the device name are the serial number of the FTDI chip. The logic for this is internal to the FTDI driver, which, unfortunately, isn't open-source, so I can't point to the code involved. :(
Incidentally, you can change the serial number of an FTDI device using ft232r_prog.