From owner-freebsd-hackers Thu Feb 15 5:20:51 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from samar.sasi.com (samar.sasken.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id 82D7637B4EC; Thu, 15 Feb 2001 05:20:36 -0800 (PST) Received: from samar (samar.sasi.com [164.164.56.2]) by samar.sasi.com (8.9.3/8.9.3) with SMTP id SAA17767; Thu, 15 Feb 2001 18:50:30 +0530 (IST) Received: from suns3.sasi.com ([10.0.36.3]) by samar.sasi.com; Thu, 15 Feb 2001 18:50:30 +0000 (IST) Received: from localhost (sseth@localhost) by suns3.sasi.com (8.9.3/8.9.3) with ESMTP id SAA04947; Thu, 15 Feb 2001 18:50:27 +0530 (IST) Date: Thu, 15 Feb 2001 18:50:27 +0530 (IST) From: Satyajeet Seth To: Mike Smith Cc: , Subject: Re: KLD'fying PCI device driver! In-Reply-To: <200102151014.f1FAEbV09259@mass.dis.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi Please see my comments below: On Thu, 15 Feb 2001, Mike Smith wrote: > > 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: (kgdb) where #0 0xc018cf3c in boot () #1 0xc018d2d9 in panic () #2 0xc0137c39 in db_panic () #3 0xc0137bd9 in db_command () #4 0xc0137c9e in db_command_loop () #5 0xc0139daf in db_trap () #6 0xc02c229d in kdb_trap () #7 0xc02d14b4 in trap_fatal () #8 0xc02d118d in trap_pfault () #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 ?? () > - 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. Thanks Satya To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message