Back to our kernel module: so far, we have built it, loaded it into the kernel, and verified that its entry point, the helloworld_lkm_init() function, got invoked, thus executing the printk API. So now, what does it do? Well, nothing really; the kernel module merely (happily?) sits in kernel memory doing absolutely nothing. We can in fact easily look it up with the lsmod(8) utility:
$ lsmod | head
Module Size Used by
helloworld_lkm 16384 0
isofs 32768 0
fuse 139264 3
tun 57344 0
[...]
e1000 155648 0
dm_mirror 28672 0
dm_region_hash 20480 1 dm_mirror
dm_log 20480 2 dm_region_hash,dm_mirror
dm_mod 151552 11 dm_log,dm_mirror
$
lsmod shows all kernel modules currently residing (or live) in kernel memory, sorted in reverse chronological order. Its output is column formatted, with three...