From owner-freebsd-current@FreeBSD.ORG Thu Aug 31 18:37:27 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4611116A4E5 for ; Thu, 31 Aug 2006 18:37:27 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CA3D43D4C for ; Thu, 31 Aug 2006 18:37:26 +0000 (GMT) (envelope-from davidch@broadcom.com) Received: from 10.10.64.154 by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.2.0)); Thu, 31 Aug 2006 11:37:15 -0700 X-Server-Uuid: F962EFE0-448C-40EE-8100-87DF498ED0EA Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id 9ECEA2AE; Thu, 31 Aug 2006 11:37:15 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id 5BA7F2AF; Thu, 31 Aug 2006 11:37:15 -0700 (PDT) Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.10.64.146]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id EEC80035; Thu, 31 Aug 2006 11:37:07 -0700 (PDT) Received: from NT-IRVA-0750.brcm.ad.broadcom.com (nt-irva-0750 [10.8.194.64]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id 5675B69CA3; Thu, 31 Aug 2006 11:37:07 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 31 Aug 2006 11:37:06 -0700 Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD90301E2F47E@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <1F8279E4-7F1C-4597-8BCC-B5E2A055E6F2@lassitu.de> Thread-Topic: Simplified Steps for Building a Loadable module on -CURRENT Thread-Index: AcbMzfVrX8+8awWoQp+PKpB6rICWXwAXZhuA From: "David Christensen" To: "Stefan Bethke" X-TMWD-Spam-Summary: SEV=1.1; DFV=A2006083107; IFV=2.0.6,4.0-7; RPD=4.00.0004; RPDID=303030312E30413031303230342E34344637324230432E303032342D412D; ENG=IBF; TS=20060831183719; CAT=NONE; CON=NONE; X-MMS-Spam-Filter-ID: A2006083107_4.00.0004_2.0.6,4.0-7 X-WSS-ID: 68E9F3D13CC3547469-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: RE: Simplified Steps for Building a Loadable module on -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2006 18:37:27 -0000 =20 > -----Original Message----- > From: Stefan Bethke [mailto:stb@lassitu.de]=20 > Sent: Thursday, August 31, 2006 12:20 AM > To: David Christensen > Cc: freebsd-current@freebsd.org > Subject: Re: Simplified Steps for Building a Loadable module=20 > on -CURRENT >=20 > Am 31.08.2006 um 01:36 schrieb David Christensen: >=20 > >> Then what's the panic message, and how exactly are you=20 > building your > >> module? > >> > > > > The message wasn't readable on the serial console. The text was =20 > > jumbled > > and I could only make out bits and pieces of it. >=20 > And the module that got installed in /boot/kernel/.ko does =20 > exhibit the same problem, or not? > > So I should do the following: > > > > 1) Comment out the driver I want to test in the kernel configuration > > file. > > For example, modify /usr/src/sys/amd64/conf/MYCONFIG. > > 2) Rebuild and install the kernel (cd /usr/src; make kernel > > KERNCONF=3DMYCONFIG) >=20 > Which also builds and installs all modules into /boot/kernel=20 > (see src/=20 > sys/modulesMakefile for the list of modules that are built). >=20 > > 3) Reboot the system to start using the new kernel > > 4) Edit the driver in /usr/src/sys/dev/XXX as necessary > > 5) Build the kernel module (cd /usr/src/sys/modules/XXX; make) > > 6) Load the kernel module (kldload ./if_XXX) and cross my fingers. >=20 > No, make that: >=20 > 6) Enable the kernel debugger, load the module, then show the list =20 > the panic message, backtrace, etc. and tell us which driver you're =20 > talking about and how you modified it. 1) The driver is /usr/src/sys/dev/bge. 2) My Makefile: .PATH: . KMOD=3D if_bge SRCS=3D bus_if.h device_if.h pci_if.h miibus_if.h miidevs.h SRCS+=3D if_bge.c if_bgereg.h=20 DEBUG_FLAGS =3D -g .include 3) The source is unmodified from -CURRENT 4) Here's the panic (though it's a little hard to read): Loading if_bge.ko bge0: mem 0xdd100000-0xdd10ffff irq 16 at device 0.0 on pci1 F aaFt lF attraaapt l3a0 :l rtersaeprtv e3d0 r(au:n kpnroewsne) rfva3u0l:t rwehdielwes ei(nu rknevrknneelo dm o(duen wkcnpnu)iodw =3Df n3); aafpuilca uildt =3Dt w0 7h fiihnlsiter uicltni oen ipkonienrtneer l=3D m0kxe8o:d0rxefnfef fcfpfufl8i0 6m2o1dbe3d6 fs=3Dt accpku 1p;o iindt ear=3D p 0 ; i a p i=3Dc c0 xi1 0d: = 0=3Dx f0fif0fdf f rf=3Da ci2n0s50btd10 furcaimnet ipsotionrtuecrt n p o i i n t o=3Dn e0rx 1=3D0 = : 00xxfpfof88ifnf:f0ftaecr2 0=3D5 b0ex0x lfi8m0dfef fsfefgfmfe8nxt0 f 4=3D2 0bfafsfe9 60fxf0f,f=20 t i0t6 20sx1fbf3ftfafc,6=20 pyspket a0 xc1kb=20 p o i o=3Di nDtPnLe r0 , p r e s t1e,r l o n g 1 ,=3D d0 xf 312 00:, 0gxrfafnf f1f =3D: 0ixnftxe1sfs0ofra ce2f0lfabgds0 r efrfrfufprta femneafbfl epdf,a oIciOnP2Lt 2=3D8 b0e r3c0u r e n tf rp r oac emses =3D=3D 100x (pi1dolien:t 0c:p0ue3r) [thread pid 10 tid 100003 ] Stopped at acpi_cpu_c1+0x6: leave =20 db> bt Tracing pid 10 tid 100003 td 0xffffff017f61f560 acpi_cpu_c1() at acpi_cpu_c1+0x6 acpi_cpu_idle() at acpi_cpu_idle+0x180 cpu_idle() at cpu_idle+0x29 idle_proc() at idle_proc+0x85 fork_exit() at fork_exit+0xcf fork_trampoline() at fork_trampoline+0xe --- trap 0, rip =3D 0, rsp =3D 0xffffffffac205d40, rbp =3D 0 --- db>=20