Linux Kernel Architecture
Chapter7:Modules I have selected a number of modules from the Netfilter package for this example. The dependency file modules.de ...
Chapter7:Modules { struct module_use *use; list_for_each_entry(use, &b->modules_which_use_me, list) { if (use->module_ ...
Chapter7:Modules return 0; return try_module_get(mod); } It is not complicated to establish the relation. A new instance ofmodul ...
Chapter7:Modules Some of the above sections cannot be generated untilthe module itself and possibly all other kernel modules hav ...
Chapter7:Modules #ifdef MODULE static int __init xyz_init(void) { /* Initialization code */ } static void __exit xyz_cleanup (vo ...
Chapter7:Modules At first glance, the definition is anything but clear. Its effect is therefore illustrated by reference to the ...
Chapter7:Modules __attribute_used__ \ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info In addition to thi ...
Chapter7:Modules various kernel configurations that have a drastic impact on the entire code and therefore need a sepa- rate set ...
Chapter7:Modules sys_init_module Insert module into kernel list load_module mod->init Free initialization area Figure 7-4: Co ...
Chapter7:Modules { Elf_Ehdr *hdr; Elf_Shdr *sechdrs; char *secstrings, *args, *modmagic, *strtab = NULL; unsigned int i; unsigne ...
Chapter7:Modules temporary image. */ sechdrs[i].sh_addr = (size_t)hdr + sechdrs[i].sh_offset; /* Internal symbols and strings. * ...
Chapter7:Modules Module sections are not transferred to their final memory position unless theSHF_ALLOCflag is set in their head ...
Chapter7:Modules kernel/module.c set_license(mod, get_modinfo(sechdrs, infoindex, "license")); set_licensechecks whether the lic ...
Chapter7:Modules unsigned int pcpuindex, struct module *mod) { Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; unsigned long s ...
Chapter7:Modules break; } } return ret; } The next step in module loading is to place the table of (GPL-) exported symbols in th ...
Chapter7:Modules resolve_symbol _ _find_symbol check_version use_module Figure 7-5: Code flow diagram forresolve_symbol. Actual ...
Chapter7:Modules *owner = mod; ks = lookup_symbol(name, mod->syms, mod->syms + mod->num_syms); if (ks) { *crc = symvers ...
Chapter7:Modules Ensure module is not used sys_delete_module find_module mod->exit free_module Figure 7-6: Code flow diagram ...
Chapter7:Modules The implementation of this feature is interesting because, in both cases, the kernel relies on utilities in use ...
Chapter7:Modules request_module Prepare environment for modprobe Too many simultaneous calls of request_module? return call_user ...
«
22
23
24
25
26
27
28
29
30
31
»
Free download pdf