实验十 linux驱动编写.docxVIP

  • 5
  • 0
  • 约3.8千字
  • 约 6页
  • 2019-06-08 发布于山东
  • 举报
实验十 linux驱动编写 实验内容 模块的编写与加载 虚拟字符设备的编写与加载使用 实验指导: 模块的编写与加载 1)hello.c: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include linux/init.h #include linux/sched.h #include linux/module.h ?? MODULE_LICENSE(GPL); MODULE_AUTHOR(feixiaoxing); MODULE_DESCRIPTION(This is just a hello module!\n); ?? static int __init hello_init(void) { ????printk(KERN_EMERG hello, init\n); ????return 0; } ?? static void __exit hello_exit(void) { ????printk(KERN_EMERG hello, exit\n); } ?? module_init(hello_init); module_exit(hello_exit); 2)Makefile内容: ? 1 2 3 4 5 6 7 8 9 10 11 12 ifneq ($(KER

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档