From owner-freebsd-drivers@FreeBSD.ORG Tue Mar 25 23:07:47 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 9B72C106566B; Tue, 25 Mar 2008 23:07:47 +0000 (UTC) (envelope-from lev@nupfel.de) Received: from schatten.darksystem.net (schatten.darksystem.net [88.198.51.7]) by mx1.freebsd.org (Postfix) with ESMTP id 086168FC20; Tue, 25 Mar 2008 23:07:46 +0000 (UTC) (envelope-from lev@nupfel.de) Received: from schatten.darksystem.net (localhost [127.0.0.1]) by schatten.darksystem.net (Postfix) with ESMTP id 59620F5C3C0; Tue, 25 Mar 2008 23:42:47 +0100 (CET) X-Spam-Status: No, hits=1.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DSBL, RCVD_IN_PBL, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC X-Spam-Check-By: schatten.darksystem.net Received: from port-212-202-192-115.dynamic.qsc.de (HELO mail.nupfel.de) (212.202.192.115) (smtp-auth username lev, mechanism plain) by schatten.darksystem.net (qpsmtpd/0.32) with ESMTP; Tue, 25 Mar 2008 23:35:47 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.nupfel.de (Postfix) with ESMTP id DA4C01A214CF; Tue, 25 Mar 2008 23:35:40 +0100 (CET) X-Virus-Scanned: amavisd-new at nupfel.de Received: from mail.nupfel.de ([127.0.0.1]) by localhost (mail.nupfel.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E2M5h2OxuWKm; Tue, 25 Mar 2008 23:35:39 +0100 (CET) Received: by mail.nupfel.de (Postfix, from userid 1000) id 542F31A214CC; Tue, 25 Mar 2008 23:35:39 +0100 (CET) Date: Tue, 25 Mar 2008 23:35:39 +0100 From: Tobias Kirschstein To: freebsd-drivers@freebsd.org Message-ID: <20080325223539.GH4783@nupfel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FUaywKC54iCcLzqT" Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@freebsd.org, freebsd-questions@freebsd.org Subject: hdaps (accelerator) driver for thinkpads 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, 25 Mar 2008 23:07:47 -0000 --FUaywKC54iCcLzqT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi there, i have an ibm x60t thinkpad and want to have this nice feature of (mostly all) thinkpads: the hdaps acceleration support. i found only an old implementaton of 2005 and decided to update the driver. as this is the first time i put my fingers on kernel drivers please be kind :) here is what i got at the moment: http://www.nupfel.de/data/accel-0.6.tar.gz i took the original driver from the old linux hdaps project: http://hdaps.sourceforge.net/index.php?page=3D3 added support for my x60t and fixed some kthread -> kproc renaming issues since 8-CURRENT. the driver compiles and loads fine on my system (8-CURRENT, also tested on 7-RELEASE), but if i try to get some values through the sysctl "hw.accel" or one of the /dev/accel* device nodes my machine (amd64) completely freezes and rebootes after some seconds. bulding and loading the module with DEBUG defined it dumps the raw values of the io ports correctly to the kernel message buffer. --------------------------------------------- accel0: Found Accelerometer, type 0x5, starting init.. (max. 10 seconds) accel0: Init finished successful accel0: Time needed: 2 s 25142 ns accel0: at port 0x1600-0x162f on isa0 accel0: calibration: xzero: 508 yzero: 510 accel0: initstate: 0x5 ppc0: cannot reserve I/O port range --------------------------------------------- --------------------------------------------- -> entering _accel_getdata -> entering _accel_request_refresh io port dump: 0x1600: 14 ff ff ff 00 ff ff ff ff ff ff ff ff ff ff ff ................ 0x1610: 11 02 9c 01 03 02 3d 9b 01 03 02 3d 02 80 00 00 ......=3D....=3D..= =2E. 0x1620: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ <- exiting _accel_request_refresh value 0x1 (refresh success) wait: 0x1 io port dump: 0x1600: 14 ff ff ff 50 ff ff ff ff ff ff ff ff ff ff ff ....P........... 0x1610: 11 02 9b 01 04 02 3d 9b 01 04 02 3d 04 a0 00 00 ......=3D....=3D..= =2E. 0x1620: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ <- exiting _accel_getdata value 0x1 io port dump: 0x1600: 14 ff ff ff 00 ff ff ff ff ff ff ff ff ff ff ff ................ 0x1610: 11 02 9b 01 04 02 3d 9b 01 04 02 3d 04 a0 00 00 ......=3D....=3D..= =2E. 0x1620: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ -> entering _accel_request_refresh io port dump: 0x1600: 14 ff ff ff 00 ff ff ff ff ff ff ff ff ff ff ff ................ 0x1610: 11 02 9b 01 04 02 3d 9b 01 04 02 3d 04 a0 00 00 ......=3D....=3D..= =2E. 0x1620: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ <- exiting _accel_request_refresh value 0x1 (refresh success) wait: 0x0 --------------------------------------------- unloading the module also works find and frees all ressources unless you don't try to use the devices... --------------------------------------------- accel0: waiting for kthread to teminate.. accel0: Done. sysctlfree retval: 0 accel0: detached --------------------------------------------- the full dmesg: http://www.nupfel.de/data/dmesg.txt it would be great if some thinkpad users could try the code and help me debugging the problem :) --=20 ciao, lev --FUaywKC54iCcLzqT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iGwEARECACwFAkfpfjslGmh0dHA6Ly93d3cubnVwZmVsLmRlL3BncC9wb2xpY3ku aHRtbAAKCRCkm1fv1t7QABvGAJwKtREA9goLO8NKau+iZIlLxR2ZRwCfbNR7wHJd iLNwsgojAiFpJkPuE9g= =PSdC -----END PGP SIGNATURE----- --FUaywKC54iCcLzqT-- From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 27 16:19:52 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 DB1231065671 for ; Thu, 27 Mar 2008 16:19:52 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.184]) by mx1.freebsd.org (Postfix) with ESMTP id 736158FC28 for ; Thu, 27 Mar 2008 16:19:52 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by gv-out-0910.google.com with SMTP id n40so1005774gve.39 for ; Thu, 27 Mar 2008 09:19:51 -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:mime-version:content-type:content-transfer-encoding:content-disposition; bh=NZ84DYFA+TzW19phcJ5dQkgfqKqwyvLYjfmUAg77SuQ=; b=us8lChY4cfKcc2zuOYPf6+UB+kcS/iMB/TpQm/ICRvWnmz9MfHdhtIu+tUsd54J8ZKZ9z6/zCzB7TvTZCiJttTgY4k/cklOLQ9ZZTRDdJkvijLEzmUwVRgQkrz9vLEYdMoEKvOQKmLKoTMgxE8RxSGWj9bg1F/+aH9I1oO3ebHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=XvHes/q1oTdOIZJInb7gtrUAaPjH+Ahn7vy61ERzdcwGRPyrpDNI3bs1Exejnrudo3siDE+IOUoX8LenW2GHsJHqB5/hBPgWz4PInbZ9GQW2CMZ09sJs4KLutHZAyxuJzV23ZPszERuM2BVXcsJh9ghK7blslhyYoms1UEQ6IqQ= Received: by 10.150.201.13 with SMTP id y13mr881740ybf.100.1206633072120; Thu, 27 Mar 2008 08:51:12 -0700 (PDT) Received: by 10.150.230.16 with HTTP; Thu, 27 Mar 2008 08:51:12 -0700 (PDT) Message-ID: <3c0b01820803270851x24bfe739pea0bd4fb0ebecfb0@mail.gmail.com> Date: Thu, 27 Mar 2008 11:51:12 -0400 From: "Alexander Sack" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: freebsd-drivers@freebsd.org Subject: 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 16:19:53 -0000 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). Thanks! -aps -- "What lies behind us and what lies in front of us is of little concern to what lies within us." -Ralph Waldo Emerson From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 27 19:37:27 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 976421065675 for ; Thu, 27 Mar 2008 19:37:27 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outZ.internet-mail-service.net (outz.internet-mail-service.net [216.240.47.249]) by mx1.freebsd.org (Postfix) with ESMTP id 5291B8FC1F for ; Thu, 27 Mar 2008 19:37:27 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Thu, 27 Mar 2008 17:47:27 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 241992D6004; Thu, 27 Mar 2008 12:25:12 -0700 (PDT) Message-ID: <47EBF498.9090409@elischer.org> Date: Thu, 27 Mar 2008 12:25:12 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Alexander Sack References: <3c0b01820803270851x24bfe739pea0bd4fb0ebecfb0@mail.gmail.com> In-Reply-To: <3c0b01820803270851x24bfe739pea0bd4fb0ebecfb0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, 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 19:37:27 -0000 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! > > -aps > From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 27 19:52:39 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 9C5A01065677 for ; Thu, 27 Mar 2008 19:52:39 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.238]) by mx1.freebsd.org (Postfix) with ESMTP id 28D198FC25 for ; Thu, 27 Mar 2008 19:52:38 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by qb-out-0506.google.com with SMTP id a10so7949537qbd.7 for ; Thu, 27 Mar 2008 12:52:38 -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=v3fLq7AcFlwF1CfhZs5TIQX/3aS1ipFqOlYKh1b94z8=; b=KVrKl+ktO03zeyJ++KHA0cBDXTjAV891RTWQHFLuVaBHdMB9nN7qUoXvWzzvktQcztdtWwNj1eDhbu9ESAmeeaZ18VcDmGsKdvgDprHUAaGNkJQhS2FONR4fzmB5ncc3PEV+QdpK0px/D0U0OggFQx+8Y9LgvtOsp5K+YPis1Ss= 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=tZRD/IjlO+7bifnQjjV/oZBbFHhH8aEH4N9IAFUpm5Jql2uDwRZtN8Wbi+MulRxDPQuulWVbvMFCghHxKYXyR5eUHz4cn1+q0yOLb34pD60bAeHpEnLTV/KBIztyNZD+y5hudPpOZ9JRi9e9HkdPr86hWCjopfQ5kgPRx001r6g= Received: by 10.142.172.12 with SMTP id u12mr1739497wfe.16.1206647557589; Thu, 27 Mar 2008 12:52:37 -0700 (PDT) Received: by 10.142.147.6 with HTTP; Thu, 27 Mar 2008 12:52:37 -0700 (PDT) Message-ID: <3c0b01820803271252m488159ebi2af2255461f10358@mail.gmail.com> Date: Thu, 27 Mar 2008 15:52:37 -0400 From: "Alexander Sack" To: "Julian Elischer" In-Reply-To: <47EBF498.9090409@elischer.org> 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> Cc: freebsd-hackers@freebsd.org, 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 19:52:39 -0000 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? -aps -- "What lies behind us and what lies in front of us is of little concern to what lies within us." -Ralph Waldo Emerson 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 From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 27 21:05:25 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 30BCE106566C for ; Thu, 27 Mar 2008 21:05:25 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by mx1.freebsd.org (Postfix) with ESMTP id 04A8F8FC1B for ; Thu, 27 Mar 2008 21:05:24 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by wf-out-1314.google.com with SMTP id 25so4031810wfa.7 for ; Thu, 27 Mar 2008 14:05:24 -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=hEJiW4kRPyNTGzHFYFkojk4UZOp9Wc3JtQGZ5dDmPLQ=; b=fAJS2JCJqcrmfbddTZ1oKoJzpn4gExn7EPiZf3NUbV0wv5FI80+zIAD6uM+/8LKf6bP/lgRZaNNJr8Cw/ol5WLEeY7Q50qPEq7EBu+EShTt4p97s/Se60qDrCtBZNrKGXwhmpoIrBN7lqlKDuL8qG3pL9QQ5DBBIJQQvWNccwp4= 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=aUOZYWTL1TREI6izI9/WnOurmfQ8yj7w09Q4xZaiubY/kQ6G0WbW4qrnWD99Lui1kjEcrr8HF4X14OQ57QjIC1hU7zNhyRR2oKBmM9fJlUU582Sy8kEkdK8q6fQDDVjlPiov8q43jPSyOJSO4D26HuYZlys9bMqiVzC1+3/5kHo= Received: by 10.142.43.7 with SMTP id q7mr1816811wfq.67.1206651924605; Thu, 27 Mar 2008 14:05:24 -0700 (PDT) Received: by 10.142.147.6 with HTTP; Thu, 27 Mar 2008 14:05:24 -0700 (PDT) Message-ID: <3c0b01820803271405r2351cbbwb20b8b35c5621dcb@mail.gmail.com> Date: Thu, 27 Mar 2008 17:05:24 -0400 From: "Alexander Sack" To: pluknet In-Reply-To: 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:05:25 -0000 On Thu, Mar 27, 2008 at 4:39 PM, pluknet wrote: > > 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). Thank you very much, that is what I thought regarding it as an options directive instead of a driver - I just wanted some validation before going down that path. Again, thanks guys, -aps -- "What lies behind us and what lies in front of us is of little concern to what lies within us." -Ralph Waldo Emerson