기존 이솝 임베디드 포럼의 지식인 서비스가 게시판 형태로 변경되었습니다.

제가 만든 모듈을 보드에 있는 커널에 삽입하려고 하니..아래와 같은 에러가 발생했습니다.

왜? 이런 에러가 발생하는 것일까요? 고수님들의 친절한 답변 부탁드립니다.

 

[root@rw_led]$ insmod dev_led.ko

 


Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c1f3c000
[00000000] *pgd=21f12031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT
Modules linked in: dev_led(+)
CPU: 0    Not tainted  (2.6.30-0.8 #126)
PC is at module_trace_bprintk_format_notify+0x34/0xdc
LR is at module_trace_bprintk_format_notify+0x2c/0xdc
pc : [<c007b960>]    lr : [<c007b958>]    psr: 00000013
sp : c1f33f18  ip : c03606fc  fp : 00000000
r10: fc000040  r9 : c1f32000  r8 : c0360714
r7 : 00000000  r6 : fffffffe  r5 : 00000000  r4 : c036047c
r3 : bf000010  r2 : 00000000  r1 : 00000001  r0 : c0360708
Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 21f3c000  DAC: 00000015
Process insmod (pid: 465, stack limit = 0xc1f32268)
Stack: (0xc1f33f18 to 0xc1f34000)
3f00:                                                       c2946e7c c036047c
3f20: 00000000 fffffffe 00000000 bf0008b8 00000001 c005ed10 00000000 c035c4f0
3f40: c035c4e4 bf0008b8 ffffffff 00000001 00000000 c005f05c 00000000 00000000
3f60: 00001030 bf0008b8 000e2040 00000000 c002bfa8 c005f08c 00000000 00000000
3f80: 00000000 c006c4e0 00000003 c1c67a80 c1e4e600 be8ccba0 00000000 be8ccc28
3fa0: 00000080 c002be00 be8ccba0 00000000 000e2040 00001030 000de655 00000000
3fc0: be8ccba0 00000000 be8ccc28 00000080 be8ccc24 be8ccc28 00000001 00000000
3fe0: 400349fc be8cc988 0001dc0c 40034a10 20000010 000e2040 00000000 00000000
[<c007b960>] (module_trace_bprintk_format_notify+0x34/0xdc) from [<c005ed10>] (notifier_call_chain+0x30/0x78)
[<c005ed10>] (notifier_call_chain+0x30/0x78) from [<c005f05c>] (__blocking_notifier_call_chain+0x4c/0x64)
[<c005f05c>] (__blocking_notifier_call_chain+0x4c/0x64) from [<c005f08c>] (blocking_notifier_call_chain+0x18/0x20)
[<c005f08c>] (blocking_notifier_call_chain+0x18/0x20) from [<c006c4e0>] (sys_init_module+0x80/0x194)
[<c006c4e0>] (sys_init_module+0x80/0x194) from [<c002be00>] (ret_fast_syscall+0x0/0x2c)
Code: e59f00a8 eb085f35 e59f80a4 ea000020 (e5957000)
---[ end trace c643ed52ecd48ed6 ]---
Segmentation fault


쾌도난마

2012.04.07 02:38:43
*.50.20.11

경험상 모듈을 따로 컴파일 하여 insmod 할 때 사용중인 커널을 생성 했었던 config 와 동일해야 합니다.


module_trace_bprintk_format_notify 위치에서와 같이


kernel 이 컴파일 될 때 trace 관련 config 를 disable 해 놓았고

module 을 컴파일 할 때 trace 관련 config 가 enable 해 놓은 (.config 인지 autoconf.h 인지... )것을 include 했으면 위와 같은 에러가 발생 할 듯 싶습니다. 

( 혹은 반대로 dis/enable 인 경우도.... )

List of Articles
번호 제목 글쓴이 날짜 조회 수sort

사용자 로그인