阅读:902回复:1
请教高手
用insmod 加载一个linux的驱动模块,系统提示如下错误“out of memory, kill the process xxx",不知是内存不够的原因还是其他硬件问题,那位大哥遇到过?我那个驱动原先很复杂,后来我把init_module()简化了,只作些打印操作,还是同样问题
还包括很多函数,这些函数我都没有在init_module中调用,不知是这些没有调用的函数用了什么非法指针什么的引起这个错误,想想没有调用这些函数难道运行时也会出错吗? #include<asm/io.h> #include<linux/module.h> #include<linux/kernel.h> #include<linux/sched.h> #include<asm/current.h> #include<linux/time.h> #include "../include/allh.h" #include "../include/adsl_if.h" #include "../../root/include/zx_alarm.h" #include "v2k.h" #define GS_INCLUDE_WHIP_TCP #ifdef GS_INCLUDE_WHIP_TCP //#include "tcpwhip.h" #include "../../gdmt_63340/include/tcpwhip.h" #else #include "../../gdmt_63340/include/siowhip.h" #endif #define GS_TOTAL_BINS 256 #define MAX_NUM_CHIPS_PER_LBUS 2 #ifdef GS_INCLUDE_PARAMETRIC_TEST GS_DMT_HYBRID_LOSS sHybridLoss; #endif /* GS_INCLUDE_PARAMETRIC_TEST */ char g_firmwareVersion[17] = "read error"; char BinTemp[512]; int RPTFLAG[MAX_NUM_XCVRS]; zxAdslConfTrap_T AdslConftrapinfo[MAX_NUM_XCVRS]; GS_SYST_INFO sSystInfo; GS_OCTANE_LBUS_INFO aLbusInfo[MAX_NUM_LBUSES]; GS_OCTANE_CHIP_INFO aChipInfo[MAX_NUM_CHIPS]; GS_XCVR_INFO aXcvrInfo[MAX_NUM_XCVRS]; GS_CHAN_INFO aIntChanInfo[MAX_NUM_XCVRS]; GS_CHAN_INFO aFastChanInfo[MAX_NUM_XCVRS]; GS_WORD aOpState[MAX_NUM_XCVRS]; GS_WORD aLastOpState[MAX_NUM_XCVRS]; int aXcvrId[MAX_NUM_XCVRS]; int imajor =0; MODULE_PARM (imajor, "i"); void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); } int init_module(void) { int i; int ret; struct file_operations l9800_fops; printk("before init_module...\n"); return 1; } int g8TaskInit(void) { .... } [编辑 - 2/4/05 by cthsh] |
|
沙发#
发布于:2005-02-04 07:51
请帖程序........ :P
|
|
|