|
发表于 2003-5-26 00:45:07
|
显示全部楼层
0) in fact, i believe that module-info is only an info file for human read, not for kernel module load/unload/managemnet purpose. i never change it under redhat and i even do not have it under my gentoo. i am really busy now. so if i have time, i will install slackware, mdk, debian, bsd and see the difference.
a) for rh, u need modify the /etc/rc.sysinit, grep the modprobe in it to see how write a small piece of shell script in it to autoload what u need. for gentoo, u only need add u module name in /etc/modules.autoload; and need config under /etc/module.d
b) it is the key file for loading module. for example, my module.conf has such a line: alias sound-slot-0 es1371. u may have alias sound-slot-0 xxx as well. so for kernel, if someone requires a sound service, and kernel finds its operation pointers are null. then kernel will try to load it. the first problem need to be solve is to load which module, what kernel do is to load sound-slot-x, but whether sound-slot-x is es1371 or xxx is decided by reading this file. and some contents under /etc/module.d if u have. then the second problem is how to decide which es1371 u need load from /lib/modules/2.4.18-14 or 2.4.18-10... this is also u problem c
c) this is decided by modprobe code, i forget the detail, but basically it is decided by current loaded kernel version. there are some doc on it.
d) that is the module size and reference count, it is maintained in a kernel data structure, and this /proc read is served by
269 static int modules_read_proc(char *page, char **start, off_t off,
270 int count, int *eof, void *data)
271 {
272 int len = get_module_list(page);
273 return proc_calc_metrics(page, start, off, count, eof, len);
274 }
in fs/proc/proc_misc.c. and actual work is finished in get_module_list in kernel/module.c |
|