Steps to load a .ko module into kernel memory
Can someone kindly clarify if my understanding of the module loading
process is reasonably/mildly correct.
1. The .ko module is basically an ELF file
2. insmod results in a temporary staging area carved out of kernel
heap to copy the .ko from the user space file system.
3. The loader/sys_init_module/?? parses the section headers, audits
them for correctness such as architecture, compatible kernel etc,
identifies section types (data/bss/text/ro/init/exit etc)and their
4. The loader then moves the text area from ELF text section to the
kernel text area and repeats this for all section types (ELF:data to
kernel:data, ELF:bss to kernel:bss etc)
5. Symbols are next resolved and the ksymtab is updated.
6. The module_init functionality is then invoked.