From owner-freebsd-drivers@FreeBSD.ORG Fri Sep 21 21:40:27 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 6D04C16A41A for ; Fri, 21 Sep 2007 21:40:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 0BE6113C4C5 for ; Fri, 21 Sep 2007 21:40:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8p) with ESMTP id 210673075-1834499 for multiple; Fri, 21 Sep 2007 17:22:42 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l8LLOATf064127; Fri, 21 Sep 2007 17:24:10 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Fri, 21 Sep 2007 15:37:21 -0400 User-Agent: KMail/1.9.6 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709211537.21584.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 21 Sep 2007 17:24:10 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/4357/Fri Sep 21 05:55:46 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: 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: Fri, 21 Sep 2007 21:40:27 -0000 On Friday 21 September 2007 09:27:03 am Michael Iedema wrote: > Greetings everyone, > > I'm undertaking the seemingly simple task of porting a Linux kernel > module to FreeBSD. I say simple because it is merely a wrapper used to > expose some functions to another module. > > The code I'm porting is OSLEC[1] a line echo canceller module that is > used by Zaptel and Asterisk. My current problem is an undefined > reference to 'memset' when I attempt to load the cleanly compiled > module. > > There is a lengthy discussion about this error here[2] but I could > find no conclusive remedy. My wrapper module links with code from > another library and it is causing the problems in kernel land. > > Here is my module so far: http://pastebin.ca/705865 > ...and my broken Makefile: http://pastebin.ca/705871 > > If anyone could point me in the right direction it would be very > appreciated. I realize that I am out of my league dealing with kernel > modules but the porting process looked easy enough. As with most new > adventures, this has proved untrue. I think you need to add a memset() function in your module. The kernel doesn't include memset() in 6.x. You can backport the one in 7.x (look in sys/libkern) if you want. -- John Baldwin