From owner-freebsd-hackers Wed Nov 4 05:33:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA23295 for freebsd-hackers-outgoing; Wed, 4 Nov 1998 05:33:34 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA23286 for ; Wed, 4 Nov 1998 05:33:29 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id VAA00168; Wed, 4 Nov 1998 21:32:48 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199811041332.VAA00168@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Martti Kuparinen cc: hackers@FreeBSD.ORG Subject: Re: Pseudo-device as a LKM In-reply-to: Your message of "Mon, 02 Nov 1998 12:44:53 +0200." <3.0.6.32.19981102124453.02ce8b30@openmail.lmf.ericsson.se> Date: Wed, 04 Nov 1998 21:32:47 +0800 From: Peter Wemm Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Martti Kuparinen wrote: > I want to implement a pseudo-device as LKM. But the question is where > to find a working example? I've looked at e.g. the if_tun device, > but the unload is not successful: > > # modload /lkm/if_tun_mod.o > # modunload -n if_tun_mod > modunload: LMUNLOAD: Device busy > > So please give any pointers. I'm using 2.2.7-R but I could jump into 3.0 > if that's what needed. A couple of things.. There are several classes of LKMs.. With some, the glue is in macros, with others it is generated. The if_tun example you mention is a case of a 'PSEUDO_SET()' module. These do not allow unloading.. Not necessarily because it cannot be done, just because nobody has bothered. A more complete example would be to look at one that has got explicit LKM interface code, and compare that to what is in /usr/include/sys/*. However, if you are thinking longer term, look at 3.0's modules instead. The days of LKM's are numbered in 3.x (for many reasons, which I won't go into here). > Martti Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message