<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br>
<br>
The following program hangs the kernel, when the insmod on it, is run. Can any one provide ideas why :<br>
<br>
#include <linux/module.h> // for init_module()<br>
#include <linux/proc_fs.h> // for create_proc_info_entry()<br>
#include <asm/io.h> // for inb(), outb()<br>
<br>
int my_func( char *buf, char **start, off_t off, int count, int *eof, void *data )<br>
{<br>
return 0;<br>
}<br>
<br>
char modname[] = "cmos";<br>
static int __init my_init( void )<br>
{<br>
<br>
struct proc_dir_entry *pde, *tmp;<br>
tmp = kmalloc(sizeof(struct proc_dir_entry), GFP_KERNEL);<br>
pde= create_proc_entry(modname, S_IFDIR | S_IRUGO | S_IXUGO , tmp);<br>
<br>
pde->nlink = 1;<br>
pde->read_proc = my_func;<br>
if(pde)<br>
printk("proc_create sucessfull name = %s\n", pde->name);<br>
else<br>
printk("proc_create not so sucessfull. Exiting........... \n");<br>
return 0;<br>
}<br>
<br>
static void __exit my_exit(void )<br>
{<br>
remove_proc_entry( modname, NULL );<br>
printk("Exiting ................\n");<br>
}<br>
<br>
module_init( my_init );<br>
module_exit( my_exit );<br>
MODULE_LICENSE("GPL");<br>
<br>
Thanks,<br>
Giriprasad<br>
<br>
</td></tr></table><br>