On 6/3/08, Wenhua Zhao <whzhao@xxxxxxxxx> wrote: > > Hi, > > > > > i was trying this with the "hello world" module > > > > -----8<--------------- > > /* > > * hello-1.c - The simplest kernel module. > > */ > > #include <linux/module.h> /* Needed by all modules */ > > #include <linux/kernel.h> /* Needed for KERN_INFO */ > > int init_module(void) > > { > > printk(KERN_INFO "Hello world 1.\n"); > > /* > > * A non 0 return means init_module failed; module can't be loaded. > > */ > > return 1; > > } > > void cleanup_module(void) > > { > > printk(KERN_INFO "Goodbye world 1.\n"); > > } > > ---8<---------------------- > > > > But when i try to get modinfo, its fail to find the module:- > > > > localhost:/home/adil/module/sample # insmod hello-1.ko > > localhost:/home/adil/module/sample # modinfo hello-1 > > modinfo: could not find module hello-1 > > localhost:/home/adil/module/sample # lsmod | grep hello > > hello_1 1280 0 > > localhost:/home/adil/module/sample # rmmod hello_1 > > localhost:/home/adil/module/sample # lsmod | grep hello > > localhost:/home/adil/module/sample # > > > > Am i missing anything? > > > Can you load the module with modprobe? If modprobe cannot find > the module, neither can modinfo. > > The module should be put into system module directory and do > depmod -a Oops, my mistake. Now its giving the desired result. Thanks for your help. > > Regards, > Wenhua > -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