From owner-freebsd-arch@FreeBSD.ORG Fri Aug 22 19:34:22 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D318A106566C; Fri, 22 Aug 2008 19:34:22 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 921398FC12; Fri, 22 Aug 2008 19:34:22 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 240D47309C; Fri, 22 Aug 2008 21:36:57 +0200 (CEST) Date: Fri, 22 Aug 2008 21:36:57 +0200 From: Luigi Rizzo To: "M. Warner Losh" Message-ID: <20080822193657.GB63527@onelab2.iet.unipi.it> References: <20080822154631.GA61495@onelab2.iet.unipi.it> <20080822155126.GD57443@lor.one-eyed-alien.net> <20080822162259.GA61694@onelab2.iet.unipi.it> <20080822.124019.-692152321.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080822.124019.-692152321.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: brooks@freebsd.org, ivoras@freebsd.org, brueffer@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Magic symlinks redux X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2008 19:34:22 -0000 On Fri, Aug 22, 2008 at 12:40:19PM -0600, M. Warner Losh wrote: > In message: <20080822162259.GA61694@onelab2.iet.unipi.it> > Luigi Rizzo writes: > : Also, we do have a need to push tables of info in the kernel > : (e.g. list of PCI/USB ids, quirks tables and the like), > : maybe we can take this chance to make the varsym subsystem useful > : also within device drivers ? > > No. what problem would this solve? take e.g. uscanner (or several other devices, e.g. if_rl) where the only way to tell whether a device is supported or not is looking up a table of usb vendor/id (the same happens for many pci devices). in the simple cases you just need the id - a more complex one would use linux has a way (forget what the command name is) to add entries to the table at runtime, whereas on freebsd we need to patch&rebuild the module. if make this 'object store' thing (varsym) able to store arrays we could have device drivers scan the arrays (e.g. uscanner_id or if_rl_pciids etc.) to find out if it has a suitable string. one objection that is frequently raised is that randomly adding ids to a kernel table is a potential source of panics, but in the end, to do this you need root access so you could as well rm -rf / and make a similar if not worse damage. cheers luigi