Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2006 11:37:06 -0700
From:      "David Christensen" <davidch@broadcom.com>
To:        "Stefan Bethke" <stb@lassitu.de>
Cc:        freebsd-current@freebsd.org
Subject:   RE: Simplified Steps for Building a Loadable module on -CURRENT
Message-ID:  <09BFF2FA5EAB4A45B6655E151BBDD90301E2F47E@NT-IRVA-0750.brcm.ad.broadcom.com>
In-Reply-To: <1F8279E4-7F1C-4597-8BCC-B5E2A055E6F2@lassitu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
=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/<module>.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 <bsd.kmod.mk>

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: <Broadcom BCM5752 A1, ASIC rev. 0x6001> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09BFF2FA5EAB4A45B6655E151BBDD90301E2F47E>