I am working on a driver for NetFPGA-1G card. I found this Linux Kernel Programming Guide
is a good place for whom wants to write a kernel module or hardware driver to start with
Install/remove a kernel module
Commands must be executed under root privilege
To install insmod <path_to_module/module_name.ko>
To remove modprobe -r module_name
or rmmod -f module_name
-f: force removal
If it fails to remove, there could be the module is in use by a process or it has dependencies
Run lsmod to display all loaded module, its use and dependencies
Ex. lsmod | grep module_name
Output:
Module Size Used by
Used by is a number and may be followed by a list of dependencies
If the number > 0, modprode will fail.
Sometimes, a positive number means the kernel module has bugs. It crashes during installation can lead to the case. Then, the only solution is to reboot the computer and check the code.
A look at /var/log/syslog can provide some infos.