From 2a7e332dbe578010bbf2268597543607ba3c29c9 Mon Sep 17 00:00:00 2001 From: laentropia Date: Thu, 3 Sep 2026 10:54:10 -0600 Subject: [PATCH] Initial commit --- .clangd | 4 ++++ copy.c | 35 +++++++++++++++++++++++++++++++++++ simple.c | 18 ++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 .clangd create mode 100644 copy.c create mode 100644 simple.c diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..358e907 --- /dev/null +++ b/.clangd @@ -0,0 +1,4 @@ +CompileFlags: + Add: + - -I/usr/src/kernel-headers-6.18.48_1/include + - -I/usr/src/kernel-headers-6.18.48_1/arch/x86/include diff --git a/copy.c b/copy.c new file mode 100644 index 0000000..91999d4 --- /dev/null +++ b/copy.c @@ -0,0 +1,35 @@ +#include +#include + +int main(int argc, char *argv[]) { + if (argc <= 1) { + printf("Usage: copy \n"); + return EXIT_SUCCESS; + } else if (argc > 3) { + fprintf(stderr, "Too many arguments\n"); + return EXIT_FAILURE; + } + + FILE *src = fopen(argv[1], "rb"); + FILE *dst = fopen(argv[2], "wb"); + + if (src == NULL) { + fprintf(stderr, "Unable to open source file\n"); + return EXIT_FAILURE; + } + + if (dst == NULL) { + fprintf(stderr, "Unable to open destination file\n"); + return EXIT_FAILURE; + } + + char c; + while ((c = fgetc(src)) != EOF) { + fputc(c, dst); + } + + fclose(src); + fclose(dst); + + return EXIT_SUCCESS; +} diff --git a/simple.c b/simple.c new file mode 100644 index 0000000..61b8763 --- /dev/null +++ b/simple.c @@ -0,0 +1,18 @@ +#include +#include +#include + +static int simple_init(void) { + printk(KERN_INFO "Loading Kernel Module\n"); + + return 0; +} + +static void simple_exit(void) { printk(KERN_INFO "Removing Kernel Module\n"); } + +module_init(simple_init); +module_exit(simple_exit); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Simple Module"); +MODULE_AUTHOR("LaEntropia");