Can we base E100BEX DDK sample to develop driver for Realtek RTL 8139

Hi all,

I am a newbie in driver developement.I am trying to write a
driver for Realtek RTL 8139 NIC by modifying the DDK sample code E100BEX.( I
am not including the mp_pm.lib). In Miniport initialize function i found
NdisMQueryAdapterResources returning sucess and When I tried to assign the
memory after that i got BSOD and the Bug Check code is 0x0000001e.

Bug Details

Realtek sample Driver Entry Routine
Thu Sep 14 10:25:30.875 2006 (GMT+6): Success in DriverEntry
Thu Sep 14 10:25:30.968 2006 (GMT+6): Sucess in the RltkAllocAdapter routine
Thu Sep 14 10:25:30.968 2006 (GMT+6): Success in RlTkNICReadRegParameters
Thu Sep 14 10:25:30.984 2006 (GMT+6): Entering into the Find adapter routine
Thu Sep 14 10:25:30.984 2006 (GMT+6): Adapter is found -
VendorID/DeviceID=10ec/8139
Thu Sep 14 10:25:31.000 2006 (GMT+6): IoBaseAddress = 0xe400
Thu Sep 14 10:25:31.000 2006 (GMT+6): IoRange = x100
Thu Sep 14 10:25:31.015 2006 (GMT+6): Realtek’s Memory Range
Thu Sep 14 10:25:31.015 2006 (GMT+6): Realtek’s Memory Length : 100
Thu Sep 14 10:25:31.015 2006 (GMT+6): MemPhysAddress(Low) = 0xe7101000
Thu Sep 14 10:25:31.031 2006 (GMT+6): MemPhysAddress(High) = 0x0
Thu Sep 14 10:25:31.031 2006 (GMT+6): InterruptLevel = x7
Thu Sep 14 10:25:31.046 2006 (GMT+6): <— FindRealtek Adapter, Status=0
Thu Sep 14 10:25:31.062 2006 (GMT+6):
*** Fatal System Error: 0x0000001e
(0xC0000005,0x00000000,0x00000000,0x00000000)

Thu Sep 14 10:25:31.265 2006 (GMT+6): Break instruction exception - code
80000003 (first chance)

Bugcheck Analysis

Bugcheck code 0000001E
Arguments c0000005 00000000 00000000 00000000

ChildEBP RetAddr Args to Child
ed43eff0 8042c507 00000003 ed43f038 c0000005
nt!RtlpBreakWithStatusInstruction
ed43f020 8042c8cb 00000003 804095d8 00000000 nt!KiBugCheckDebugBreak+0x31
ed43f3ac 804559bc 0000001e c0000005 00000000 nt!KeBugCheckEx+0x390
ed43f3c4 80455a3c ed43f3ec 80460bd7 ed43f3f4
nt!PspUnhandledExceptionInSystemThread+0x18
ed43fddc 80469bb2 804190f0 00000001 00000000 nt!PspSystemThreadStartup+0x5e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

nt!RtlpBreakWithStatusInstruction:
80456488 cc int 3

I tried

I referred this bugcheck code in the ddtools in DDK help. And from
0xC0000005 i understood that

it is bcoz of a memory access violation and as per the reference it says
that 4 th parameter

describes the address that driver attempted to access. ???

Please give me advice.

Thanks in advance
vimal

You are referencing a null pointer. In general it would be a good idea to
post the output from windbg’s analyze -v command if you want help on a
bugcheck. The code segment from the offending region would also help.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of vimalraj s
Sent: Monday, September 18, 2006 2:25 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Can we base E100BEX DDK sample to develop driver for
Realtek RTL 8139

Hi all,

I am a newbie in driver developement.I am trying to write a
driver for Realtek RTL 8139 NIC by modifying the DDK sample code E100BEX.( I
am not including the mp_pm.lib). In Miniport initialize function i found
NdisMQueryAdapterResources returning sucess and When I tried to assign the
memory after that i got BSOD and the Bug Check code is 0x0000001e.

Bug Details

Realtek sample Driver Entry Routine
Thu Sep 14 10:25:30.875 2006 (GMT+6): Success in DriverEntry
Thu Sep 14 10:25:30.968 2006 (GMT+6): Sucess in the RltkAllocAdapter routine
Thu Sep 14 10:25:30.968 2006 (GMT+6): Success in RlTkNICReadRegParameters
Thu Sep 14 10:25:30.984 2006 (GMT+6): Entering into the Find adapter routine
Thu Sep 14 10:25:30.984 2006 (GMT+6): Adapter is found -
VendorID/DeviceID=10ec/8139
Thu Sep 14 10:25:31.000 2006 (GMT+6): IoBaseAddress = 0xe400
Thu Sep 14 10:25:31.000 2006 (GMT+6): IoRange = x100
Thu Sep 14 10:25:31.015 2006 (GMT+6): Realtek’s Memory Range
Thu Sep 14 10:25:31.015 2006 (GMT+6): Realtek’s Memory Length : 100
Thu Sep 14 10:25:31.015 2006 (GMT+6): MemPhysAddress(Low) = 0xe7101000
Thu Sep 14 10:25:31.031 2006 (GMT+6): MemPhysAddress(High) = 0x0
Thu Sep 14 10:25:31.031 2006 (GMT+6): InterruptLevel = x7
Thu Sep 14 10:25:31.046 2006 (GMT+6): <— FindRealtek Adapter, Status=0
Thu Sep 14 10:25:31.062 2006 (GMT+6):
*** Fatal System Error: 0x0000001e
(0xC0000005,0x00000000,0x00000000,0x00000000)

Thu Sep 14 10:25:31.265 2006 (GMT+6): Break instruction exception - code
80000003 (first chance)

Bugcheck Analysis

Bugcheck code 0000001E
Arguments c0000005 00000000 00000000 00000000

ChildEBP RetAddr Args to Child
ed43eff0 8042c507 00000003 ed43f038 c0000005
nt!RtlpBreakWithStatusInstruction
ed43f020 8042c8cb 00000003 804095d8 00000000 nt!KiBugCheckDebugBreak+0x31
ed43f3ac 804559bc 0000001e c0000005 00000000 nt!KeBugCheckEx+0x390
ed43f3c4 80455a3c ed43f3ec 80460bd7 ed43f3f4
nt!PspUnhandledExceptionInSystemThread+0x18
ed43fddc 80469bb2 804190f0 00000001 00000000 nt!PspSystemThreadStartup+0x5e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

nt!RtlpBreakWithStatusInstruction:
80456488 cc int 3

I tried

I referred this bugcheck code in the ddtools in DDK help. And from
0xC0000005 i understood that

it is bcoz of a memory access violation and as per the reference it says
that 4 th parameter

describes the address that driver attempted to access. ???

Please give me advice.

Thanks in advance
vimal
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer