From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 9 21:45:47 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F35A16A402 for ; Sun, 9 Apr 2006 21:45:47 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers.102a7e@mired.org) Received: from mired.org (dsl092-153-074.wdc2.dsl.speakeasy.net [66.92.153.74]) by mx1.FreeBSD.org (Postfix) with SMTP id C394443D46 for ; Sun, 9 Apr 2006 21:45:46 +0000 (GMT) (envelope-from mwm-keyword-freebsdhackers.102a7e@mired.org) Received: (qmail 2291 invoked by uid 1001); 9 Apr 2006 21:45:46 -0000 Received: by localhost.mired.org (tmda-sendmail, from uid 1001); Sun, 09 Apr 2006 17:45:46 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17465.32905.727289.260996@bhuda.mired.org> Date: Sun, 9 Apr 2006 17:45:45 -0400 To: babkin@users.sourceforge.net In-Reply-To: <9399827.1657341144611794358.JavaMail.root@vms070.mailsrvcs.net> References: <9399827.1657341144611794358.JavaMail.root@vms070.mailsrvcs.net> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer Cc: Ceri Davies , Scott Long , hackers@freebsd.org Subject: What's in a (device) name? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2006 21:45:47 -0000 In <9399827.1657341144611794358.JavaMail.root@vms070.mailsrvcs.net>, Sergey Babkin typed: > I think this is a problem consisting of multiple parts: > > 1. Identify physical devices and be able to access them. > > 2. Identify some stable "logical" names by device type, > that stay fixed when the configuration changes. > > 3. Be able to find the mapping easily between these two. > > 4. Be able to change that mapping. I think you're looking at only two of the three aspects of the naming problem. This covers dealing with systems administration, but not using the system. Solving that for a particular device type might make the "logical" name unneeded. Then again, it might not. > So, since we have devfs nowadays, why don't we just > have multiple names (dev files) for the same device? > For example, the same device can be named by driver > aha0b0t0d0 and by logical type disk0. The 3rd part > can be solved by using symlinks in devfs: i.e. > disk0 would be a symlink to aha0b0t0d0, and you can do > "ls" and find out what is linked to what. The 4th part > can be solved by allowing the sysadmin to create symlinks > in devfs. The network driver subsystem would obviously have > to be changed to consult devfs for the device names. This is essentially the solution that Sun adapted for Solaris. Note that the mapping from "logical" names to "physical" names needs to be fixed, so that you might have a system with disk1 and disk2, but no disk0 because it's been removed. The major problem with it is that todays bus architectures don't have stable device addresses. Instead of devices having a fixed address on the bus that the user sets, the addresses are assigned as the devices are discovered. This is pretty much a requirement if you want to sell hardware to 12:00 flashers. While that's not the market that FreeBSD deals with, it is the hardware that FreeBSD runs on. The other problem is that not all devices that need names have entries in /dev. While that's fixable, different solutions will be optimal for different kinds of devices anyway, so we may not want to fix it. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.