Re: Allocate a large buffer for Virtual Disk

How would you map the memory past MAXMEM into the system process or a user
mode process? Does this map the into memory into the user mode area of the
system thread? If you use MAXMEM to do this, is there a way to find out
how much physical memory the system really has?

On 06/13/01, ““Dave Harvey” ” wrote:
> ----- Original Message -----
> From: “Jamey Kirby”
> To: “NT Developers Interest List”
> Sent: Wednesday, June 13, 2001 11:39 AM
> Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk
>
>
> > > Yet another technique is to only access the memory from a thread
> > > you’ve created,
> > > where that thread is in a process that has mapped a large amount
> > > of physical
> > > address space (again above MAXMEM) into UVA space. Its feasible to
> > > to address 2GB this way.
> >
> > Yes. This works… Since the system process has no user space, you have
> > almost the entire 2 gig to work with. Create a system thread in the system
> > process. Create a section object, associate it with a file or the page file
> > and then map it.
> You can also set MAXMEM low, and map the memory into the system processes UVA
> as if it were 2G of “device” memory. In this case, there can be no paging,
> and you can access the memory from within a system thread (but not a DPC
> or arbitrary thread) at any IRQL.
>
> -DH
>
>
> >
> > This is, in essence, a memory mapped file in kernel mode.
> >
> > Jamey
> >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com]On Behalf Of Dave Harvey
> > > Sent: Tuesday, June 12, 2001 7:01 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk
> > >
> > >
> > > If you are just doing this for one system, and not making a product,
> > > on NT 4 you can get away with setting MAXMEM=64MB on the startup
> > > line, then have a modified RamDisk driver use the Virtual addresses
> > > from 84000000-8fffffff (if you had 512MB). The HAL maps in
> > > the first 512MB of physical address space using 4MB pages, regardless
> > > of whether there is actually physical memory behind it.
> > >
> > > I’ve never tried this on Win2K.
> > >
> > > In a similar vein, I believe that drivers loaded at boot time get
> > > VA’s from
> > > this same space. On of the things on my list is to see if I can get a 384
> > > MB chunk of memory in a driver loaded at boot time by leveraging this
> > > boot time behavior.
> > >
> > > Yet another technique is to only access the memory from a thread
> > > you’ve created,
> > > where that thread is in a process that has mapped a large amount
> > > of physical
> > > address space (again above MAXMEM) into UVA space. Its feasible to
> > > to address 2GB this way.
> > >
> > > -DH
> > > ----- Original Message -----
> > > From: “Brian Palmer”
> > > To: “NT Developers Interest List”
> > > Sent: Thursday, June 07, 2001 10:00 PM
> > > Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk
> > >
> > >
> > > > I would suggest you allocate the memory from the paged pool
> > > instead of using
> > > > non-paged memory for the ramdisk driver. I think the reason it won’t
> > > > allocate that much non-paged memory is because it is a limited resource.
> > > > Instead use MmProbeAndLockPages() to keep your memory resident.
> > > >
> > > > Brian
> > > >
> > > > ----- Original Message -----
> > > > From: “Andreas Roth”
> > > > To: “NT Developers Interest List”
> > > > Sent: Thursday, June 07, 2001 11:08 AM
> > > > Subject: [ntdev] Allocate a large buffer for Virtual Disk
> > > >
> > > >
> > > > > I’m using the Microsoft RAM Disk Driver for Windows 2000. In
> > > my system are
> > > > > 384MB RAM, but when i set the RAM Disk Size to 128MB the
> > > driver failed to
> > > > > allocate the memory. The driver uses
> > > ExAllocatePool(NonPagedPool,…). I
> > > > > think the problem is the memory fragmentation (say me if i’m
> > > wrong). Any
> > > > > suggestions ?
> > > > >
> > > > > A. Roth
> > > > >
> > > > >
> > > > > —
> > > > > You are currently subscribed to ntdev as: xxxxx@sginet.com
> > > > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > > > >
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> > > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You should have nearly 2 gig available in the user-space of the system
process. You can create a section object (ZwCreateSection()) and then map it
into the system process address space.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Monday, August 13, 2001 4:18 PM
Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk

