Linux kernel module does not autoload
I am learning linux kernel and starting with hello world module at this point everything is fine, but after compilation
$ make
and install
$ insmod akmod.ko
a module that does not show the "hello world" message on KERN_DEBUG
$ dmesg nothing here $
just show on rmmod
$ rmmod akmod
[4543.3423432] hello world
[5462.5323452] goodbye
The code is the same as here: http://www.makelinux.net/ldd3/chp-2-sect-2
I just changed KERN_ALERT for KERN_DEBUG
I am using Debian 8.
I think this is because the module is not auto-loaded on insmod
When I ran
$ make menuconfig
I cannot find the parameter Loading the kernel kernel module
Loadable module support --->
[*] Enable loadable module support
[*] Module unloading
[ ] Module versioning support (EXPERIMENTAL)
[*] Automatic kernel module loading **(My menu config donΒ΄t show this option)**
Any advice would be appreciated
source to share
Sometimes there is some delay between issuing printk
and displaying a message in dmesg. You can see that from the output of dmesg: the timestamp for "hello world" is 80 seconds less than one for "goodbye".
Not sure why, but the higher the level of the message, the lower the latency. You can try KERN_INFO or even KERN_ALERT.
source to share