summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2025-11-17 19:40:14 -0600
committerAaditya Dhruv <[email protected]>2025-11-17 19:40:22 -0600
commit0c24c3ad8a748c785d795449e043eb6d60fcd1db (patch)
tree5c3315794aeb136af1018e4a639bd0446692f8eb
init
-rw-r--r--.gitignore9
-rw-r--r--Makefile13
-rw-r--r--starbit.c36
3 files changed, 58 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..df9c5e9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.ko
+*.o
+*.cmd
+*.symvers
+*.order
+*.mod*
+compile_commands.json
+.cache/
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..46cb124
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,13 @@
+# If KERNELRELEASE is defined, we've been invoked from the
+# kernel build system and can use its language.
+ifneq ($(KERNELRELEASE),)
+ obj-m := starbit.o
+# Otherwise we were called directly from the command
+# line; invoke the kernel build system.
+else
+ KERNELDIR ?= /usr/src/kernels/$(shell uname -r)
+ PWD := $(shell pwd)
+default:
+ make -C $(KERNELDIR) M=$(PWD) modules
+
+endif
diff --git a/starbit.c b/starbit.c
new file mode 100644
index 0000000..91052de
--- /dev/null
+++ b/starbit.c
@@ -0,0 +1,36 @@
+#include "linux/printk.h"
+#include <linux/usb.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/hid.h>
+
+struct wiimote_dev {
+};
+
+
+static const struct hid_device_id wiimote_ids[] = {
+ {HID_BLUETOOTH_DEVICE(0x057e, 0x0306)},
+ {}
+};
+
+MODULE_DEVICE_TABLE(hid, wiimote_ids);
+static int wiimote_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+ printk(KERN_DEBUG "Hello I'm a wiimote mouse!");
+
+ return 0;
+}
+
+static struct hid_driver wiimote_driver = {
+ .name = "wiimote-mouse",
+ .id_table = wiimote_ids,
+ .probe = wiimote_probe,
+};
+
+module_hid_driver(wiimote_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Aaditya Dhruv");
+MODULE_DESCRIPTION("Test");