Subject: version of a kernel module? and modload man page
To: None <>
From: Jeremy C. Reed <>
List: tech-kern
Date: 03/21/2006 19:55:47
How can I find out the version that a kernel module was built for?

Installing it outputs generic "Program version wrong".

modload with -v also does not show.

In my case, I do know (but I still want to know how I can find out 

Maybe modstat can be extended to show information from a lkm file. (I am 
only beginning to learn the lkm code.)

I forced a module built on NetBSD 2.1 to load on a NetBSD 2.0_STABLE (from 
August 2005).

# modstat                   
Type    Id   Offset Loadaddr Size Info     Rev Module Name
DEV       0  -1/161 c442a000 00a8 c444f0e0   2 pf

Looks like modstat(8) man page needs to be updated also to explain the 
above (especially "Info"). Looking at source I see:

Type is type of module, such as "SYSCALL", "VFS", "DEV", "STRMOD", "EXEC", 
"COMPAT", "MISC" or "(UNKNOWN)". (Good to explain each of these too.)

Id is the module identification number.

Offset is the target table offset.

Loadaddr is the address the module loaded at.

Size is the size in kilobytes (in hex).

Info is the kernel address of private area.

And Rev is the LKM compile version. (Source says "always 1 for now" which 
doesn't match above.)

Can you quickly share some thoughts on above so I can add to the modload 
manual page? (Or if better I can improve the lkm(4) and point to it.)

 Jeremy C. Reed

ps. Please cc me.