Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Sep 2007 01:56:55 +0200
From:      "Michael Iedema" <michael@askozia.com>
To:        "John Baldwin" <jhb@freebsd.org>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: first time module dev question: undefined reference to 'memset'
Message-ID:  <d3dd0e360709231656l4558911dk47402ee4bdc77e7b@mail.gmail.com>
In-Reply-To: <200709211537.21584.jhb@freebsd.org>
References:  <d3dd0e360709210627o78db23e4o8255478e96a7d1e9@mail.gmail.com> <200709211537.21584.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John,

> > 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.

> 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.

First, thanks for the response. I now have a patch for 6.2's libkern.h
and am defining memset in my module. Everything is building cleanly
now.

Now I have a basic kernel module Makefile question. I want to automate
the libkern.h patching / unpatching project process. What I have so
far is included below and is probably a very basic Makefile question.

Can anyone see where I've gone wrong here?

Regards,
-Michael I.



###########

SRCS=oslec_wrap.c echo.c
KMOD=oslec
CFLAGS+=-I$(PWD)/../spandsp-0.0.3/src/spandsp
WERROR=	-Wall
SRCS+=oslec.h

# XXX this doesn't work, what's the proper module build target
# so I can automate patching/building/unpatching ?
#all: patchmemset oslec unpatchmemset

patchmemset:
	patch -d /sys/sys < $(PWD)/libkern_memset.patch

unpatchmemset:
	patch -R -d /sys/sys < $(PWD)/libkern_memset.patch

echo.c: $(PWD)/../spandsp-0.0.3/src/echo.c
	$(CC) -c $(PWD)/../spandsp-0.0.3/src/echo.c

load: oslec.ko
	kldload ./oslec.ko

unload:
	kldunload oslec

reload: unload load

.include <bsd.kmod.mk>



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