From owner-freebsd-arch@FreeBSD.ORG Wed Jan 31 19:51:50 2007 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 017B716A402 for ; Wed, 31 Jan 2007 19:51:50 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id E6D8013C491 for ; Wed, 31 Jan 2007 19:51:49 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l0VJpmvs061245; Wed, 31 Jan 2007 11:51:48 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l0VJpmca061244; Wed, 31 Jan 2007 11:51:48 -0800 (PST) (envelope-from rizzo) Date: Wed, 31 Jan 2007 11:51:48 -0800 From: Luigi Rizzo To: arch@freebsd.org Message-ID: <20070131115148.A60420@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Cc: Subject: configurable device (and other) tables in the kernel ? 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: Wed, 31 Jan 2007 19:51:50 -0000 I think there was some discussion on the topic some time ago but cannot remember if there was any outcome so let me ask. We have several tables in our kernel and modules, containing at least device-id tables (pci, usb), quirks for certain devices, and maybe more (i am excluding firmware because it is not something where you may want to change a few lines manually). Right now we compile them statically in the code. However sometimes it is useful to update them 'on the fly' without having to rebuild a kernel/module - e.g. because an entry (e.g. a quirk for a specific device) cannot be safely included in the distribution, etc.etc. What are the options to implement a mechanism that lets userland update such tables, and maybe in a way that is accessible to the boot loader ? The (obvious) requirements are: + support for multiple tables with variable (maybe defined at compile time) structure; + initial values should be compiled in; + the access mechanism should provide mechanism to read/modify/write/delete entries; + human-readable (i.e. textual) representation of entries in userland, with hooks to translate them in a machine-friendly format on writes, and back on reads; sysctl is the first method that comes to my mind, but perhaps there is some better way ? cheers luigi