Hello matthew, thx for your response On Mon, May 26, 2008 at 4:56 AM, Matthew Wilcox <matthew@xxxxxx> wrote: > On Mon, May 26, 2008 at 03:13:43AM +0700, Iwan Budi Kusnanto wrote: >> Hello, i recently porting my driver from 2.4.35 to 2.6.X kernel. >> I meet some strange behaviour with sema_init. This is the code snippet >> >> /** >> * this code is compiled & working in 2.4 kernel. >> * Compiled in 2.6 but fail in module initialization. > > How does it fail? What error messages do you get? It fail in module initialization. This is output from dmesg BUG: unable to handle kernel NULL pointer dereference at virtual address 00000001 printing eip: c0122297 *pde = 00000000 Oops: 0002 [#1] PREEMPT Modules linked in: logDrv services ipv6 loop e100 mii rtc ide_cd cdrom i2c_i801 serio_raw i2c_core shpchp pci_hotplug intel_agp agpgart ide_disk ide_generic opti621 it821x via82cxxx cs5535 slc90e66 piix pdc202xx_old cs5520 hpt34x sc1200 amd74xx triflex cy82c693 rz1000 pdc202xx_new generic aec62xx ns87415 hpt366 trm290 cmd64x serverworks alim15x3 siimage cs5530 atiixp sis5513 ide_core CPU: 0 EIP: 0060:[<c0122297>] Not tainted VLI EFLAGS: 00010282 (2.6.18-dev-ofc #1) EIP is at init_waitqueue_head+0x3/0xc eax: 00000001 ebx: 00000000 ecx: 00000000 edx: 00000001 esi: b7e2be5e edi: b7ecb9f9 ebp: cbecbf98 esp: cbecbf4c ds: 007b es: 007b ss: 0068 Process insmod (pid: 1436, ti=cbeca000 task=cdfdf030 task.ti=cbeca000) Stack: 00000000 0000000a 00000000 00000009 ceafb1cd ceb30068 0000000d 00000000 00000000 00000019 00000018 0000001a ce8bf7d4 00000001 00000000 cbecbf88 cbecbf88 ceafce80 00000001 cbecbfa8 ce874010 ceafce80 ceafce80 cbeca000 Call Trace: [<ceafb1cd>] my_log_system_init+0x3d/0x50 [logDrv] [<ce874010>] my_log_init+0x10/0x33 [logDrv] [<c012a1d5>] sys_init_module+0x8b/0x18e [<c0102585>] sysenter_past_esp+0x56/0x79 Code: 13 32 c0 e8 1e 0a 14 00 c7 05 64 13 32 c0 00 00 00 00 8b 1d 68 13 32 c0 b8 7c 04 2b c0 e8 78 13 14 00 89 d8 5b c3 90 90 83 ec 10 <89> 00 89 40 04 83 c4 10 c3 56 53 83 22 fe 9c 5e fa 89 e1 81 e1 EIP: [<c0122297>] init_waitqueue_head+0x3/0xc SS:ESP 0068:cbecbf4c And this is error message in console. Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: Oops: 0002 [#1] Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: PREEMPT Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: CPU: 0 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: EIP is at init_waitqueue_head+0x3/0xc Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: eax: 00000001 ebx: 00000000 ecx: 00000000 edx: 00000001 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: esi: b7e2be5e edi: b7ecb9f9 ebp: cbecbf98 esp: cbecbf4c Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: ds: 007b es: 007b ss: 0068 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: Process insmod (pid: 1436, ti=cbeca000 task=cdfdf030 task.ti=cbeca000) Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: Stack: 00000000 0000000a 00000000 00000009 ceafb1cd ceb30068 0000000d 00000000 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: 00000000 00000019 00000018 0000001a ce8bf7d4 00000001 00000000 cbecbf88 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: cbecbf88 ceafce80 00000001 cbecbfa8 ce874010 ceafce80 ceafce80 cbeca000 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: Call Trace: Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: Code: 13 32 c0 e8 1e 0a 14 00 c7 05 64 13 32 c0 00 00 00 00 8b 1d 68 13 32 c0 b8 7c 04 2b c0 e8 78 13 14 00 89 d8 5b c3 90 90 83 ec 10 <89> 00 89 40 04 83 c4 10 c3 56 53 83 22 fe 9c 5e fa 89 e1 81 e1 Message from syslogd@sandbox at Mon May 26 19:19:30 2008 ... sandbox kernel: EIP: [<c0122297>] init_waitqueue_head+0x3/0xc SS:ESP 0068:cbecbf4c And i attached my kernel config Thx -- Iwan Budi Kusnanto
Attachment:
konfig-18-dev-ofc
Description: Binary data