This is an old revision of the document!


Introduction

Like almost any other UNIX-like operating system, FreeBSD has a TTY layer. A TTY layer allows you to do a lot of things, but in most situations it's used by users to run commands in a shell. FreeBSD's TTY layer works like it should, but it has a lot of room for improvements:

  • The TTY layer still uses the Giant Lock (see SMPTODO)
  • The buffering mechanisms used inside the TTY objects could be a lot smarter (less memory overhead, less copying of data)
  • The layer lacks any form of abstraction, which makes it really hard to add any new features to this layer
  • Hotplugging isn't handled properly

I (EdSchouten) am going to work on the TTY layer for my internship the first half year of 2008. I am willing to work on it even further after I've graduated. My work will be stored in the //depot/user/ed/mpsafetty branch in Perforce.

Redesign

During my research on the current state of the TTY layer, I noticed we could improve so many things, it would be wise to just write a new TTY layer next to the existing one. This has a couple of advantages:

  • You don't break all existing drivers at once, which makes working on it a lot more comfortable (you still have your console driver)
  • You can still change the programming interface during development when needed, because less drivers will be affected

I've written a paper on what my vision is on the new TTY layer, which can be downloaded here.

I'll add a table to this page soon, which will show how things progress.

  • ttyredesign.1213738642.txt.gz
  • Last modified: 2008/06/17 21:37
  • by 127.0.0.1