debugging kernel module __init function?
Aruna Hewapathirane
aruna.hewapathirane at gmail.com
Tue Aug 4 22:58:56 EDT 2015
>> In this case, no. But I’m curious if there’s a way to pull this off, or if it’s fundamentally impossible?
What happens 'after' __init gets called ?
After boot, the kernel frees up a special section. All functions
marked with __init and data structures marked with __initdata are
dropped after boot is complete.
Similarly 'modules' DISCARD this memory after initialization.
So what is the workaround ? Write the module_init function without
the __init attribute.
( They never read the documentation :
/Documentation/DocBook/kernel-hacking.tmpl , I never used to read the
documentation either :)
More information about the Kernelnewbies
mailing list