tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: reuse of linux tty serial driver in NetBSD!

On Wed, 18 Feb 2009 01:39:11 -0800 (PST)
Bits Pilani <> wrote:

> Is there any documentation about the tty drivers in NetBSD? 
> Also is there a simple skeleton tty driver that can be used as a reference to 
> implement a serial tty driver. 
> If I have a linux tty driver, how much of that can be re-used in NetBSD?

What I can remember off the top of my head are tty(4) and pty(4) manual
pages, also documenting the various ioctl(2)'s, linedisc(9) which is
for kernel-land, openpty(3)/pty(4) if you'll be driving tty(4) devices
from userland...  Also, the termios(4) interface is compatible between
Linux and NetBSD (the ioctls might not map identically, however).

An example tty-loopback.c (using two pty(4)s to control two tty(4)s)
may be found here:;content-type=text%2Fx-cvsweb-markup

If you must write a kernel-space tty(4) driver, some existing ones
might be used as example:

$ pwd
$ find . -iname '*tty*'

Possibly others here can point to more obvious examples.

Home | Main Index | Thread Index | Old Index