I am working on 2.4 , and I am able to load the module, I see the printk's in both init and cleanup functions , but the /proc entry doesn't seem to be created ... On 5/14/06, Thomas Petazzoni <thomas.petazzoni@xxxxxxxx> wrote:
Hi, Le Sun, 14 May 2006 18:14:46 +0530, "Shrikanth Ramanath" <shriek.007@xxxxxxxxx> a écrit : > I took this code snippet from LDD2 for pci devices, Have a look at LDD3, it's more uptodate, and explains how things work in the 2.6.x kernels. Are you working with 2.6 or 2.4 kernels ? > int init_module(void) > { > create_proc_read_entry("shripcidata", 0, NULL, pcidata_read_proc, > NULL); printk("<3>" "calling init on the pci_read_module\r\n"); > return 0; > } > > void cleanup_module(void) > { > remove_proc_entry("shripcidata", 0); > return; > } If you're working with 2.6, rename your init_module() and cleanup_module() to something else, and use the module_init() and module_exit() macros, for example: static int my_init_module(void) { ... } static void my_exit_module(void) { ... } module_init(my_init_module); module_exit(my_exit_module); See http://lwn.net/Articles/21817/ for more details. Sincerly, Thomas -- PETAZZONI Thomas - thomas.petazzoni@xxxxxxxx http://{thomas,sos,kos}.enix.org - Jabber: thomas.petazzoni@xxxxxxxxx http://{agenda,livret}dulibre.org - http://www.toulibre.org Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/