When you start writing device driver you will definitely look into this book. I will share some of Kernel functions, Macros, Variables and /proc files needed for Kernel Module building and running.
User space utility that, inserts module into active Kernel.
User space utility same as insmod but it extends its support by insmoding the dependent modules too, by referring at /lib/modules/…. directories.
User space utility, to remove module from active Kernel without need of reboot.
Macros for initialisation and cleanup functions along with respective header file.
__init / __exit
Markers for functions only used at module initialisation / cleanup time.
__initdata / __exitdata
Markers for datas
Items marked are only considered while initialisation / cleanup time, and discarded afterwards respectively. These may work due to placing relevant objects at special ELF section in the executable files.
Header file, contains most important kernel API, functions and variables.
struct task_struct *current;
Denotes current process.
The process ID and command name of the current process.
Makefile symbol, used by kernel build system to determine which module to be built inside the current directory.
i) sysfs hierarchy which contains informations about currently loaded modules, contains module name, amount of memory occupied, and usage count. Extra strings appended at end of each line denotes flags currently available for the module.
ii) Older single file version of that, (my laptop doesn’t contain this file)
It is an object file lies inside kernel source directory, describe the environment a module built for.
Necessary for all kernel module source code.
Holds information of kernel version being built.
Exports symbol to kernel, first uses with licensing issues, second, restrict itself for only GPL licensed modules.
MODULE_AUTHOR(“S MOHAMMED AUDHIL”);
Description to reader + place documentation on module in object file.
Macro for module parameter, along with respective header file. It can be modified by user during insmoding. Type can be bool, charp, int, invbool, long, short, ushort, uint, ulong, or intarray.
int printk(const char * fmt, …);
Same as normal printf.