From owner-freebsd-current@FreeBSD.ORG Fri Oct 1 07:29:07 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28EE916A4CE for ; Fri, 1 Oct 2004 07:29:07 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51A0443D1D for ; Fri, 1 Oct 2004 07:29:06 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id i917T5gW060970 for ; Fri, 1 Oct 2004 09:29:05 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: current@freebsd.org From: Poul-Henning Kamp Date: Fri, 01 Oct 2004 09:29:05 +0200 Message-ID: <60969.1096615745@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Subject: [HEADSUP] Breaking all the tty drivers one by one... X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2004 07:29:07 -0000 I am going to commit the meaty part of the tty driver cleanup up starting this weekend and I'll probably do about one or two drivers per day for the next couple of weeks. The total patch is close to 10000 lines and it removes around 3300 lines of duplicated code in the tty drivers. Architectural "before" picture: filesystem code | v DEVFS | v cdevsw device interface | v / code to make device A single tty | look and act like a driver. We have | a tty to the system 20-30 drivers | | in total. | v \ tty hardware handling Architectural "after" picture: filesystem code | v DEVFS | v cdevsw device interface | v Now only one / code to make device copy of this | look and act like a code. \ a tty to the system | v tty driver interface | v 20-30 of these < tty hardware handling In addition to the much saner code structure after this, it also makes our ttys look a lot more like each other. Today there is a lot of annoying small differences between the different drivers. Some have this feature, some havn't. Making all the drivers use the same upper level code makes them behave like a coherent class of drivers (subject of course to hardware limitations). In particular the naming will be made systematic (see earlier email on this subject). The problem is that I can't test more than a few of the tty drivers for lack of hardware so I will undoubtedly break some drivers along the way. I have tried to contact all the authors/maintainers/stuckees as best I could, and the majority of them have been very understanding and answered along the lines of "go ahead, I'll fix it if you break it". Much appreciated guys. If there are any driver maintainers/owners/etc who wants me to leave their driver alone, now is the time to say so! Otherwise, keep your eyes open, test any weird serial hardware you have in your collection, and don't yell too loudly at me too fast, I'll do my best to fix the mistakes I make along the way. Poul-Henning PS: The not quite finished patch can be seen in the perforce branch "phk_tty". -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.