From dbabd18a46e04bd81c073d0ea7981ea370acfb25 Mon Sep 17 00:00:00 2001 From: gatieme Date: Thu, 23 Mar 2017 20:53:28 +0800 Subject: [PATCH] =?UTF-8?q?hello=20world=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E4=BD=9C=E8=80=85=E4=BF=A1=E6=81=AF,=20makefile?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=AF=91=E5=8F=82=E6=95=B0?= =?UTF-8?q?...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- study/driver/hello/Makefile | 3 +++ study/driver/hello/hello.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/study/driver/hello/Makefile b/study/driver/hello/Makefile index 807729b..3b708b4 100644 --- a/study/driver/hello/Makefile +++ b/study/driver/hello/Makefile @@ -25,6 +25,9 @@ DRIVER_LICENSE := "Dual BSD/GPL" MODULE_NAME := hello +MODCFLAGS:=-O6 -Wall -DMODULE -D__KERNEL__ -DLINUX -std=c99 + + ifneq ($(KERNELRELEASE),) diff --git a/study/driver/hello/hello.c b/study/driver/hello/hello.c index 2dcb60c..c456dfb 100644 --- a/study/driver/hello/hello.c +++ b/study/driver/hello/hello.c @@ -1,7 +1,15 @@ #include +#include #include +#include +//#include +//#include +//#include + MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Gatieme"); +MODULE_DESCRIPTION("hello world"); /* * print the module information @@ -36,6 +44,7 @@ static int hello_init(void) static void hello_exit(void) { + printk(KERN_ERR"exit"); }