From owner-freebsd-drivers@FreeBSD.ORG Tue Sep 25 11:10:31 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E97316A417 for ; Tue, 25 Sep 2007 11:10:31 +0000 (UTC) (envelope-from michael@askozia.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id 8DAFB13C43E for ; Tue, 25 Sep 2007 11:10:30 +0000 (UTC) (envelope-from michael@askozia.com) Received: by nf-out-0910.google.com with SMTP id b2so1410157nfb for ; Tue, 25 Sep 2007 04:10:29 -0700 (PDT) Received: by 10.78.204.7 with SMTP id b7mr4190676hug.1190718628847; Tue, 25 Sep 2007 04:10:28 -0700 (PDT) Received: by 10.78.40.2 with HTTP; Tue, 25 Sep 2007 04:10:28 -0700 (PDT) Message-ID: Date: Tue, 25 Sep 2007 13:10:28 +0200 From: "Michael Iedema" To: freebsd-drivers@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200709211537.21584.jhb@freebsd.org> <46F75CF2.10003@demig.de> Subject: Re: first time module dev question: undefined reference to 'memset' X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 11:10:31 -0000 Hello again, > > what about s/patchmenset/.BEGIN/ and s/unpatchememset/.END/ ? > > Thanks! Everything's building nicely and it's now cleaning up after itself. It's clear to me now that building cleanly is still not the end of the road here. My module "OSLEC" is loading and being recognized by a module depending on it "Zaptel." This dependent module is also being recognized and correctly utilized by the Asterisk process in my project. However, as soon as the echo canceller (OSLEC) is activated by Asterisk it page faults. I'm thinking that the symbols that zaptel needs from oslec are not being recognized, or additional libkern functions need to be patched in. I've provided below as much information as I can. Can anyone help me take the next step in debugging this? Thanks for your patience on this. I'm trying. Regards, -Michael I. -------------------------------------------------- The page fault message: Fatal trap 12: page fault while in kernel mode fault virtual address = 0x0 fault code = supervisor read, page not present instruction pointer = 0x20:0xc04f3867 stack pointer = 0x28:0xcd4f19d8 frame pointer = 0x28:0xcd4f19e8 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = interrupt enabled, resume, IPOL = 0 current process = 198 (asterisk) trap number = 12 panic: page fault Following this page[1] I see that the IP is closest to: c04f3808 T __mac_set_file c04f3814 T __mac_set_link c04f3820 T mac_syscall c04f382c T malloc_last_fail c04f383c t malloc_type_zone_allocated c04f38a8 T malloc_type_allocated c04f38c8 T malloc_type_freed -------------------------------------------------- Symbols missing from my oslec and zaptel kernel modules are as follows: oslec U M_DEVBUF U free U malloc U malloc_init U malloc_uninit U memcpy U module_register_init U printf zaptel U _mtx_lock_flags U _mtx_lock_spin_flags U _mtx_unlock_flags U _mtx_unlock_spin_flags U bcmp U bcopy U bzero U copyin U destroy_dev U dev_ref U devclass_find U eventhandler_deregister U eventhandler_find_list U eventhandler_register U free U kthread_create U kthread_exit U make_dev U malloc U malloc_init U malloc_uninit U memcpy U module_register_init U msleep U mtx_destroy U mtx_init U oslec_echo_can_create U oslec_echo_can_free U oslec_echo_can_traintap U oslec_echo_can_update U printf U selrecord U selwakeup U snprintf U strcmp U strlen U strncpy U sysctl__children U sysctl_add_oid U sysctl_ctx_free U sysctl_ctx_init U sysctl_handle_int U uiomove U unit2minor U wakeup [1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/advanced.html#KERNEL-PANIC-TROUBLESHOOTING