The tty Layer

In the first of a series of articles on device-driver development, we'll start with how the kernel handles the system console and serial ports.

We have covered the basics of the tty layer, explaining all of the different fields in the tty_driver structure for the 2.4 kernel tree and pointing out which ones are necessary for a driver to implement. The tiny_tty.c driver, see Listing 3 [available at], is a good example of a very minimal tty driver that successfully works. Feel free to use this code as an example for your own tty drivers in the future.


Greg Kroah-Hartman is currently the Linux USB and PCI Hot Plug kernel maintainer. He works for IBM, doing various Linux kernel-related things and can be reached at



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Needs some explanation

Sathish Kumar's picture

The explanation is fine... but if we add the flow graph it will be useful for newbies.....
Please explain detail about tty driver, device, layer...... beacuse the flow is not clear

Need flow diagram

Ajay Thakur's picture

Yes this article is good but it takes time to understand
the flow of data from application to hardware and vice-versa.
It would be good if you can add data flow diagram.

Re: The tty Layer

Anonymous's picture

the section of "why no Read" is not clear, can you explain more ?

Re: The tty Layer

Anonymous's picture

Excellet article, one suggestion.
Adding a listing section which carries a Test code to perform
test on tty driver will be very usefull for newbies.

Brilliant article !!!

Romel's picture

Brilliant article !!!
but more codes example would have been helpful for newbies like me..