diff --git a/process_chp3/task_driver/.clangd b/process_chp3/task_driver/.clangd new file mode 100644 index 0000000..0f895be --- /dev/null +++ b/process_chp3/task_driver/.clangd @@ -0,0 +1,10 @@ +CompileFlags: + Compiler: make + Add: [-Wall, -I/lib/modules/6.10.7-200.fc40.x86_64/build/include] +InlayHints: + BlockEnd: false + Designators: true + Enabled: true + ParameterNames: true + DeducedTypes: true + TypeNameLimit: 24 diff --git a/process_chp3/task_driver/Makefile b/process_chp3/task_driver/Makefile new file mode 100644 index 0000000..c6a2cab --- /dev/null +++ b/process_chp3/task_driver/Makefile @@ -0,0 +1,11 @@ +obj-m += task-driver.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 + +sign: + /usr/src/kernels/$(shell uname -r)/scripts/sign-file sha256 kernel-sign/private_key.priv kernel-sign/public_key.der task-driver.ko + diff --git a/process_chp3/task_driver/kernel-sign b/process_chp3/task_driver/kernel-sign new file mode 120000 index 0000000..e2c06da --- /dev/null +++ b/process_chp3/task_driver/kernel-sign @@ -0,0 +1 @@ +/run/media/fscotto/Work/Configurations/kernel-sign \ No newline at end of file diff --git a/process_chp3/task_driver/task-driver.c b/process_chp3/task_driver/task-driver.c new file mode 100644 index 0000000..aef8c43 --- /dev/null +++ b/process_chp3/task_driver/task-driver.c @@ -0,0 +1,21 @@ +#include +#include +#include +#include // Module metadata +#include + +MODULE_AUTHOR("Fabio Scotto di Santolo"); +MODULE_DESCRIPTION("List all tasks on the Linux system"); +MODULE_LICENSE("GPL"); // Custom init and exit methods + +static int __init custom_init(void) { + printk(KERN_INFO "Hello world driver loaded."); + kmal return 0; +} + +static void __exit custom_exit(void) { + printk(KERN_INFO "Goodbye my friend, I shall miss you dearly..."); +} + +module_init(custom_init); +module_exit(custom_exit);