Difference between Linux Loadable and built-in modules -


what's difference between loadable modules , built-in (statically linked) modules?

i got question while finding out answer difference between system calls subsys_initcall() , module_init()

linux kernel supports inserting of modules (aka device drivers) in 2 ways:

  1. built-in kernel modules - when kernel booted up, kernel automatically inserts driver in kernel (it's more part of kernel code).
  2. loadable kernel module (lkm) - driver not automatically loaded kernel, user can insert module @ run-time insmod driver.ko or modprobe driver.ko

the advantage loadable modules have on built-in modules can load unload them on run-time. if working on module , need test it. every time test , need make changes it, can unload (rmmod driver.ko or modprobe -r driver.ko) , after making changes, can insert back. built-in modules if need make changes in module need compile whole kernel , reboot system new image of kernel.

configuration:
can configure module either of 2 editing .config file in root folder of kernel source:

driver_1=y // y indicate builtin module driver_1=m //m inicates loadable module 

note: lsmod displays dynamically loaded modules not built-in ones.

read on: http://www.tldp.org/howto/module-howto/x73.html


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -