From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 27 21:03:57 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFF7C1065675 for ; Thu, 27 Mar 2008 21:03:57 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id 5244E8FC1F for ; Thu, 27 Mar 2008 21:03:57 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so501356uge.37 for ; Thu, 27 Mar 2008 14:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=XNRuu0CJhtx+RJK3DZl8FmECE2P/3XXVr67nEWUjBdM=; b=lYkLSDe/dgEDJ0zBKAF2Q5I/NPe6quQc5+St5mElWuIiD6tdalG4ArfH1omZtLmzuNtLInrh6k603Tojx32yots6JyTFYC3eUdjwnVzb634UcAzF2iA8U/a1AOmgBS9dLqWdqY88Q2WRfAhKQiozENStuBsxR+mfNTZUDB0ju1w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=F9z1xfEl09LWMoxCt7IqwCNoOSyywZt4VJXV0L+2tQaZGSbmkCjhOXXMRyXVbblegn4Qy0NRgmlgSlh24xpVB5rk80lvse5cyNv0OcwK7OV/q7HW4k1lyqQvAjpCBFYU8tpk/YUKZeSy7PEVgqE0gQAU3+h/EbSTaY8oTPls4vo= Received: by 10.78.68.18 with SMTP id q18mr4913491hua.72.1206650353558; Thu, 27 Mar 2008 13:39:13 -0700 (PDT) Received: by 10.78.53.4 with HTTP; Thu, 27 Mar 2008 13:39:13 -0700 (PDT) Message-ID: Date: Thu, 27 Mar 2008 23:39:13 +0300 From: pluknet To: "Alexander Sack" In-Reply-To: <3c0b01820803271252m488159ebi2af2255461f10358@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3c0b01820803270851x24bfe739pea0bd4fb0ebecfb0@mail.gmail.com> <47EBF498.9090409@elischer.org> <3c0b01820803271252m488159ebi2af2255461f10358@mail.gmail.com> Cc: freebsd-hackers@freebsd.org, Julian Elischer , freebsd-drivers@freebsd.org Subject: Re: Stupid driver build/debug questions 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: Thu, 27 Mar 2008 21:03:57 -0000 On 27/03/2008, Alexander Sack wrote: > On Thu, Mar 27, 2008 at 3:25 PM, Julian Elischer wrote: > > Alexander Sack wrote: > > > Hello: > > > > > > New to the FreeBSD kernel and I'm investigating a driver problem > > > (wasn't sure what list this should go on). > > > > > > I was wondering how to make a driver statically built instead of a > > > loadable module? Is this an artifact of the driver source build or > > > the generic kernel configuration mechanism via options etc.? i.e. > > > does a driver need to use something different than the bsd.kmod.mk > > > template make file to build a static driver. > > > > > > What I am trying to do is break at attach time more easily than > > > stepping through driver_probe_and_attach()/driver_attach_child() until > > > the attach routine gets called. I realize I can add a kdb_enter() but > > > I was trying to do this on a live system without rebuilding the kernel > > > (I understand this contradicts my first question but I still want to > > > know how to build drivers statically). > > > > put the filennames in /sys/conf/files or files.i386 (or whatever) > > > > at one stage you could also have a files.{CONFIGNAME} but I haven't > > tried that for a long time. > > > Thanks for the response. I will try this but I do have an obvious > question, the build scripts do not need to be edited at all with the > extra directory/files? It will just pickup my driver directory and > link against the kernel automagically? Yes, It will if you add them to standard files list (see conf/files). (Otherwise if you want it as options directive in your kernel config than you should mark its module name in conf/files and also put an appropriate record into conf/options). - pluknet