public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] hello module is created
@ 2025-02-12  2:37 Sumya Hoque
  0 siblings, 0 replies; 2+ messages in thread
From: Sumya Hoque @ 2025-02-12  2:37 UTC (permalink / raw)
  To: skhan; +Cc: linux-kernel-mentees, Sumya Hoque

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] hello module is created
@ 2025-02-12  2:45 Sumya Hoque
  0 siblings, 0 replies; 2+ messages in thread
From: Sumya Hoque @ 2025-02-12  2:45 UTC (permalink / raw)
  To: skhan; +Cc: linux-kernel-mentees, Sumya Hoque

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-12  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12  2:37 [PATCH] hello module is created Sumya Hoque
  -- strict thread matches above, loose matches on Subject: below --
2025-02-12  2:45 Sumya Hoque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox