随笔 - 60, 文章 - 0, 评论 - 197, 引用 - 0
数据加载中……

insmod module 失败(skyeye + armlinux)

  前些日子在 skyeye 上 porting 了 arm-linux,于是迫不及待的写了一个 module 试试,可很不幸,没有成功。小弟最近才搞 linux 的 module 技术,很多地方不是很懂,现将问题贴出,希望大家不吝赐教。

skyeye(version 1.2.4) 的配置文件 skyeye.conf:
===============================================
cpu: arm920t
mach: s3c2410x

# physical memory
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000
mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000, file=initrd.img
mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000

# all peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000

mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
#net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1

#lcd: type=s3c2410x, mod=gtk
#dbct:state=on



Module 源代码:
=========================================
/*hello.c*/
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");

int __init my_init_module(void)
{
  printk (KERN_INFO "Hello world\n");
  return 0;
}

void __exit my_cleanup_module(void)
{
  printk (KERN_INFO "Goodbye world\n");
}

module_init(my_init_module);
module_exit(my_cleanup_module);


Makefile
=========================================
#Makefile
ifeq ($(KERNELRELEASE),)

KERNELDIR ?= /root/kernel/2.6/linux-2.6.14
PWD := $(shell pwd)

modules:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions

.PHONY: modules modules_install clean

else
    obj-m := hello.o
endif


insmod 出错:
=========================================
# insmod hello.ko
Unable to handle kernel paging request at virtual address bf000000
pgd = c02a8000
[bf000000] *pgd=00000000
Internal error: Oops: 807 [#1]
Modules linked in:
CPU: 0
PC is at __memzero+0x24/0x80
LR is at __init_begin+0x3fff8000/0x2c
pc : [<c00cfc84>]    lr : [<00000000>]    Not tainted
sp : c0279e68  ip : 00000000  fp : c0279fa4
r10: 00000280  r9 : c0185604  r8 : c29012c8
r7 : 00000004  r6 : c29010e0  r5 : c2901520  r4 : 00000010
r3 : 00000000  r2 : 00000000  r1 : 000003e0  r0 : bf000000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: 317F  Table: C02A8000  DAC: 00000015
Process insmod (pid: 33, stack limit = 0xc0278194)
Stack: (0xc0279e68 to 0xc027a000)
9e60:                   c004818c c0279ebc c0279e7c c002651c 00000000 00000000
9e80: 00000100 00000000 00000000 c1a744b0 000000fa 000000fa c0206180 c028c05f
9ea0: c0e43f80 0000003c 00000038 00000024 bf000000 00000000 00000000 00000000
9ec0: 00000006 00000000 00000009 00000000 00000000 00000000 0000000f 0000000e
9ee0: c2901768 c2901244 c2901000 c0278000 c005a8c8 c005a2f0 c026dc08 c02a8000
9f00: c0279f20 c0279f10 c00ac9b4 c02a8000 00000000 ffffffeb c0e45080 c0019964
9f20: c001b040 c001b070 00000002 c0e45080 c0279f74 c0279f40 c0026950 c00cc964
9f40: 00000000 c0268040 00000000 00000000 bea47ecc 001c5498 00000000 c0279fb0
9f60: 00000006 001c5478 c0279f9c c0279f78 c0026a24 c00267f0 c0268040 00000805
9f80: 0019b650 001c5478 00000080 c001fec4 c0278000 001c5478 00000000 c0279fa8
9fa0: c001fd40 c0047a9c 0019b650 001c5478 00900080 001c5670 00000805 001c5498
9fc0: 00000805 0019b650 001c5478 00000000 001c5488 00000006 001c5478 bea47ec4
9fe0: bea478ac bea478a0 0001b73c 00102230 a0000010 00900080 00000000 00000000
Backtrace:
[<c0047a90>] (sys_init_module+0x0/0x16b4) from [<c001fd40>] (ret_fast_syscall+0x0/0x2c)
Code: e52de004 e1a0c002 e1a0e002 e2511040 (a8a0500c)
Segmentation fault

posted on 2008-04-27 21:20 Normandy 阅读(3566) 评论(3)  编辑 收藏 引用 所属分类: Embeded Area

评论

# re: insmod module 失败(skyeye + armlinux)[未登录]  回复  更多评论   

应该是内核编译的问题,把允许加载内核模块相关选项加上试试
2008-04-28 08:15 | silence

# re: insmod module 失败(skyeye + armlinux)[未登录]  回复  更多评论   

我也试过了,确实有这种现象发生,我也没有找到原因。而且在make menuconfig 时的module 支持确实是打开了,这个问题好像是module在初始化时init_module时发生的段访问错误,具体是什么呢?希望楼主赶快找原因呀!!!希望各位高手在路过时留下建议和解决办法!
2008-04-28 16:20 | kyle

# re: insmod module 失败(skyeye + armlinux)  回复  更多评论   

汗。。。
我用insmod dsplinkk.ko,创建相应设备文件后,执行loop例子也有这个错误
=============== Sample Applicati<1>Unable to handle kernel paging request at virtual address 00006c11
on : LOOP ==========
Entered LOpgd = c1f68000
OP_Create ()
[00006c11] *pgd=10021031, *pte=00000000, *ppte=00000000
Internal error: Oops: 1 [#2]
Modules linked in: dsplinkk
CPU: 0
PC is at DRV_Mmap+0x8/0x44 [dsplinkk]
LR is at do_ioctl+0x3c/0x84
pc : [<bf000008>] lr : [<c00915a8>] Tainted: GF
sp : c1f1bf40 ip : bf000000 fp : c1f1bf5c
r10: 4015864c r9 : c1f1a000 r8 : c00249e4
r7 : 00000000 r6 : 00006c01 r5 : ffffffe7 r4 : c1e24620
r3 : befffdfc r2 : befffdfc r1 : 00006c01 r0 : 00006c01
Flags: NzCv IRQs on FIQs on Mode SVC_32 Segment user
Control: 5717F Table: 11F68000 DAC: 00000015
Process loopgpp (pid: 904, stack limit = 0xc1f1a194)
Stack: (0xc1f1bf40 to 0xc1f1c000)
bf40: c00915a8 c1e24620 befffdfc 00000003 c1f1bf84 c1f1bf60 c0091894 c009157c
bf60: c0054008 00000000 c1e24620 fffffff7 00006c01 00000036 c1f1bfa4 c1f1bf88
bf80: c00918f4 c0091600 00000000 00006c01 00014050 00008000 00000000 c1f1bfa8
bfa0: c0024860 c00918c4 00006c01 c002b068 00000003 00006c01 befffdfc 00009bec
bfc0: 00006c01 00014050 00008000 befffdfc beffff84 00000000 4015864c 00000000
bfe0: 400ff640 befffdc0 000098e0 400ff644 60000010 00000003 712d090a 20656209
Backtrace:
[<c009156c>] (do_ioctl+0x0/0x84) from [<c0091894>] (vfs_ioctl+0x2a4/0x2c4)
r6 = 00000003 r5 = BEFFFDFC r4 = C1E24620
[<c00915f0>] (vfs_ioctl+0x0/0x2c4) from [<c00918f4>] (sys_ioctl+0x40/0x5c)
r7 = 00000036 r6 = 00006C01 r5 = FFFFFFF7 r4 = C1E24620
[<c00918b4>] (sys_ioctl+0x0/0x5c) from [<c0024860>] (ret_fast_syscall+0x0/0x2c)
r6 = 00008000 r5 = 00014050 r4 = 00006C01
Code: 00707067 00000000 e52de004 e1a00001 (e591c010)
Segmentation fault
#
2008-12-13 22:31 | fh

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理