Subject: Handling multiple lkm's
To: None <tech-kern@NetBSD.ORG>
From: Darren Reed <darrenr@cyber.com.au>
List: tech-kern
Date: 09/12/1997 11:31:34
The issue of not allowing xxxinit() to be used multiple times in one LKM
has again been brought to my attention and I believe that NetBSD needs
to deal with it better than the current situation.

What is current ?  Currently, if you plan to use more than 1 LKM, each
must have a different entry point - that is xxxinit (the default) can
only be used once.  The upshot of this is that for others, you need to
manually specify the entry point to modload.

To me, the need to manually specify the entry point is excessive.

Suggestions for handling the current situation (that come to mind) are:

* make xxxinit() work only as a static function with modload, which should
  prevent namespace collision between muiltiple modules(?).  (FWIW, Solaris2
  uses a method like this).

* when loading the LKM, change the name of xxxinit in the symbol table to
  be <lkmname>_xxxinit once loaded.

* when loading the LKM, if it can't find xxxinit, have modload look for
  some other symbol name that is logically named (i.e. <lkmname>_entry
  or <lkmname>_init, etc).

* someone build LKM's in a way that modload can determine where the entry
  point is if it can't find xxxinit.

Cheers,
Darren