Skip to content

Instantly share code, notes, and snippets.

@zmallen
Created December 10, 2017 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmallen/9d1c4959882a64820c3a703c3fb65408 to your computer and use it in GitHub Desktop.
Save zmallen/9d1c4959882a64820c3a703c3fb65408 to your computer and use it in GitHub Desktop.
obj-m += hello-1.o
hello-1.objs := hello-1.o
all:
make -C /usr/src/kernels/3.10.0-693.11.1.el7.x86_64.debug M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r).debug/build M=$(PWD) clean
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");
int tkt_init(void);
void tkt_exit(void);
module_init(tkt_init);
module_exit(tkt_exit);
int tkt_init(void) {
printk("tkt: module loaded\n");
return 0;
}
void tkt_exit(void) {
printk("tkt: module removed\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment