From owner-freebsd-drivers@FreeBSD.ORG Tue Oct 18 00:33:35 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1279416A41F for ; Tue, 18 Oct 2005 00:33:35 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6A0043D49 for ; Tue, 18 Oct 2005 00:33:34 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id j9I0VaD6015013; Mon, 17 Oct 2005 18:31:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 17 Oct 2005 18:32:52 -0600 (MDT) Message-Id: <20051017.183252.78709558.imp@bsdimp.com> To: bharmaji@gmail.com From: "M. Warner Losh" In-Reply-To: <67beabb0510171712v1b1a5d18p15d5a866776392ec@mail.gmail.com> References: <67beabb0510171712v1b1a5d18p15d5a866776392ec@mail.gmail.com> 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 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 17 Oct 2005 18:31:36 -0600 (MDT) Cc: freebsd-drivers@freebsd.org Subject: Re: loading microcode automatically while loading the driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 00:33:35 -0000 In message: <67beabb0510171712v1b1a5d18p15d5a866776392ec@mail.gmail.com> Bharma Ji writes: : I need to run a script that loads microcode onto a chip after its driver has : been loaded during startup. How can this be done? In essence - the : requirement is to run a user specified script during startup(but only after : the driver has been loaded) There's a number of different options for this. By far the easiest is to create a rc.d script and place it in /etc/rc.d or /usr/local/etc/rc.d. You can load firmware and do whatever else you need to do there. Another alternative is to hook into devd and have a script run when the driver attaches. This would have the advantage of running automatically when you load the driver as well as at boot. IF all you want to do is load firmware, you can use techniques similar to isp and ispfw to place the firmware in a module that's loaded as necessary to load the device's firmware. Warner