From: Sumya Hoque <sumyahoque2012@gmail.com>
To: skhan@linuxfoundation.org
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
Sumya Hoque <sumyahoque2012@gmail.com>
Subject: [PATCH] hello module is created
Date: Wed, 12 Feb 2025 02:45:13 +0000 [thread overview]
Message-ID: <20250212024513.7864-1-sumyahoque2012@gmail.com> (raw)
Signed-off-by: Sumya Hoque <sumyahoque2012@gmail.com>
---
linux_custom_modules/Makefile | 5 +++++
linux_custom_modules/hello.c | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 linux_custom_modules/Makefile
create mode 100644 linux_custom_modules/hello.c
diff --git a/linux_custom_modules/Makefile b/linux_custom_modules/Makefile
new file mode 100644
index 000000000000..adc226c210d6
--- /dev/null
+++ b/linux_custom_modules/Makefile
@@ -0,0 +1,5 @@
+obj-m += hello.o
+all:
+ make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+clean:
+ make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
diff --git a/linux_custom_modules/hello.c b/linux_custom_modules/hello.c
new file mode 100644
index 000000000000..a05727d605e3
--- /dev/null
+++ b/linux_custom_modules/hello.c
@@ -0,0 +1,20 @@
+#include <linux/module.h>
+#include <linux/printk.h>
+int hello(void)
+{
+ printk(KERN_INFO "Loading module... Hello World!\n");
+
+ return 0;
+}
+
+void goodbye(void)
+{
+ printk(KERN_INFO "Removing module... Goodbye World!\n");
+}
+
+module_init(hello);
+module_exit(goodbye);
+MODULE_DESCRIPTION("A basic Hello World module");
+MODULE_AUTHOR("sumya");
+MODULE_LICENSE("GPL");
+
--
2.34.1
next reply other threads:[~2025-02-12 2:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 2:45 Sumya Hoque [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-12 2:37 [PATCH] hello module is created Sumya Hoque
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250212024513.7864-1-sumyahoque2012@gmail.com \
--to=sumyahoque2012@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.