http://dsas.blog.klab.org/archives/50576043.html
とLinuxカーネル徹底理解
ISBN:9784822234140モジュールを作成
# rpm -qa kernel-devel kernel-devel〜
cat stall.c #include <linux/module.h> #include <linux/kernel.h> #define THISMOD "stallmod" static int __init stall_init(void) { printk("loaded %s\n",THISMOD); local_irq_disable(); while(1); return 0; } module_init(stall_init); void cleanup_module(void) { printk("unloaded %s\n",THISMOD); }
Makefile obj-m := stall.o all: make -C /lib/modules/`uname -r`/build M=`pwd` modules clean: make -C /lib/modules/`uname -r`/build M=`pwd` clean
# make # insmod stall.ko Read from remote host 〜: Connection reset by peer
OK