随笔分类 -  linux driver

摘要:Driver for linux-2.6.38 1. my_led_cmd.h 2. led_misc_drv.c 3. test.c 4. Makefile 阅读全文
posted @ 2016-09-04 10:24 Kozmers 阅读(186) 评论(0) 推荐(0)
摘要:#include #include #include #include /////////////////////////////////////////////////MODULE_LICENSE("Dual BSD/GPL");int open_state = 0;///////////////... 阅读全文
posted @ 2015-05-26 12:02 Kozmers 阅读(184) 评论(0) 推荐(0)
摘要:/* test.c * use "insmod test.ko" * can see "/dev/test" * and "test" in "/proc/devices" */#include #include #include #include /* dev_t */#include ... 阅读全文
posted @ 2015-04-29 11:21 Kozmers 阅读(144) 评论(0) 推荐(0)
摘要:#Makefileifneq ($(KERNELRELEASE),) obj-m := module.o module-objs := file1.o file2.o#obj-m:=hello.oelse KERNELDIR := /lib/modules/... 阅读全文
posted @ 2015-04-22 13:10 Kozmers 阅读(168) 评论(0) 推荐(0)
摘要:/* hello.c */#include #include static int hello_init(void){ printk(KERN_ALERT "hello init"\n); return 0;}static void hello_exit(void){ printk... 阅读全文
posted @ 2015-01-02 10:30 Kozmers 阅读(230) 评论(0) 推荐(0)