*BSD News Article 72616


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.mel.connect.com.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!gatech!news.mathworks.com!uunet!inXS.uu.net!news.artisoft.com!usenet
From: Terry Lambert <terry@lambert.org>
Newsgroups: comp.unix.bsd.bsdi.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,comp.unix.bsd.netbsd.misc
Subject: Re: Help: Loadable module in bsd?
Date: Tue, 02 Jul 1996 16:05:40 -0700
Organization: Me
Lines: 40
Message-ID: <31D9AB44.B695103@lambert.org>
References: <Pine.OSF.3.91.960702124121.10093B-100000@leonis.nus.sg>
NNTP-Posting-Host: hecate.artisoft.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.1.76 i486)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:4202 comp.unix.bsd.freebsd.misc:22649 comp.unix.bsd.misc:1193 comp.unix.bsd.netbsd.misc:3907

Peter wrote:
] 
] Does freebsd / netbsd have support for loadable modules, as in
] Linux?

Yes, using LKM's (Loadable Kernel Modules).  I wrote them and
first released beta code in May 1994, prior to the purchase of
USL by Novell, my employer at the time.

So they significantly predate the technology in Linux (in point
of fact, Jeffrey Hsu made the GCC/GLD PIC patches necessary to
allow LKM's and shared libraries to work on Intel systems, and
released them as an enabling technology for my LKM release.  The
USL purchase locked down my shared library and other code, even
though *we* bought *them*).

] If I will to write a module (i.e.something likes protocol
] converter) between the IP and the network card driver, how
] can I do it in freebsd / netbsd?

Use a function pointer for the interface layer, and export it
into the symbol space.

Use the initialization function to hook the pointer; reset the
pointer on deinit.  You will be able to insert a module into
any dispatch table, function pointer table, or boot time
initialization.

] Using stream????

No.  Streams is not supported.  I doubt that my implementation
(for 386BSD 0.1+patchkit) would run, even if USL didn't claim
they owned it, post-facto.


                                        Terry Lambert
                                        terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.