Operating System - HP-UX
1827810 Members
1903 Online
109969 Solutions
New Discussion

Re: Problems with STATICALLY configured loadable kernel modules (DLKM) on 11.11

 
Misha Rekhson
Occasional Contributor

Problems with STATICALLY configured loadable kernel modules (DLKM) on 11.11

Hello,

we are having problems with what one would expect to be the easier part of dealing with DLKM moduels in 11.11 (PA) - having them included statically in the kernel. Everything works great when we configure and use the modules as a dynamically loaded modules or link them into the kernel in the pre-DLKM way - via a library

Summary: when the module is statically linked (either via SAM or explicit commands), it's included in the kernel (according to nm), however, its _install() doean't get called at boot (or ever). It appears that config doesn't generate a correct /stand/build/conf.c for the _install() function to be called, when it configured as a statically linked module. The problem occurs with all modules that we've tried: our internally developed ones and HP supplied (in ddk) modules.

If we don't package the driver as a module, but use a library instead (as was done in pre-DLKM days), it works as expected (it's included in the kernel, and at boot _install() gets called)


If one looks in the generated /stand/build/conf.c they differ for library drivers and static modules:

If we do it as a library, in the generated conf.c there are following entries
for the driver:

...
extern ourdriver_install();
...

and then it's included in the table of install functions:

int (*driver_install[])() =
{
...
ourdriver_install,
fddi4_install,
.....

However, when it's a statically included module, the above entrires for the driver are missing in any genned C file.

The only portion of conf.c the module appears in is:

char *static_modules[] = {
"ourmodule",
"ufs",
"cdfs",
....


It's hard to belive that, if this is a bug, it hasn't been fixed yet....
However, all we have tried has not helped. Searching HP site didn't turn anything either.


Any ideas?

Thanks,
Misha



-------
For completeness, when we do this outside of SAM, the following commands
are used:

kminstall -a module
kmconfig -c Y -l N

config /stand/system
kmupdate /stand/build/vmunix_test

shutdown -r 0


-------

master file:

$VERSION
1
$$$

$DRIVER_INSTALL
*
* Driver Block major Char major Required for
* minimal system
ourmodule -1 -1 0
$$$

$LOADABLE
$$$

$INTERFACE
* Describe all interface name and version that the module is using.
*
* Alternately,
* if the module uses undefined symbols and wish tight coupling with
* kernel, uncomment below line and do not describe any other interface
* name and version. In this case, compatibility is not maintained by HP.
* base
base
$$$

* below section should carry same info. as legacy era
* dependency to legacy can be described here.

$DRIVER_DEPENDENCY
* modname ...
ourmodule wsio
$$$

$TYPE
* modulename modtype classname flags -1 -1
ourmodule wsio_intfc acq csi -1 -1
$$$

$TUNABLE
*tunablename definition defaultvalue minumumvalue
ourmodule_debug OURMODULE_DEBUG 1 0
$$$
2 REPLIES 2
Mike Stroyan
Honored Contributor

Re: Problems with STATICALLY configured loadable kernel modules (DLKM) on 11.11

Do you have patches PHKL_29818 and PHKL_29890 ?
Misha Rekhson
Occasional Contributor

Re: Problems with STATICALLY configured loadable kernel modules (DLKM) on 11.11

Yes, I already had PHKL_29818; installing PHKL_29890 didn't change things.