X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fkernel.git;a=blobdiff_plain;f=hello%2Fhello-1.c;fp=hello%2Fhello-1.c;h=0000000000000000000000000000000000000000;hp=a0d241d51cf8f45bb78cea498bc4aadf7d516503;hb=8a336451c7768f15c42feaf03c4d82acd88bc6cc;hpb=5ef1719c674e2eeedbfaef7dacb982b3b7c3c74c diff --git a/hello/hello-1.c b/hello/hello-1.c deleted file mode 100644 index a0d241d..0000000 --- a/hello/hello-1.c +++ /dev/null @@ -1,58 +0,0 @@ -/* hello world */ - -#include -#include -#include -#include "../general.h" - -#if CONFIG_MODVERSIONS==1 - #define MODVERSIONS -#endif - -#include - -#ifndef CONFIG_DEVFS_FS - #error no devfs -#endif - -#include -#include - -extern void *sys_call_table[]; - -static devfs_handle_t devfs_handle; - -static struct file_operations fops = -{ - .read=device_read, - .write=device_write, - .open=device_open, - .release=device_release, - .ioctl=device_ioctl -} - -int my_uid=0; -char *parm_string="blah"; - -MODULE_PARM(my_uid,"i"); -MODULE_PARM(parm_string,"s"); - -int my_init(void) -{ - devfs_handle=devfs_register(NULL,"hackbard/1",DEVFS_FL_DEFAULT,0,0, - printk(KERN_ALERT "module loaded with uid %d, string %s\n",my_uid,parm_string); - return 0; -} - -void my_cleanup(void) -{ - printk(KERN_ALERT "module unloaded\n"); -} - -module_init(my_init); -module_exit(my_cleanup); - -MODULE_AUTHOR(ME_THE_AUTHOR); -MODULE_DESCRIPTION("bullshit ;)"); -MODULE_LICENSE("GPL"); -