Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to create virtual COM port
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create virtual COM port



On Feb 26, 2006, at 20:46, Pavan Chebbi wrote:
I wanted to know how do we create and register a virtual COM port. (MAC OS X).

I assume you mean a virtual serial port (like COM1 on a PC).  On Mac OS X (and Unix in general), these are implemented as /dev/tty (teletype) device nodes.

 Is it possible at the user level or do we have to code in the kernel. Kindly provide some inputs on this.

No; to present a TTY port on Mac OS X, you have to have to write a KEXT that causes the /dev nodes to come into existence.

The easiest way to do this is to write an IOKit driver that makes use of the IOSerialFamily to publish one or more virtual serial interfaces.  You do this by subclassing an appropriate class (probably IOSerialStreamSync) and publishing it - the serial family takes care of publishing the /dev/tty nodes and managing all the Posix semantics of those nodes.  If you do this right, the network control panel should properly display your serial port as an for PPP connections.

Another way to do this is to write a non-IOKit KEXT that directly publishes the /dev/tty nodes.  This may be easier if you already have some Unix code you are porting to Darwin, but you'll have to manage all the Posix semantics yourself, and the network control panel won't find your serial port to present to the user (don't know if you care about that).

 Is there any open source that I can refer to which does the same job.

The Apple16X50Serial driver project from Darwin is a good example of the IOKit KEXT approach, though it is designed to support physical hardware.  I'm not aware of an example of a virtual serial driver on Mac OS X.

 I request you to help.
 
Warm Regards,
Pavan.

Cheers,
 - Dean
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to create virtual COM port (From: Pavan Chebbi <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.