Hi!
I'm looking for *nice* way to get address of loaded module in 2.6.
I'd like to know the address from driver.
In 2.4, I wrote something like this:
* * *
(in kernel src)
--- kernel/module.c
+++ kernel/module.c
struct module *module_list = &kernel_module;
+ struct module *get_module_queue(void)
+ {
+ return module_list;
+ }
+
+
... and in driver, I wrote:
mod = get_module_queue();
while (mod->next) {
if (strcmp(mod->name, name) == 0)
return (unsigned long)(mod + 1);
mod = mod->next;
}
return 0;
* * *
I am now using 2.6 kernel. The choice I can think of is
1) make linux-2.6/kernel/module.c:find_module(const char *name)
global func, not static, and use this func.
2) use linux-2.6/kernel/module.c:module_kallsyms_lookup_name(const char *name)
and somehow get return value from module_get_kallsym(...)
choice 1) doesn't sound nice since it changes static func -> global
func, but cost of getting module address is low. On the other hand,
choice 2) will not modify kernel src, which sounds nice, but costs more,
and I'm not sure this method works.
Any advice?!
HK.
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|