Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Feb 2001 15:09:07 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        Satyajeet Seth <sseth@sasken.com>
Cc:        freebsd-net@freebsd.org, hackers@freebsd.org
Subject:   Re: KLD'fying PCI device driver! 
Message-ID:  <200102152309.f1FN97w00534@mass.dis.org>
In-Reply-To: Your message of "Thu, 15 Feb 2001 18:50:27 %2B0530." <Pine.GSO.4.30.0102151550130.632-100000@suns3.sasi.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > I am trying to convert my PCI device driver into a KLD.
> > >
> > > So far I have done the following:
> > > 1. Built the kernel without the static linked device driver.
> > > 2. Added entries to Makefiles in /sys/modules and /sys/modules/xxx.
> > > 3. Did "make all install" in /sys/modules directory.
> > > 4. Tried loading the KLD. I got the following error:
> > >    "Fatal trap 12: page fault while in kernel mode"
> > >
> > > Any ideas as to what could be going wrong?
> >
> > Too many.  You haven't really given anything like enough detail here.
> >
> >  - What FreeBSD version?
> 
> Satya-> 4.0
> 
> >  - Build the kernel with DDB and symbols, and show us the backtrace.
> Satya-> The trace is given below:
> 
> #9  0xc02d0cd3 in trap ()
> #10 0xc01909a4 in sysctl_register_oid ()
> #11 0xc0190a51 in sysctl_register_set ()
> #12 0xc017f5d3 in linker_file_register_sysctls ()
> #13 0xc017f670 in linker_load_file ()
> #14 0xc017feae in kldload ()
> #15 0xc02d1712 in syscall ()
> #16 0xc02c2ba6 in Xint0x80_syscall ()
> #17 0x80480f9 in ?? ()

Ok.  It looks like you have some sysctls in your driver.  Comment them 
all out, then un-comment them one at a time, rebuilding and reloading 
until you find the one that causes the trap.  Then we can have a look at 
it and see if we can work out what's wrong with it.

> >  - Your hardware init function may not work properly in the case where
> >    the system is already up and running (eg. you may be generating
> >    interrupts before you are ready to handle them).
> >  - You may be building against sources that don't match your running
> >    kernel.
> Satya-> The driver works properly when statically linked.

Yes, I was assuming this.  At the moment, you're not even getting your 
module fully loaded; it's dying during the load phase.



-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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