> How would you map the memory past MAXMEM into the system process or a user
> mode process? Does this map the into memory into the user mode area of
the
> system thread? If you use MAXMEM to do this, is there a way to find out
> how much physical memory the system really has?
>
> On 06/13/01, ““Dave Harvey” ” wrote:
> > ----- Original Message -----
> > From: “Jamey Kirby”
> > To: “NT Developers Interest List”
> > Sent: Wednesday, June 13, 2001 11:39 AM
> > Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk
> >
> >
> > > > Yet another technique is to only access the memory from a thread
> > > > you’ve created,
> > > > where that thread is in a process that has mapped a large amount
> > > > of physical
> > > > address space (again above MAXMEM) into UVA space. Its feasible to
> > > > to address 2GB this way.
> > >
> > > Yes. This works… Since the system process has no user space, you
have
> > > almost the entire 2 gig to work with. Create a system thread in the
system
> > > process. Create a section object, associate it with a file or the page
file
> > > and then map it.
> > You can also set MAXMEM low, and map the memory into the system
processes UVA
> > as if it were 2G of “device” memory. In this case, there can be no
paging,
> > and you can access the memory from within a system thread (but not a DPC
> > or arbitrary thread) at any IRQL.
> >
> > -DH
> >
> >
> > >
> > > This is, in essence, a memory mapped file in kernel mode.
> > >
> > > Jamey
> > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com]On Behalf Of Dave Harvey
> > > > Sent: Tuesday, June 12, 2001 7:01 PM
> > > > To: NT Developers Interest List
> > > > Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk
> > > >
> > > >
> > > > If you are just doing this for one system, and not making a product,
> > > > on NT 4 you can get away with setting MAXMEM=64MB on the startup
> > > > line, then have a modified RamDisk driver use the Virtual addresses
> > > > from 84000000-8fffffff (if you had 512MB). The HAL maps in
> > > > the first 512MB of physical address space using 4MB pages,
regardless
> > > > of whether there is actually physical memory behind it.
> > > >
> > > > I’ve never tried this on Win2K.
> > > >
> > > > In a similar vein, I believe that drivers loaded at boot time get
> > > > VA’s from
> > > > this same space. On of the things on my list is to see if I can get
a 384
> > > > MB chunk of memory in a driver loaded at boot time by leveraging
this
> > > > boot time behavior.
> > > >
> > > > Yet another technique is to only access the memory from a thread
> > > > you’ve created,
> > > > where that thread is in a process that has mapped a large amount
> > > > of physical
> > > > address space (again above MAXMEM) into UVA space. Its feasible to
> > > > to address 2GB this way.
> > > >
> > > > -DH
> > > > ----- Original Message -----
> > > > From: “Brian Palmer”
> > > > To: “NT Developers Interest List”
> > > > Sent: Thursday, June 07, 2001 10:00 PM
> > > > Subject: [ntdev] Re: Allocate a large buffer for Virtual Disk
> > > >
> > > >
> > > > > I would suggest you allocate the memory from the paged pool
> > > > instead of using
> > > > > non-paged memory for the ramdisk driver. I think the reason it
won’t
> > > > > allocate that much non-paged memory is because it is a limited
resource.
> > > > > Instead use MmProbeAndLockPages() to keep your memory resident.
> > > > >
> > > > > Brian
> > > > >
> > > > > ----- Original Message -----
> > > > > From: “Andreas Roth”
> > > > > To: “NT Developers Interest List”
> > > > > Sent: Thursday, June 07, 2001 11:08 AM
> > > > > Subject: [ntdev] Allocate a large buffer for Virtual Disk
> > > > >
> > > > >
> > > > > > I’m using the Microsoft RAM Disk Driver for Windows 2000. In
> > > > my system are
> > > > > > 384MB RAM, but when i set the RAM Disk Size to 128MB the
> > > > driver failed to
> > > > > > allocate the memory. The driver uses
> > > > ExAllocatePool(NonPagedPool,…). I
> > > > > > think the problem is the memory fragmentation (say me if i’m
> > > > wrong). Any
> > > > > > suggestions ?
> > > > > >
> > > > > > A. Roth
> > > > > >
> > > > > >
> > > > > > —
> > > > > > You are currently subscribed to ntdev as: xxxxx@sginet.com
> > > > > > To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > > > > >
> > > > >
> > > > >
> > > > > —
> > > > > You are currently subscribed to ntdev as:
xxxxx@syssoftsol.com
> > > > > To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com