compile linux 2.6 module
compile linux 2.6 module
write a simple moudle: quark.c
write a Makefile:
make it:
write a simple moudle: quark.c
- #include <linux/version.h>
- #include <linux/module.h>
- #include <linux/types.h>
- #include <linux/sched.h>
- int __init quark_init(void)
- {
- return 0;
- }
- void __exit quark_exit(void)
- {
- }
- module_init(quark_init);
- module_exit(quark_exit);
write a Makefile:
- obj-m=quark.o
make it:
- make -C /lib/modules/$(uname -r)/build/ SUBDIRS=$(pwd) modules