Makefile for Linux kernel module?

前端 未结 3 2249
醉话见心
醉话见心 2021-02-20 09:32

I was just reading The Linux Kernel Module Programming Guide and and got stuck on character device drivers example.

Makefiles for previous examples were provided, but no

相关标签:
3条回答
  • 2021-02-20 09:35

    actually driver gets loaded by the macro MODULE_INIT(my_init); here "my_init" can be the user specified function and MUDULE_EXIT(my_cleanup); here my_exit can be the user specified function . those two macros are missing in the above code.

    Makefile: the obj-m += chardev.o is to be replaced with obj-m := chardev.o.

    I am also a beginner to LLD. If any mistake is there please let me know.

    0 讨论(0)
  • 2021-02-20 09:45
    obj-m += chardev.o
    
    0 讨论(0)
  • 2021-02-20 09:53

    Because the function unregister_chrdev() don't return value. This is a helpful link. http://forum.kernelnewbies.org/read.php?17,1114

    0 讨论(0)
提交回复
热议问题