#define _NO_VERSION_ //不考虑模块版本问题#define _KERNEL_#define MODULE#include <linux/kernel.h> //核心态编程#include <linux/module.h> //模块编程//初始化模块int init_module()...{ printk("Open CapsLock, NumLock, ScrollLock! "); __asm__(" movb $0xed, %al out %al, $0x60 movb $7, %al out %al, $0x60 ") return 0;}//释放模块占用的空间void cleanup_module()...{ printk("end of module existence! ");} 测试模块命令: 编译模块:gcc -c -I /usr/src/linux/include -Wall cns.c 加载模块:insmod cns.o 查看内核系统日志:dmesg 列出系统所有加载模块:lsmod 卸载模块:rmmod cns