Hello
I’m writing Ramdisk driver for W2K which will be able to allocate disks
2GB. To allocate memory I’m using MmAllocatePagesForMdl, but on some
computers loading driver ends with BSOD.
After experiments I’ve found that BSOD is appearing in two situations:
1.) if I set LowAddress above size of physical memory installed in system
2.) if there isn’t any available memory left
In DDK description of this function stands that it should return NULL in
such cases.
However it works fine when there is some memory left and I try to allocate
much more, in this case it returns mdl with available memory.
i.e.
LowAddress.QuadPart = (LONGLONG)0;
HighAddress.QuadPart = (LONGLONG)0x100000000;
SkipBytes.QuadPart = (LONGLONG)0;
for (i=0;i<1000;i++)
mdls[i] =
MmAllocatePagesForMdl(LowAddress,HighAddress,SkipBytes,1024*1024);
ends with BSOD.
Any ideas?
Krzysztof Suszka
“Krzysztof Suszka” wrote in message
news:xxxxx@ntdev…
>
> >2GB. To allocate memory I’m using MmAllocatePagesForMdl, but on some
> computers loading driver ends with BSOD.
> After experiments I’ve found that BSOD is appearing in two situations:
> 1.) if I set LowAddress above size of physical memory installed in system
> 2.) if there isn’t any available memory left
>
Let me get this right: You want >2GB of NONPAGED memory for this device?
Sorry, but (assuming we’re talking about 32-bit systems here) that’s not
gonna happen. The o/s only has 2GB of Kernel Virtual Address Space with
which to map things in system space. That includes the o/s, cache, etc.
Sounds to me like you’ve got a bit of a design flaw there. On the other
hand, if your device is limited to IA64 systems, repro the problem with
checked kernel and hal, and with driver verifier enabled. post the output
of analyze -v, and tell us how much physical memory you have on the machine.
Peter
OSR
Design flaw or no, this request shouldn’t be able to bug check right?
–
Bill McKenzie
Compuware Corporation
Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
http://frontline.compuware.com/nashua/patches/utility.htm
“Peter Viscarola” wrote in message news:xxxxx@ntdev…
>
> “Krzysztof Suszka” wrote in message
> news:xxxxx@ntdev…
> >
> > >2GB. To allocate memory I’m using MmAllocatePagesForMdl, but on some
> > computers loading driver ends with BSOD.
> > After experiments I’ve found that BSOD is appearing in two situations:
> > 1.) if I set LowAddress above size of physical memory installed in
system
> > 2.) if there isn’t any available memory left
> >
>
> Let me get this right: You want >2GB of NONPAGED memory for this device?
> Sorry, but (assuming we’re talking about 32-bit systems here) that’s not
> gonna happen. The o/s only has 2GB of Kernel Virtual Address Space with
> which to map things in system space. That includes the o/s, cache, etc.
>
> Sounds to me like you’ve got a bit of a design flaw there. On the other
> hand, if your device is limited to IA64 systems, repro the problem with
> checked kernel and hal, and with driver verifier enabled. post the output
> of analyze -v, and tell us how much physical memory you have on the
machine.
>
> Peter
> OSR
>
>
>
>
If he gives us a stack trace, we can tell him what exactly
crashes the systemm and how he calls the APIs. Untill then, Im reluctant to
say what exactly BSOD and whatever is legal or not.
Dan
----- Original Message -----
From: “Bill McKenzie”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 17, 2003 6:14 PM
Subject: [ntdev] Re: MmAllocatePagesForMdl and BSOD
> Design flaw or no, this request shouldn’t be able to bug check right?
>
> –
> Bill McKenzie
> Compuware Corporation
> Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
> http://frontline.compuware.com/nashua/patches/utility.htm
>
>
> “Peter Viscarola” wrote in message news:xxxxx@ntdev…
> >
> > “Krzysztof Suszka” wrote in message
> > news:xxxxx@ntdev…
> > >
> > > >2GB. To allocate memory I’m using MmAllocatePagesForMdl, but on some
> > > computers loading driver ends with BSOD.
> > > After experiments I’ve found that BSOD is appearing in two situations:
> > > 1.) if I set LowAddress above size of physical memory installed in
> system
> > > 2.) if there isn’t any available memory left
> > >
> >
> > Let me get this right: You want >2GB of NONPAGED memory for this device?
> > Sorry, but (assuming we’re talking about 32-bit systems here) that’s not
> > gonna happen. The o/s only has 2GB of Kernel Virtual Address Space with
> > which to map things in system space. That includes the o/s, cache, etc.
> >
> > Sounds to me like you’ve got a bit of a design flaw there. On the other
> > hand, if your device is limited to IA64 systems, repro the problem with
> > checked kernel and hal, and with driver verifier enabled. post the
output
> > of analyze -v, and tell us how much physical memory you have on the
> machine.
> >
> > Peter
> > OSR
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
May be “out of PTE’s” ?
----- Original Message -----
From: “Dan Partelly”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 17, 2003 5:21 PM
Subject: [ntdev] Re: MmAllocatePagesForMdl and BSOD
> If he gives us a stack trace, we can tell him what exactly
> crashes the systemm and how he calls the APIs. Untill then, Im reluctant to
> say what exactly BSOD and whatever is legal or not.
>
> Dan
>
> ----- Original Message -----
> From: “Bill McKenzie”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Wednesday, September 17, 2003 6:14 PM
> Subject: [ntdev] Re: MmAllocatePagesForMdl and BSOD
>
>
> > Design flaw or no, this request shouldn’t be able to bug check right?
> >
> > –
> > Bill McKenzie
> > Compuware Corporation
> > Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
> > http://frontline.compuware.com/nashua/patches/utility.htm
> >
> >
> > “Peter Viscarola” wrote in message news:xxxxx@ntdev…
> > >
> > > “Krzysztof Suszka” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > > >2GB. To allocate memory I’m using MmAllocatePagesForMdl, but on some
> > > > computers loading driver ends with BSOD.
> > > > After experiments I’ve found that BSOD is appearing in two situations:
> > > > 1.) if I set LowAddress above size of physical memory installed in
> > system
> > > > 2.) if there isn’t any available memory left
> > > >
> > >
> > > Let me get this right: You want >2GB of NONPAGED memory for this device?
> > > Sorry, but (assuming we’re talking about 32-bit systems here) that’s not
> > > gonna happen. The o/s only has 2GB of Kernel Virtual Address Space with
> > > which to map things in system space. That includes the o/s, cache, etc.
> > >
> > > Sounds to me like you’ve got a bit of a design flaw there. On the other
> > > hand, if your device is limited to IA64 systems, repro the problem with
> > > checked kernel and hal, and with driver verifier enabled. post the
> output
> > > of analyze -v, and tell us how much physical memory you have on the
> > machine.
> > >
> > > Peter
> > > OSR
> > >
> > >
> > >
> > >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
yes, i want >2GB nonpaged memory, but to achieve this, i was gonna
allocate with MmAllocatePagesForMdl several times blocks of i.e 128MB, and
then map them into virtual address space separately, one at time,
something like AWE idea.
BSODs are appearing on machine with 320MB ram, but 8mb of it is as shared
memory for graphics card.
Stop code is 7E with exception code 0xc0000005
Krzysztof Suszka
Is an acess violation, the BSOD is because incorect code somewhere, and not
because MmAllocate…ForMdl() fails.
----- Original Message -----
From: “Krzysztof Suszka”
To: “Windows System Software Devs Interest List”
Sent: Thursday, September 18, 2003 1:26 PM
Subject: [ntdev] Re: MmAllocatePagesForMdl and BSOD
> yes, i want >2GB nonpaged memory, but to achieve this, i was gonna
> allocate with MmAllocatePagesForMdl several times blocks of i.e 128MB, and
> then map them into virtual address space separately, one at time,
> something like AWE idea.
>
> BSODs are appearing on machine with 320MB ram, but 8mb of it is as shared
> memory for graphics card.
> Stop code is 7E with exception code 0xc0000005
>
> Krzysztof Suszka
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Thanks everybody
MmAllocatePagesForMdl works perfectly.
I’m ashamed to say I made academic mistake in my code.
I can’t believe I didn’t see it before.
Sorry for bothering you.
Kindest regards
Krzysztof Suszka