RE: Simplified Steps for Building a Loadable module on -CURRENT

From: David Christensen <davidch_at_broadcom.com>
Date: Thu, 31 Aug 2006 11:37:06 -0700
 

> -----Original Message-----
> From: Stefan Bethke [mailto:stb_at_lassitu.de] 
> Sent: Thursday, August 31, 2006 12:20 AM
> To: David Christensen
> Cc: freebsd-current_at_freebsd.org
> Subject: Re: Simplified Steps for Building a Loadable module 
> on -CURRENT
> 
> Am 31.08.2006 um 01:36 schrieb David Christensen:
> 
> >> Then what's the panic message, and how exactly are you 
> building your
> >> module?
> >>
> >
> > The message wasn't readable on the serial console.  The text was  
> > jumbled
> > and I could only make out bits and pieces of it.
> 
> And the module that got installed in /boot/kernel/<module>.ko does  
> 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=MYCONFIG)
> 
> Which also builds and installs all modules into /boot/kernel 
> (see src/ 
> sys/modulesMakefile for the list of modules that are built).
> 
> > 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.
> 
> No, make that:
> 
> 6) Enable the kernel debugger, load the module, then show the list  
> the panic message, backtrace, etc. and tell us which driver you're  
> talking about and how you modified it.

1) The driver is /usr/src/sys/dev/bge.

2) My Makefile:
.PATH:  .
KMOD=   if_bge
SRCS=   bus_if.h device_if.h pci_if.h miibus_if.h miidevs.h
SRCS+=  if_bge.c if_bgereg.h 
DEBUG_FLAGS = -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  =f n3);  aafpuilca uildt  =t w0 7h
fiihnlsiter uicltni oen  ipkonienrtneer         l=  m0kxe8o:d0rxefnfef
 fcfpfufl8i0 6m2o1dbe3d6

fs=t accpku 1p;o iindt ear=       p 0 ;   i a p i=c c0 xi1 0d: 0=x
f0fif0fdf f
rf=a ci2n0s50btd10

 furcaimnet ipsotionrtuecrt     n   p o i i n t o=n e0rx        1=0 :
00xxfpfof88ifnf:f0ftaecr2 0=5 b0ex0x
lfi8m0dfef fsfefgfmfe8nxt0      f       4=2 0bfafsfe9 60fxf0f,f 
t    i0t6 20sx1fbf3ftfafc,6 
pyspket a0 xc1kb 
 p      o       i       o=i nDtPnLe r0  ,   p r e s  t1e,r  l   o n g
1 ,=  d0 xf 312  00:,  0gxrfafnf f1f
=: 0ixnftxe1sfs0ofra ce2f0lfabgds0
r        efrfrfufprta femneafbfl epdf,a oIciOnP2Lt 2=8 b0e
r3c0u   r
         e n tf rp r oac emses           ==  100x  (pi1dolien:t
0c:p0ue3r)
 [thread pid 10 tid 100003 ]
Stopped at      acpi_cpu_c1+0x6:        leave   
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 = 0, rsp = 0xffffffffac205d40, rbp = 0 ---
db> 
Received on Thu Aug 31 2006 - 16:37:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:59 UTC