Collect the tips of linux kernel development
The simplest kernel module demo
Enhance Example0, append module infomation, parameter
Parameter Passing: insmod example.ko debug_enable=1 dispstr="World"
Dyanamicly change the parameter via sysfs
List Module Info: modinfo brook.ko
DebugFS Example
Dynamicly change the variable via debugfs
Need to mount debugfs
Sysctl Example Register sysctl_table and it becomes a subdir of /proc/sys
Can read/write value via /proc/sys
After kernel 2.6.33, sysctl is only the wrapper of procfs.
It cannot viist from syscall anymore.
Syscall Example
Register a misc device, communicate between user space and kernel space.
Implement file_operation, mmap, ioctl
ProcFS Example(Without seq_file)
ProcFS Example(With seq_file example)
Netlink Example (Communicate between user space and kernel space)