From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 08:45:09 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5817816A4D1 for ; Sun, 20 Jun 2004 08:45:09 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id B727443D5D for ; Sun, 20 Jun 2004 08:45:08 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5K8j25s082938; Sun, 20 Jun 2004 10:45:02 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: "M. Warner Losh" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 19 Jun 2004 14:57:36 MDT." <20040619.145736.91276883.imp@bsdimp.com> Date: Sun, 20 Jun 2004 10:45:02 +0200 Message-ID: <82937.1087721102@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: arch@freebsd.org Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 08:45:09 -0000 In message <20040619.145736.91276883.imp@bsdimp.com>, "M. Warner Losh" writes: >In message: <61609.1087632958@critter.freebsd.dk> > Poul-Henning Kamp writes: >: This patch moves the "lock/initial" facility known from sio(4) up >: to the generic tty layer. >: >: It adds two new flags to stty(1): -i and -l to manipulate the initial >: and lock states and eliminates the tty[il]d# and cua[il]a# devices. > >I like this idea a *LOT*. > >: Subsequently I would like to move the tty/cua split up as well. > >How would this look to the various drivers? Simpler. The situation is distressingly like it were in the disk device drivers before I headed over that way some years ago: A lot of stuff in the drivers that do not belong there, rampant copy&paste and insufficient abstraction above. In an ideal world the hardware driver would be reduced to just that, a few simple primitives, "start", "config", "open", "close" and a backcall "rint" with received data and modem status changes. This is not too unlike what Marcel have done with uart(4) The major difference is that serial ports are rapidly headed into the sunset whereas disks are very much a hot topic. The pty driver is the only really interesting tty driver these days as most terminal access is through sshd, telnetd or xterm. Currently I see two ways to get ptys out form under giant: 1) write an entirely new pty driver which is totally separate from the rest of the tty code (We don't need slip/ppp/netgraph support on ptys anyway). 2) clean up the tty code enough that the pty can be deGiantized, paving the road for the rest of the tty drivers to get the same treatment, should somebody else care enough. I havn't quite made up my mind yet, and have resorted to some general polishing while I try to make sense of this stuff. To some extent I already regret getting my fingers dirty over here. -- 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. From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 16:51:23 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C88F116A4CF for ; Sun, 20 Jun 2004 16:51:23 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E9D943D53 for ; Sun, 20 Jun 2004 16:51:23 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i5KGnwqR005537; Sun, 20 Jun 2004 10:49:58 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Jun 2004 10:50:00 -0600 (MDT) Message-Id: <20040620.105000.106880101.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <82937.1087721102@critter.freebsd.dk> References: <20040619.145736.91276883.imp@bsdimp.com> <82937.1087721102@critter.freebsd.dk> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 16:51:23 -0000 In message: <82937.1087721102@critter.freebsd.dk> "Poul-Henning Kamp" writes: : In an ideal world the hardware driver would be reduced to just that, : a few simple primitives, "start", "config", "open", "close" and a : backcall "rint" with received data and modem status changes. This : is not too unlike what Marcel have done with uart(4) I guess I'm curious how the tty/cua split would be done in this scheme. Of course I'm reimplementing the Cyclades Z driver to try to use uart, which is why I'm getting curious. I don't know if this will wind up working or not, but since 95% of the hardware interface is two circular buffers in memory, which does seem to map mostly onto Marcel's model. Time will tell... I also have porting the stallion driver to current. I can do this by a simple hack on the old driver, or a rewrite. I'll use my Z experience to decide. : The major difference is that serial ports are rapidly headed into : the sunset whereas disks are very much a hot topic. I suspect that the decline will last for a long time. Many of the usb devices that I've seen are really usb to rs232 to thing, so I suspect that it is a case of 'Serial ports are dead, long live the serial ports' : The pty driver is the only really interesting tty driver these days : as most terminal access is through sshd, telnetd or xterm. There's still a lot of people using ppp for dialup connections, even in the day of broadband. I suspect that will be the other large area of heavy use. : Currently I see two ways to get ptys out form under giant: : : 1) write an entirely new pty driver which is totally separate : from the rest of the tty code (We don't need slip/ppp/netgraph : support on ptys anyway). : : 2) clean up the tty code enough that the pty can be deGiantized, : paving the road for the rest of the tty drivers to get the : same treatment, should somebody else care enough. Are you looking for help on the latter? : I havn't quite made up my mind yet, and have resorted to some general : polishing while I try to make sense of this stuff. To some extent I : already regret getting my fingers dirty over here. OK. Warner From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 17:38:02 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B076716A4CE for ; Sun, 20 Jun 2004 17:38:02 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CE5443D48 for ; Sun, 20 Jun 2004 17:38:02 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5KHbtPQ090779; Sun, 20 Jun 2004 19:37:55 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: "M. Warner Losh" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 20 Jun 2004 10:50:00 MDT." <20040620.105000.106880101.imp@bsdimp.com> Date: Sun, 20 Jun 2004 19:37:55 +0200 Message-ID: <90778.1087753075@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: arch@freebsd.org Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 17:38:02 -0000 In message <20040620.105000.106880101.imp@bsdimp.com>, "M. Warner Losh" writes: >In message: <82937.1087721102@critter.freebsd.dk> > "Poul-Henning Kamp" writes: >: In an ideal world the hardware driver would be reduced to just that, >: a few simple primitives, "start", "config", "open", "close" and a >: backcall "rint" with received data and modem status changes. This >: is not too unlike what Marcel have done with uart(4) > >I guess I'm curious how the tty/cua split would be done in this >scheme. It falls out quite naturally. The tty/cua split is a software abstraction only, the hardware doesn't know. >: The major difference is that serial ports are rapidly headed into >: the sunset whereas disks are very much a hot topic. > >I suspect that the decline will last for a long time. Many of the usb >devices that I've seen are really usb to rs232 to thing, so I suspect >that it is a case of 'Serial ports are dead, long live the serial >ports' Right, but the days of one FreeBSD box with 64 modems are over. We're typically talking less than a handful serial ports per machine and only seldom with anything approaching full bw trafic. >: Currently I see two ways to get ptys out form under giant: >: >: 1) write an entirely new pty driver which is totally separate >: from the rest of the tty code (We don't need slip/ppp/netgraph >: support on ptys anyway). >: >: 2) clean up the tty code enough that the pty can be deGiantized, >: paving the road for the rest of the tty drivers to get the >: same treatment, should somebody else care enough. > I like what Marcel has done with uart(4), it's pretty close to what I would have done, but bruce has raised some valid performance concerns regarding the interrupt performance etc. I think the way I see it right now, a serial port should not have a cdevsw{} at all, all that stuff should happen in the generic layer. Right now, I'm trying to get to the point where I can use ttyread() and ttywrite() in sio(4) (and subsequently all other drivers). The major things in the way of this right now is the lock/init and cua/tty processing in sio and the absense of a tty_detach() (I have a partial patch for that). (Sounds like the disk mini-layer all over doesn't it ?) The other weird detail is the slip/ppp/netgraph line disciplines which really doesn't want to be linedisciplines but just want to get access to the serial port. Finally there is the console thing which is a real mess seen from any layering point of view. So I guess what I really would like to see is an API for hooking a serial port into the kernel, a multiplex at that level where SLIP, PPP, netgraph and TTY can grab hold of a port. Consoles and kernel debuggers are slightly special but go at the same level. (We might want to have a poll-facility which calls all the interrupt routines when we are in a debugger that way the hw-drivers might be less magic) The major trouble in doing anything about this is testing all the non-uart(4) hardware drivers. More unknowns than knowns at this point. >Are you looking for help on the latter? I'm always looking for help :-) the problem is that I'm not sure I know with what in this case. -- 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. From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 17:57:42 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05F5916A4CE for ; Sun, 20 Jun 2004 17:57:42 +0000 (GMT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A3B343D4C for ; Sun, 20 Jun 2004 17:57:41 +0000 (GMT) (envelope-from marcel@xcllnt.net) Received: from dhcp50.pn.xcllnt.net (dhcp50.pn.xcllnt.net [192.168.4.250]) by ns1.xcllnt.net (8.12.11/8.12.11) with ESMTP id i5KHvCUf076982; Sun, 20 Jun 2004 10:57:12 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp50.pn.xcllnt.net (localhost [127.0.0.1]) i5KHvBJn001872; Sun, 20 Jun 2004 10:57:11 -0700 (PDT) (envelope-from marcel@dhcp50.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp50.pn.xcllnt.net (8.12.11/8.12.11/Submit) id i5KHvBJ2001871; Sun, 20 Jun 2004 10:57:11 -0700 (PDT) (envelope-from marcel) Date: Sun, 20 Jun 2004 10:57:11 -0700 From: Marcel Moolenaar To: "M. Warner Losh" Message-ID: <20040620175711.GA1823@dhcp50.pn.xcllnt.net> References: <20040619.145736.91276883.imp@bsdimp.com> <82937.1087721102@critter.freebsd.dk> <20040620.105000.106880101.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040620.105000.106880101.imp@bsdimp.com> User-Agent: Mutt/1.4.2.1i cc: arch@freebsd.org cc: phk@phk.freebsd.dk Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 17:57:42 -0000 On Sun, Jun 20, 2004 at 10:50:00AM -0600, M. Warner Losh wrote: > > Of course I'm reimplementing the Cyclades Z driver to try to use > uart, which is why I'm getting curious. I don't know if this will > wind up working or not, but since 95% of the hardware interface is two > circular buffers in memory, which does seem to map mostly onto > Marcel's model. Time will tell... I also have porting the stallion > driver to current. I can do this by a simple hack on the old driver, > or a rewrite. I'll use my Z experience to decide. You probably want to review my uart(4) notes WRT multiport cards: http://wiki.daemon.li/index.pl?Uart(4) This may or may not align with your thinking. If not, maybe we should quickly touch bases... PS: I just added cyclades to the list of references there. Feel free to add more or replace this with a better one. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 18:02:42 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAEC816A4CE for ; Sun, 20 Jun 2004 18:02:42 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5684F43D45 for ; Sun, 20 Jun 2004 18:02:42 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i5KI1tGu006398; Sun, 20 Jun 2004 12:01:55 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Jun 2004 12:01:57 -0600 (MDT) Message-Id: <20040620.120157.116436344.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <90778.1087753075@critter.freebsd.dk> References: <20040620.105000.106880101.imp@bsdimp.com> <90778.1087753075@critter.freebsd.dk> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 18:02:43 -0000 In message: <90778.1087753075@critter.freebsd.dk> "Poul-Henning Kamp" writes: : It falls out quite naturally. The tty/cua split is a software : abstraction only, the hardware doesn't know. Well, the hardware doesn't know, but the state of the hardware does matter. Maybe that's where my confusion comes from. : >: The major difference is that serial ports are rapidly headed into : >: the sunset whereas disks are very much a hot topic. : > : >I suspect that the decline will last for a long time. Many of the usb : >devices that I've seen are really usb to rs232 to thing, so I suspect : >that it is a case of 'Serial ports are dead, long live the serial : >ports' : : Right, but the days of one FreeBSD box with 64 modems are over. Agreed. They will still be built, but there won't be a lot of them. Of course, there never were a lot of them... I'm wondering how I'm going to test 16 ports of 1mbps traffic, for example... : We're typically talking less than a handful serial ports per machine : and only seldom with anything approaching full bw trafic. Agreed. : >: Currently I see two ways to get ptys out form under giant: : >: : >: 1) write an entirely new pty driver which is totally separate : >: from the rest of the tty code (We don't need slip/ppp/netgraph : >: support on ptys anyway). : >: : >: 2) clean up the tty code enough that the pty can be deGiantized, : >: paving the road for the rest of the tty drivers to get the : >: same treatment, should somebody else care enough. : > : : I like what Marcel has done with uart(4), it's pretty close to what : I would have done, but bruce has raised some valid performance : concerns regarding the interrupt performance etc. : : I think the way I see it right now, a serial port should not have : a cdevsw{} at all, all that stuff should happen in the generic : layer. I tend to agree. The serial layer is a spigot. You get bits in, you pump bits out and there are some rules about when/how you can do both or react to changes in the signaled interface. Driver shouldn't know anything at all about line disciplines. They know just enough to call them now, but it seems like that should be done at a different layer. : Right now, I'm trying to get to the point where I can use ttyread() : and ttywrite() in sio(4) (and subsequently all other drivers). The : major things in the way of this right now is the lock/init and : cua/tty processing in sio and the absense of a tty_detach() (I have : a partial patch for that). : : (Sounds like the disk mini-layer all over doesn't it ?) Or the mini-layer for sound drivers. Or the abstraction cam provides for scsi and atapi controllers, etc. : The other weird detail is the slip/ppp/netgraph line disciplines : which really doesn't want to be linedisciplines but just want to : get access to the serial port. Finally there is the console thing : which is a real mess seen from any layering point of view. The console thing is a mess, but a very useful mess :-(. : So I guess what I really would like to see is an API for hooking : a serial port into the kernel, a multiplex at that level where : SLIP, PPP, netgraph and TTY can grab hold of a port. Consoles and : kernel debuggers are slightly special but go at the same level. : (We might want to have a poll-facility which calls all the interrupt : routines when we are in a debugger that way the hw-drivers might : be less magic) Yes. That matches some ideas I've had on the tty layer for some time now. : I'm always looking for help :-) the problem is that I'm not sure : I know with what in this case. OK. I'll plow forward on the cyclades driver I'm working on then. I think having 3 people that have recently written a tty driver would be useful. Although Bruce hasn't written one recently (that I know about), his knowledge is extensive there too... Warner From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 18:23:56 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D304616A4CE for ; Sun, 20 Jun 2004 18:23:56 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68C7043D39 for ; Sun, 20 Jun 2004 18:23:56 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i5KIKsND006619; Sun, 20 Jun 2004 12:20:54 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Jun 2004 12:20:57 -0600 (MDT) Message-Id: <20040620.122057.84501606.imp@bsdimp.com> To: marcel@xcllnt.net From: "M. Warner Losh" In-Reply-To: <20040620175711.GA1823@dhcp50.pn.xcllnt.net> References: <82937.1087721102@critter.freebsd.dk> <20040620.105000.106880101.imp@bsdimp.com> <20040620175711.GA1823@dhcp50.pn.xcllnt.net> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: phk@phk.freebsd.dk Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 18:23:56 -0000 In message: <20040620175711.GA1823@dhcp50.pn.xcllnt.net> Marcel Moolenaar writes: : On Sun, Jun 20, 2004 at 10:50:00AM -0600, M. Warner Losh wrote: : > : > Of course I'm reimplementing the Cyclades Z driver to try to use : > uart, which is why I'm getting curious. I don't know if this will : > wind up working or not, but since 95% of the hardware interface is two : > circular buffers in memory, which does seem to map mostly onto : > Marcel's model. Time will tell... I also have porting the stallion : > driver to current. I can do this by a simple hack on the old driver, : > or a rewrite. I'll use my Z experience to decide. : : You probably want to review my uart(4) notes WRT multiport cards: : http://wiki.daemon.li/index.pl?Uart(4) : : This may or may not align with your thinking. If not, maybe we : should quickly touch bases... : : PS: I just added cyclades to the list of references there. Feel free : to add more or replace this with a better one. OK. I've added a few of my own notes to the mix. I think that fleshing out the notes a little more might be useful. It looks like there are many granularities for the knowning about which uarts generated. It looks like on stallion cards, for example, you know which pannel generated an interrupt, but that the pannel might have 4 different multi-port uarts you have to then go query. Warner From owner-freebsd-arch@FreeBSD.ORG Sun Jun 20 19:42:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE32716A4DD for ; Sun, 20 Jun 2004 19:42:16 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A5C343D55 for ; Sun, 20 Jun 2004 19:42:16 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5KJgBQT092929; Sun, 20 Jun 2004 21:42:11 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: "M. Warner Losh" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 20 Jun 2004 12:20:57 MDT." <20040620.122057.84501606.imp@bsdimp.com> Date: Sun, 20 Jun 2004 21:42:11 +0200 Message-ID: <92928.1087760531@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: arch@freebsd.org cc: marcel@xcllnt.net Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2004 19:42:17 -0000 In message <20040620.122057.84501606.imp@bsdimp.com>, "M. Warner Losh" writes: >: >: PS: I just added cyclades to the list of references there. Feel free >: to add more or replace this with a better one. > >OK. I've added a few of my own notes to the mix. I think that >fleshing out the notes a little more might be useful. It looks like >there are many granularities for the knowning about which uarts >generated. It looks like on stallion cards, for example, you know >which pannel generated an interrupt, but that the pannel might have 4 >different multi-port uarts you have to then go query. I put a cautionary note about sync devices there. I would really advocate not going anywhere near sync modes unless we have a really compelling reason to. -- 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. From owner-freebsd-arch@FreeBSD.ORG Mon Jun 21 12:24:23 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 543D316A4CE for ; Mon, 21 Jun 2004 12:24:23 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 908CC43D39 for ; Mon, 21 Jun 2004 12:24:22 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5LCOAOT016538; Mon, 21 Jun 2004 14:24:10 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: "M. Warner Losh" From: "Poul-Henning Kamp" Date: Mon, 21 Jun 2004 14:24:10 +0200 Message-ID: <16537.1087820650@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: arch@freebsd.org cc: marcel@xcllnt.net Subject: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 12:24:23 -0000 Do we need the COMPAT_43 tty processing in 5-STABLE ? -- 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. From owner-freebsd-arch@FreeBSD.ORG Mon Jun 21 13:33:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA5F216A4CE for ; Mon, 21 Jun 2004 13:33:16 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70C4443D1F for ; Mon, 21 Jun 2004 13:33:16 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i5LDUCit016343; Mon, 21 Jun 2004 07:30:12 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 21 Jun 2004 07:30:15 -0600 (MDT) Message-Id: <20040621.073015.104018022.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <16537.1087820650@critter.freebsd.dk> References: <16537.1087820650@critter.freebsd.dk> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 13:33:17 -0000 In message: <16537.1087820650@critter.freebsd.dk> "Poul-Henning Kamp" writes: : Do we need the COMPAT_43 tty processing in 5-STABLE ? Last time I removed it, xterm broke. That was a while ago... Warner From owner-freebsd-arch@FreeBSD.ORG Mon Jun 21 13:55:03 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16F2316A4CE for ; Mon, 21 Jun 2004 13:55:03 +0000 (GMT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id E00E243D46 for ; Mon, 21 Jun 2004 13:55:02 +0000 (GMT) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.40.114) by smtp01.syd.iprimus.net.au (7.0.028) id 40D65C3600030BE1; Mon, 21 Jun 2004 23:54:52 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 3E80F41F5; Mon, 21 Jun 2004 23:58:06 +1000 (EST) Date: Mon, 21 Jun 2004 23:58:06 +1000 From: Tim Robbins To: "M. Warner Losh" Message-ID: <20040621135806.GA74902@cat.robbins.dropbear.id.au> References: <16537.1087820650@critter.freebsd.dk> <20040621.073015.104018022.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040621.073015.104018022.imp@bsdimp.com> User-Agent: Mutt/1.4.1i cc: arch@freebsd.org cc: phk@phk.freebsd.dk cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 13:55:03 -0000 On Mon, Jun 21, 2004 at 07:30:15AM -0600, M. Warner Losh wrote: > In message: <16537.1087820650@critter.freebsd.dk> > "Poul-Henning Kamp" writes: > : Do we need the COMPAT_43 tty processing in 5-STABLE ? > > Last time I removed it, xterm broke. That was a while ago... COMPAT_43 is disabled by default on amd64, and I can assure you that xterm works. Tim From owner-freebsd-arch@FreeBSD.ORG Mon Jun 21 14:06:32 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B86316A4CE; Mon, 21 Jun 2004 14:06:32 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 014C943D64; Mon, 21 Jun 2004 14:06:32 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i5LE46mx016810; Mon, 21 Jun 2004 08:04:06 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 21 Jun 2004 08:04:09 -0600 (MDT) Message-Id: <20040621.080409.17810931.imp@bsdimp.com> To: tjr@freebsd.org From: "M. Warner Losh" In-Reply-To: <20040621135806.GA74902@cat.robbins.dropbear.id.au> References: <16537.1087820650@critter.freebsd.dk> <20040621.073015.104018022.imp@bsdimp.com> <20040621135806.GA74902@cat.robbins.dropbear.id.au> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: phk@phk.freebsd.dk cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 14:06:32 -0000 In message: <20040621135806.GA74902@cat.robbins.dropbear.id.au> Tim Robbins writes: : On Mon, Jun 21, 2004 at 07:30:15AM -0600, M. Warner Losh wrote: : : > In message: <16537.1087820650@critter.freebsd.dk> : > "Poul-Henning Kamp" writes: : > : Do we need the COMPAT_43 tty processing in 5-STABLE ? : > : > Last time I removed it, xterm broke. That was a while ago... : : COMPAT_43 is disabled by default on amd64, and I can assure you that : xterm works. I tried this last in the 3.4 time frame... I wouldn't have though that was enough time for the X folks to fix it, given how fast they move... Warner From owner-freebsd-arch@FreeBSD.ORG Mon Jun 21 14:22:17 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2D6116A4CE for ; Mon, 21 Jun 2004 14:22:17 +0000 (GMT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id B747E43D5E for ; Mon, 21 Jun 2004 14:22:17 +0000 (GMT) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.44.176) by smtp01.syd.iprimus.net.au (7.0.028) id 40D65C3600032B50; Tue, 22 Jun 2004 00:22:04 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id D709841CB; Tue, 22 Jun 2004 00:25:17 +1000 (EST) Date: Tue, 22 Jun 2004 00:25:17 +1000 From: Tim Robbins To: Poul-Henning Kamp Message-ID: <20040621142517.GB74902@cat.robbins.dropbear.id.au> References: <16537.1087820650@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16537.1087820650@critter.freebsd.dk> User-Agent: Mutt/1.4.1i cc: arch@freebsd.org cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 14:22:18 -0000 On Mon, Jun 21, 2004 at 02:24:10PM +0200, Poul-Henning Kamp wrote: > > Do we need the COMPAT_43 tty processing in 5-STABLE ? I assume you mean that you want to remove the option entirely, not just take it out of GENERIC. Whether we need it or not depends what we're willing to break: most screen-oriented programs in early releases of FreeBSD used it, either by linking with libcurses, issuing the ioctls directly, or by calling the widely-used ttyname() function. I think removing the compatibility tty ioctls would make COMPAT_43 incomplete and largely worthless; either we support running FreeBSD 1.x/2.x binaries or we don't. On one hand, I would like to see the mostly-unused code removed to facilitate whatever tty work you're doing, but on the other hand, I see the ability to run old binaries as one of the things that sets us apart from Linux. Tim From owner-freebsd-arch@FreeBSD.ORG Wed Jun 23 23:43:23 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 547D216A4CE for ; Wed, 23 Jun 2004 23:43:23 +0000 (GMT) Received: from VARK.homeunix.com (adsl-69-107-109-228.dsl.pltn13.pacbell.net [69.107.109.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECB4443D1D for ; Wed, 23 Jun 2004 23:43:22 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i5NNgT90001644; Wed, 23 Jun 2004 16:42:29 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i5NNRPfP001495; Wed, 23 Jun 2004 16:27:25 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 23 Jun 2004 16:27:25 -0700 From: David Schultz To: Poul-Henning Kamp Message-ID: <20040623232725.GA1406@VARK.homeunix.com> Mail-Followup-To: Poul-Henning Kamp , "M. Warner Losh" , arch@FreeBSD.ORG, marcel@xcllnt.net References: <16537.1087820650@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16537.1087820650@critter.freebsd.dk> cc: arch@FreeBSD.ORG cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2004 23:43:23 -0000 On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: > > Do we need the COMPAT_43 tty processing in 5-STABLE ? FWIW, I used to run with COMPAT_43 disabled entirely. I think the only breakage I noticed was that the Linuxolator didn't work anymore because of a number of `#ifdef COMPAT_43's in the socket code that linux.ko depends on. From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 02:00:28 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A959D16A4CF; Fri, 25 Jun 2004 02:00:28 +0000 (GMT) Received: from daintree.corp.yahoo.com (daintree.corp.yahoo.com [216.145.52.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C10343D46; Fri, 25 Jun 2004 02:00:28 +0000 (GMT) (envelope-from peter@yahoo-inc.com) Received: by daintree.corp.yahoo.com (Postfix, from userid 2154) id 10946881B; Thu, 24 Jun 2004 18:59:55 -0700 (PDT) From: Peter Wemm To: freebsd-arch@freebsd.org Date: Thu, 24 Jun 2004 18:59:54 -0700 User-Agent: KMail/1.6.2 References: <16537.1087820650@critter.freebsd.dk> <20040623232725.GA1406@VARK.homeunix.com> In-Reply-To: <20040623232725.GA1406@VARK.homeunix.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406241859.54810.peter@wemm.org> cc: arch@FreeBSD.ORG cc: David Schultz cc: Poul-Henning Kamp cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 02:00:28 -0000 On Wednesday 23 June 2004 04:27 pm, David Schultz wrote: > On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: > > Do we need the COMPAT_43 tty processing in 5-STABLE ? > > FWIW, I used to run with COMPAT_43 disabled entirely. I think the > only breakage I noticed was that the Linuxolator didn't work > anymore because of a number of `#ifdef COMPAT_43's in the socket > code that linux.ko depends on. These should probably be broken out as COMPAT_OLDSOCK, whih is implied by the linuxulator or COMPAT_43 or the like. BTW2: around 10 years ago, I wrote a BSD tty -> SVR4 termios userland translator that worked well enough as a set of helper functions for most source compatability. If we try and keep source compatability alive for old stuff, I suspect that is the better way to do it. It did things like #define ioctl(a,b,c) ttcompat_ioctl(a,b.c) which translated things internally and did real termios calls etc. These days we could probably just kill it entirely and replace it with a short recipe for converting code. eg: list what the new names for the flags and modes are. Most programs do little more than either run in the default line processing mode, or drop into raw mode via cfmakeraw() and friends, possibly with a couple of tweaks to the generated termios settings. No, I'm not volunteering to extract this code of a QIC 6150 tape that I have with it on. I'd sooner help delete it from src/sys than revive that monster. :-) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 02:00:28 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A959D16A4CF; Fri, 25 Jun 2004 02:00:28 +0000 (GMT) Received: from daintree.corp.yahoo.com (daintree.corp.yahoo.com [216.145.52.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C10343D46; Fri, 25 Jun 2004 02:00:28 +0000 (GMT) (envelope-from peter@yahoo-inc.com) Received: by daintree.corp.yahoo.com (Postfix, from userid 2154) id 10946881B; Thu, 24 Jun 2004 18:59:55 -0700 (PDT) From: Peter Wemm To: freebsd-arch@freebsd.org Date: Thu, 24 Jun 2004 18:59:54 -0700 User-Agent: KMail/1.6.2 References: <16537.1087820650@critter.freebsd.dk> <20040623232725.GA1406@VARK.homeunix.com> In-Reply-To: <20040623232725.GA1406@VARK.homeunix.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406241859.54810.peter@wemm.org> cc: arch@FreeBSD.ORG cc: David Schultz cc: Poul-Henning Kamp cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 02:00:28 -0000 On Wednesday 23 June 2004 04:27 pm, David Schultz wrote: > On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: > > Do we need the COMPAT_43 tty processing in 5-STABLE ? > > FWIW, I used to run with COMPAT_43 disabled entirely. I think the > only breakage I noticed was that the Linuxolator didn't work > anymore because of a number of `#ifdef COMPAT_43's in the socket > code that linux.ko depends on. These should probably be broken out as COMPAT_OLDSOCK, whih is implied by the linuxulator or COMPAT_43 or the like. BTW2: around 10 years ago, I wrote a BSD tty -> SVR4 termios userland translator that worked well enough as a set of helper functions for most source compatability. If we try and keep source compatability alive for old stuff, I suspect that is the better way to do it. It did things like #define ioctl(a,b,c) ttcompat_ioctl(a,b.c) which translated things internally and did real termios calls etc. These days we could probably just kill it entirely and replace it with a short recipe for converting code. eg: list what the new names for the flags and modes are. Most programs do little more than either run in the default line processing mode, or drop into raw mode via cfmakeraw() and friends, possibly with a couple of tweaks to the generated termios settings. No, I'm not volunteering to extract this code of a QIC 6150 tape that I have with it on. I'd sooner help delete it from src/sys than revive that monster. :-) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 10:23:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5047516A4CE; Fri, 25 Jun 2004 10:23:16 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9890643D1F; Fri, 25 Jun 2004 10:23:15 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5PAM1fn012550; Fri, 25 Jun 2004 12:22:01 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Peter Wemm From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 24 Jun 2004 18:59:54 PDT." <200406241859.54810.peter@wemm.org> Date: Fri, 25 Jun 2004 12:22:01 +0200 Message-ID: <12549.1088158921@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: arch@freebsd.org cc: David Schultz cc: marcel@xcllnt.net cc: freebsd-arch@freebsd.org Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 10:23:16 -0000 In message <200406241859.54810.peter@wemm.org>, Peter Wemm writes: >On Wednesday 23 June 2004 04:27 pm, David Schultz wrote: >> On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: >> > Do we need the COMPAT_43 tty processing in 5-STABLE ? >> >> FWIW, I used to run with COMPAT_43 disabled entirely. I think the >> only breakage I noticed was that the Linuxolator didn't work >> anymore because of a number of `#ifdef COMPAT_43's in the socket >> code that linux.ko depends on. > >These should probably be broken out as COMPAT_OLDSOCK, whih is implied >by the linuxulator or COMPAT_43 or the like. Or better yet: made unncessary in the linuxolator ? >These days we could probably just kill it entirely and replace it with a >short recipe for converting code. eg: list what the new names for >the flags and modes are. Most programs do little more than either run >in the default line processing mode, or drop into raw mode via >cfmakeraw() and friends, possibly with a couple of tweaks to the >generated termios settings. > >No, I'm not volunteering to extract this code of a QIC 6150 tape that I >have with it on. I'd sooner help delete it from src/sys than revive >that monster. :-) I've asked our ports-meister to run a build without the COMPAT_43 tty code and the ports crew to get rid of -lcompat in the ports to the extent possible and I fully expect COMPAT_43 tty processing to not be in 5-STABLE. -- 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. From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 10:23:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5047516A4CE; Fri, 25 Jun 2004 10:23:16 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9890643D1F; Fri, 25 Jun 2004 10:23:15 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5PAM1fn012550; Fri, 25 Jun 2004 12:22:01 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Peter Wemm From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 24 Jun 2004 18:59:54 PDT." <200406241859.54810.peter@wemm.org> Date: Fri, 25 Jun 2004 12:22:01 +0200 Message-ID: <12549.1088158921@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: arch@freebsd.org cc: David Schultz cc: marcel@xcllnt.net cc: freebsd-arch@freebsd.org Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 10:23:16 -0000 In message <200406241859.54810.peter@wemm.org>, Peter Wemm writes: >On Wednesday 23 June 2004 04:27 pm, David Schultz wrote: >> On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: >> > Do we need the COMPAT_43 tty processing in 5-STABLE ? >> >> FWIW, I used to run with COMPAT_43 disabled entirely. I think the >> only breakage I noticed was that the Linuxolator didn't work >> anymore because of a number of `#ifdef COMPAT_43's in the socket >> code that linux.ko depends on. > >These should probably be broken out as COMPAT_OLDSOCK, whih is implied >by the linuxulator or COMPAT_43 or the like. Or better yet: made unncessary in the linuxolator ? >These days we could probably just kill it entirely and replace it with a >short recipe for converting code. eg: list what the new names for >the flags and modes are. Most programs do little more than either run >in the default line processing mode, or drop into raw mode via >cfmakeraw() and friends, possibly with a couple of tweaks to the >generated termios settings. > >No, I'm not volunteering to extract this code of a QIC 6150 tape that I >have with it on. I'd sooner help delete it from src/sys than revive >that monster. :-) I've asked our ports-meister to run a build without the COMPAT_43 tty code and the ports crew to get rid of -lcompat in the ports to the extent possible and I fully expect COMPAT_43 tty processing to not be in 5-STABLE. -- 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. From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 10:34:52 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B30C516A4CE for ; Fri, 25 Jun 2004 10:34:52 +0000 (GMT) Received: from solen.gac.edu (solen.gac.edu [138.236.128.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 400F243D1D for ; Fri, 25 Jun 2004 10:34:52 +0000 (GMT) (envelope-from "") Received: (from sendmail@localhost) by solen.gac.edu (8.9.3/8.9.3/GAC-HUB-2.43) id FAA25977 for freebsd-arch@freebsd.org; Fri, 25 Jun 2004 05:33:42 -0500 (CDT) Date: Fri, 25 Jun 2004 05:33:42 -0500 (CDT) Message-Id: <200406251033.FAA25977@solen.gac.edu> X-Authentication-Warning: solen.gac.edu: sendmail set sender to <> using -f X-Loop: forward@gac.edu To: freebsd-arch@freebsd.org From: root@solen.gac.edu Subject: Account name change X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 10:34:52 -0000 This message is sent automatically to you to notify you that the address "scott@gustavus.edu" is no longer valid. For a short period of time, mail sent to that address will be forwarded to the new address "scott@doubleu.com". This includes your message regarding "Mail Delivery (failure scott@gac.edu)" Please send all future e-mail to the new address. -Systems Management From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 10:41:19 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3342416A4CE; Fri, 25 Jun 2004 10:41:19 +0000 (GMT) Received: from robbins.dropbear.id.au (189.c.002.mel.iprimus.net.au [203.134.135.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 782EC43D1F; Fri, 25 Jun 2004 10:41:18 +0000 (GMT) (envelope-from tim@robbins.dropbear.id.au) Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 504B3415B; Fri, 25 Jun 2004 20:42:10 +1000 (EST) Date: Fri, 25 Jun 2004 20:42:10 +1000 From: Tim Robbins To: Poul-Henning Kamp Message-ID: <20040625104210.GA4762@cat.robbins.dropbear.id.au> References: <200406241859.54810.peter@wemm.org> <12549.1088158921@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12549.1088158921@critter.freebsd.dk> User-Agent: Mutt/1.4.1i cc: arch@freebsd.org cc: David Schultz cc: freebsd-arch@freebsd.org cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 10:41:19 -0000 On Fri, Jun 25, 2004 at 12:22:01PM +0200, Poul-Henning Kamp wrote: > In message <200406241859.54810.peter@wemm.org>, Peter Wemm writes: > >On Wednesday 23 June 2004 04:27 pm, David Schultz wrote: > >> On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: > >> > Do we need the COMPAT_43 tty processing in 5-STABLE ? > >> > >> FWIW, I used to run with COMPAT_43 disabled entirely. I think the > >> only breakage I noticed was that the Linuxolator didn't work > >> anymore because of a number of `#ifdef COMPAT_43's in the socket > >> code that linux.ko depends on. > > > >These should probably be broken out as COMPAT_OLDSOCK, whih is implied > >by the linuxulator or COMPAT_43 or the like. > > Or better yet: made unncessary in the linuxolator ? This is what NetBSD has done. At one stage I had patches derived from their code that removed the need for the COMPAT_43 socket functions, but COMPAT_43 was still necessary for ostat(), etc. Tim From owner-freebsd-arch@FreeBSD.ORG Fri Jun 25 10:41:19 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3342416A4CE; Fri, 25 Jun 2004 10:41:19 +0000 (GMT) Received: from robbins.dropbear.id.au (189.c.002.mel.iprimus.net.au [203.134.135.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 782EC43D1F; Fri, 25 Jun 2004 10:41:18 +0000 (GMT) (envelope-from tim@robbins.dropbear.id.au) Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 504B3415B; Fri, 25 Jun 2004 20:42:10 +1000 (EST) Date: Fri, 25 Jun 2004 20:42:10 +1000 From: Tim Robbins To: Poul-Henning Kamp Message-ID: <20040625104210.GA4762@cat.robbins.dropbear.id.au> References: <200406241859.54810.peter@wemm.org> <12549.1088158921@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12549.1088158921@critter.freebsd.dk> User-Agent: Mutt/1.4.1i cc: arch@freebsd.org cc: David Schultz cc: freebsd-arch@freebsd.org cc: marcel@xcllnt.net Subject: Re: COMPAT_43 tty processing ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 10:41:19 -0000 On Fri, Jun 25, 2004 at 12:22:01PM +0200, Poul-Henning Kamp wrote: > In message <200406241859.54810.peter@wemm.org>, Peter Wemm writes: > >On Wednesday 23 June 2004 04:27 pm, David Schultz wrote: > >> On Mon, Jun 21, 2004, Poul-Henning Kamp wrote: > >> > Do we need the COMPAT_43 tty processing in 5-STABLE ? > >> > >> FWIW, I used to run with COMPAT_43 disabled entirely. I think the > >> only breakage I noticed was that the Linuxolator didn't work > >> anymore because of a number of `#ifdef COMPAT_43's in the socket > >> code that linux.ko depends on. > > > >These should probably be broken out as COMPAT_OLDSOCK, whih is implied > >by the linuxulator or COMPAT_43 or the like. > > Or better yet: made unncessary in the linuxolator ? This is what NetBSD has done. At one stage I had patches derived from their code that removed the need for the COMPAT_43 socket functions, but COMPAT_43 was still necessary for ostat(), etc. Tim From owner-freebsd-arch@FreeBSD.ORG Sat Jun 26 16:38:55 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 626C316A4CE for ; Sat, 26 Jun 2004 16:38:55 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14B4543D5A for ; Sat, 26 Jun 2004 16:38:55 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i5QGchgD058377 for ; Sat, 26 Jun 2004 12:38:43 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i5QGchKg058374 for ; Sat, 26 Jun 2004 12:38:43 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sat, 26 Jun 2004 12:38:43 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: arch@FreeBSD.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Confusion about process states and invariants X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2004 16:38:55 -0000 Over the last two weeks, I've seen several reports of panics relating to code making incorrect assumptions about process state, generally relating to the "p_ucred" pointer in new and dying processes. In particular, a number of pieces of code assume that if a process is reachable by the all process list (or other process lists), p_ucred will be valid and non-NULL if the process lock is held on the process. This results in possible NULL pointer dereferences in the PRS_NEW state, and also during the tear-down in kern_wait(). At first glance, the easy answer would appear to be "check for p_ucred to be NULL", but I'm actually of the opinion that I'd prefer we have the non-NULL p_ucred invariant actually hold true. This would permit security checks to be performed properly during those windows. I'm not very familiar with our process state and locking, but if someone with a more qualified background in that area could comment on the current issue, that would be useful. FYI, two of the reported problems were in sysctl_kern_proc() and linprocfs. One of those has been patched by checking p_ucred for NULL; the other has not. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research From owner-freebsd-arch@FreeBSD.ORG Sat Jun 26 21:41:22 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCB7216A4CE for ; Sat, 26 Jun 2004 21:41:22 +0000 (GMT) Received: from fidel.freesurf.fr (fidel.freesurf.fr [212.43.206.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 981E343D46 for ; Sat, 26 Jun 2004 21:41:22 +0000 (GMT) (envelope-from nsouch@free.fr) Received: from smtp.freesurf.fr (62-240-249-21.adsl.freesurf.fr [62.240.249.21]) by fidel.freesurf.fr (Postfix) with SMTP id 6045E2A5BA4 for ; Sat, 26 Jun 2004 23:41:07 +0200 (CEST) Received: (qmail 7483 invoked by uid 1001); 26 Jun 2004 21:42:19 -0000 Date: Sat, 26 Jun 2004 23:42:19 +0200 From: Nicolas Souchu To: freebsd-arch@freebsd.org Message-ID: <20040626234219.A7461@armor.freesurf.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Subject: condvar and mutexes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2004 21:41:23 -0000 Why is condvar(9) API not part of the mutex(9) one? A condvar is nothing more than a mutex with a queue of waiting threads. I would simply imagine some wait calls applied to mutexes with the queue in the mutex struct. Nicholas -- Nicholas Souchu - nsouch@free.fr - nsouch@FreeBSD.org http://www.freebsd.org/~nsouch/kgi4BSD