模块调试的入门问题
#define   MODULE 
 #include    <linux/module.h>  
 #include    <linux/init.h>  
 #include    <asm/current.h>  
 #include    <linux/sched.h>    
 MODULE_LICENSE( "GPL "); 
 int   my_init(void) 
 { 
 printk( "current   process   is   %s   (pid   %i)\n ",current-> comm,current-> pid); 
 } 
 void   my_cleanup(void) 
 { 
 printk( "bye "); 
 } 
 module_init(my_init); 
 module_exit(my_cleanup);   
 gcc   -c   hello.c 
 的时候出现了一堆错误 
 主要是找不到current.h文件什么的 
 而我找了一下,只在/usr/src/include/下有   
 请问,如果要读取current的内容,程序该怎么改? 
 我的内核版本是2.4.20-8 
 已经和gcc一致了   
 初学者,虚心向大家请教 
 先谢谢大家了! 
------解决方案--------------------module_init, module_exit??   
 2.4内核好象用的是init_module和cleanup_module吧?? 
------解决方案--------------------你要用模块化编译,不能用gcc直接编译 
 推荐一个gcc -c -D__KERNEL__ -DMODULE -O2 -c *.c ...