From 8767de6e34779a7ebe1657074c4639664991a4c6 Mon Sep 17 00:00:00 2001 From: liangqi Date: Thu, 26 Sep 2024 16:33:30 +0800 Subject: [PATCH] add hello test --- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/hello/Kconfig | 4 ++++ drivers/hello/Makefile | 1 + drivers/hello/hello.c | 18 ++++++++++++++++++ 5 files changed, 26 insertions(+) create mode 100644 drivers/hello/Kconfig create mode 100644 drivers/hello/Makefile create mode 100644 drivers/hello/hello.c diff --git a/drivers/Kconfig b/drivers/Kconfig index 216c52363bd2..2fdedb7d0284 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -246,4 +246,6 @@ source "drivers/hck/Kconfig" source "drivers/auth_ctl/Kconfig" +source "drivers/hello/Kconfig" + endmenu diff --git a/drivers/Makefile b/drivers/Makefile index d0ff4fdb0dfb..1a1e29716e7a 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -196,3 +196,4 @@ obj-$(CONFIG_MOST) += most/ obj-$(CONFIG_ACCESS_TOKENID) += accesstokenid/ obj-$(CONFIG_VENDOR_HOOKS) += hooks/ obj-$(CONFIG_HCK_VENDOR_HOOKS) += hck/ +obj-y += hello/ diff --git a/drivers/hello/Kconfig b/drivers/hello/Kconfig new file mode 100644 index 000000000000..3107defd15a7 --- /dev/null +++ b/drivers/hello/Kconfig @@ -0,0 +1,4 @@ +config HELLO + tristate "Hello world for lqq" + help + Hello for lqq \ No newline at end of file diff --git a/drivers/hello/Makefile b/drivers/hello/Makefile new file mode 100644 index 000000000000..9ef0255f2159 --- /dev/null +++ b/drivers/hello/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_HELLO} += hello.o \ No newline at end of file diff --git a/drivers/hello/hello.c b/drivers/hello/hello.c new file mode 100644 index 000000000000..523de6b20ef9 --- /dev/null +++ b/drivers/hello/hello.c @@ -0,0 +1,18 @@ +#include +#include +#include + +static int first_drv_init(void) +{ + printk("-----------------hello world !-------------------"); + return 0; +} + +static void first_drv_exit(void) +{ + printk("---------------exit hello world !----------------"); +} + +module_init(first_drv_init); +module_exit(first_drv_exit); +MODULE_LICENSE("GPL"); \ No newline at end of file -- Gitee