Re: Registering a tty device?
Re: Registering a tty device?
- Subject: Re: Registering a tty device?
- From: Terry Lambert <email@hidden>
- Date: Thu, 9 Nov 2006 15:28:08 -0800
On Nov 8, 2006, at 10:07 PM, sanjay yaragatti wrote:
Hi,
I have written a Virtual COM PORT
driver(kernel).I have regestered it as character
device.Now want to support PPP in it.When I initiate a
connection by giving the command >pppd "MyPort0" it
connects, opens the MyPort0 , calls some ioctls in
my driver (TIOCEXCL,TIOCGETA_64,TIOCSCTTY,TIOCMBIC)
and disconnects.After doing some reading, I came to
know that you have to register your device as tty
device so that it can support PPP.Is it correct or its
just enough to implement the ioctls that the pppd
calls (TIOCEXCL,TIOCGETA_64,TIOCSCTTY,TIOCMBIC).Can
anyone help me in this regard.
Look at the source code for the pty driver:
xnu bsd/kern/tty_pty.c
The ttioctl() called there is implemented in:
xnu bsd/kern/tty.c
I strongly recommend utilizing it to implement the tty line
discipline, rather than trying to "roll your won", since you are
unlikely to get things like controlling tty's correct on your own.
PS: TIOCGETA_64 indicates that your test program is a 64 bit rather
than a 32 bit program; you will likely want to use a 32 bit test
program, since I can't guarantee all aspects of the tty driver have
been made 64-bit happy in whatever version of the OS you're running.
-- Terry
_______________________________________________
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