Friday, June 22, 2007

Add/Remove modules - drivers

(Link to webpage)

=> At boot time, only a minimal resident kernel is loaded into memory.

=> If you add new hardware you need to add driver aka modules

=> modprobe intelligently adds or removes a module from the Linux kernel

=> Usually modules stored in the module directory /lib/modules/$(uname -r)
$ ls /lib/modules/$(uname -r)

Task: Add a module called foo

Type the command as root user: # modprobe foo

Task: List all loaded modules

Use lsmod command to show the status of modules in the Linux Kernel:
# lsmod

Task: Remove a module called foo

Pass -r option to modprobe command to remove a module
# modprobe -r foo
You can also use rmmod command, which is simple program to remove a module from the Linux Kernel
# rmmod foo