Bypassing a nonpaged pool controller when accessing a remainder portion of a random access memory

A method, apparatus, and computer program product for accessing random access memory (RAM) in a computer system running a virtual memory operating system designates a part of the RAM as system memory for use by the operating system. This memory designation consequently produces a remainder memory in the RAM. The remainder memory may be directly accessed by a virtual memory manager upon receipt of an access message requesting access to the remainder memory. The virtual memory manager is controlled to bypass its nonpaged pool controller when accessing the remainder memory. Bypassing the nonpaged pool controller significantly enlarges the available RAM that may be used for temporarily storing data files.

FIELD OF THE INVENTION 
This invention relates generally to memory in a computer system and, more 
particularly, this invention relates to accessing random access memory in 
a computer system having a virtual memory operating system. 
BACKGROUND OF THE INVENTION 
Data stored in conventional high-speed random access memory ("RAM") may be 
accessed much faster (e.g., often about one hundred-thousand times faster) 
than data stored in conventional non-volatile memory. Accordingly, 
application program driver software often is configured to temporarily 
store data files in RAM for subsequent processing by one or more 
application programs. This use of RAM, which may be utilized as a RAM disk 
or a disk cache, significantly reduces file access time, thereby reducing 
the time required for processing the data. 
Virtual memory operating systems (described below) often are configured to 
set aside a small amount of the RAM ("nonpaged pool memory") for 
temporarily storing data files as described above. The remainder of the 
RAM consequently is reserved for storing operating system code and 
executing operating system processes ("operating system RAM"). The 
nonpaged pool memory typically is much smaller than the operating system 
RAM, however, and therefore can become a bottleneck in the computer system 
if it is used to store too much data. 
A virtual memory operating system generally is defined as an operating 
system that automatically pages (i.e., transfers) data between RAM and a 
hard disk when executing system processes. Paging data to and from the 
hard disk conserves space in the RAM, thus enabling the system to function 
as if the physical RAM were significantly larger than its actual size. The 
RAM in a computer system running a virtual memory operating system can be 
accessed only by a virtual memory manager module (a part of the operating 
system) that interfaces the driver software with the RAM. The virtual 
memory manager includes a nonpaged pool controller for accessing the 
nonpaged pool memory when a message is received from a driver requesting 
access to a file (or data) in the nonpaged pool. 
One known virtual memory operating system, for example, is the Microsoft 
Windows NT.TM. operating system, Version 4.0 ("Microsoft Windows NT.TM."), 
distributed by Microsoft Corp. of Redmond, Wash. The operation of virtual 
memory operating systems, such as the Microsoft Windows NT.TM. operating 
system, is described in more detail in "Inside Windows NT", by Helen 
Custer, copyright 1993 by Microsoft Press, the disclosure of which is 
incorporated, in its entirety, by reference. As known in the art, Windows 
NT.TM. includes a virtual memory manager like those described above. This 
virtual memory manager utilizes a plurality of virtual memory manager 
functions to control access to system RAM. 
As noted above, only a limited amount of space in the RAM is allocated to 
the nonpaged pool memory. For example, the Microsoft NT.TM. operating 
system permits a maximum of 192 megabytes of RAM space for the nonpaaged 
pool memory in a system having a four gigabyte or larger RAM. Accordingly, 
the operating system in such case reserves the remaining 3,808 megabytes 
for operating system RAM. Like other virtual memory operating systems, the 
Microsoft NT.TM. operating system requires a minimum of only sixteen 
megabytes of RAM to operate properly. The allocation of 3,808 megabytes 
for operating system RAM thus is not necessary. 
SUMMARY OF THE INVENTION 
In accordance with one aspect of the invention, a method, apparatus, and 
computer program product for accessing random access memory (RAM) in a 
computer system running a virtual memory operating system designates a 
part of the RAM as system memory for use by the operating system. This 
memory designation consequently produces a remainder memory in the RAM. At 
least part of the remainder memory may be directly accessed by a virtual 
memory manager upon receipt of an access message requesting access to the 
remainder memory. The virtual memory manager is controlled to bypass its 
nonpaged pool controller when accessing the remainder memory. Bypassing 
the nonpaged pool controller significantly enlarges the amount of to 
available RAM that may be used for temporarily storing data files. 
In accordance with another aspect of the invention, the access message 
includes the address of a location in the remainder memory that is to be 
accessed. Files in the remainder memory may be created, read, and/or 
written to as a result of the access. In preferred embodiments of the 
invention, the remainder memory is greater than about 192 megabytes. 
In accordance with another aspect of the invention that is implemented as a 
disk cache, a file to be accessed may be stored in either the remainder 
memory or in a hard disk that is a part of the computer system. It 
therefore is determined if the file is stored in the remainder memory or 
in the hard disk. If it is determined that the file is in the remainder 
memory, the virtual memory manager directly accesses the remainder memory 
to access the file. If it is determined that the file is in the hard disk, 
then the file is retrieved from the hard disk and stored in the remainder 
memory for subsequent processing.

DESCRIPTION OF PREFERRED EMBODIMENTS 
FIG. 1 schematically shows a computer system 100 that may be utilized with 
a preferred embodiment of the invention to efficiently utilize random 
access memory. The system 100 includes hardware 101 comprising, among 
other things, a central processing unit 102 for processing computer 
instructions, random access memory ("RAM 104") for high-speed, volatile 
data storage, and a hard disk 106 for non-volatile data storage. The 
system 100 also includes a virtual memory operating system 108 for both 
controlling system processes, and interfacing between an application 
program 110 and the hardware 101. The operating system 108 includes a 
virtual memory manager 112 for accessing the RAM 104, and an input/output 
manager ("I/O manager 114") for controlling input to and output from the 
system 100. The RAM 104 may be accessed by the virtual memory manager 112 
only and thus, is not directly accessible by any other part of the system 
100. In a preferred embodiment of the invention, the operating system 108 
is the Microsoft Windows NT.TM. operating system, Version 4.0 ("Microsoft 
Windows NT.TM.") distributed by Microsoft Corp. Although not necessary in 
many operating systems, a hardware abstraction layer 116 ("HAL") also may 
be included in the system 100 to interface the operating system 108 with 
different hardware architectures. It should be noted that although the 
invention is described in connection with the Windows NT.TM. operating 
system, its principles apply to other virtual memory operation systems. 
In accordance with preferred embodiments of the invention, the amount of 
RAM 104 allocated to operating system processes ("system memory") is 
limited to a fixed maximum amount, and at least a portion of the remainder 
of the RAM 104 ("remainder memory") is allocated to storing files or data 
generated by application programs (e.g., the application program 110) that 
may utilize the system 100. It is preferred that the remainder memory be 
significantly larger than the system memory. For example, in a computer 
system having four gigabytes of RAM 104, the system memory may be about 16 
megabytes while the remainder memory may be 3.984 gigabytes. At least a 
portion of the 3.984 gigabytes are used to store application files or 
application data. 
Files and data stored in the remainder memory, which may be read and 
modified by the application program 110 during run time, can be any type 
of file, such as a database file containing many megabytes of data. Since 
access times to files in the RAM 104 are significantly faster than access 
times to files in the hard disk 106, processes are completed much more 
rapidly when files first are moved into the remainder memory from the hard 
disk 106 prior to their use, and then accessed in the remainder memory 
when needed. By way of example, access times to RAM commonly are at least 
about one hundred-thousand times faster than access times to the hard disk 
106. 
As shown schematically in FIG. 1, the inventive I/O manager 114 includes a 
configuration manager 120 for configuring the RAM 104, a RAM driver 122 
for managing access to the remainder memory, and a file system driver 124 
for managing the RAM filing system (described below). The configuration 
manager 120, which preferably is an application program, configures the 
RAM 104 prior to installing the RAM driver 122. More particularly, the 
configuration manager 120 receives configuration information from a user 
by displaying a form having fields for entering configuration data. The 
fields may include: 
Total RAM in System: the total size of the RAM 104 in the computer system. 
Remainder Memory Size: the total size of the remainder memory. 
Start Location: the lowest address in the remainder memory. The last 
address location of the remainder memory will be this address plus the 
total number of addresses required to include the total remainder memory. 
All addresses between the start location and the last address therefore 
will be a part of the remainder memory. 
Drive Letter: the drive letter assigned to the remainder memory. 
When used with the Microsoft NT.TM. operating system, the configuration 
manager 120 modifies the BOOT.INI file to add the well known /MAXMEM=XXX 
option, where "XXX" is the total amount of system memory as calculated 
from the information received in the form. Specifically, XXX is the 
difference between the total amount of RAM in the computer system, and the 
amount of RAM allocated as remainder memory. As is known by those skilled 
in the art, the MAXMEM option typically is utilized to test specified 
amounts of RAM in a computer system. For example, in a three gigabyte 
system, if the MAXMEM option is set to one gigabyte, then only one 
(specified) gigabyte of RAM will be used by such system. The remaining two 
gigabytes thus are not used. This common use of the MAXMEM option enables 
a section of the RAM to be tested, for example, without physically 
disconnecting parts of the RAM (e.g., the two gigabytes in the immediately 
preceding example) from the entire RAM system (e.g., the three gigabytes 
also in the immediately preceding example). 
Accordingly, the portion of the RAM 104 selected by the MAXMEM option is 
used for the operating system. In fact, even if the nonpaged pool 
controller were being used to store data files for the application 
program, such files would be stored in the RAM designated by the MAXMEM 
option too. Of course, in preferred embodiments, the nonpaged pool 
controller is bypassed and thus, does not attempt to store data in such 
designated RAM. Nevertheless, as discussed in greater detail below, the 
remainder memory (i.e., that portion of the RAM 104 not designated by the 
MAXMEM option) preferably is utilized to store files and data from the 
application program 110. 
The configuration data entered into the form preferably is stored in the 
system configuration registry, which contains all of the configuration and 
set-up data for the operating system 108. Once the registry is updated and 
the MAXMEM option is set, the RAM driver 122 may be initiated to partition 
the RAM 104. Once initiated, the RAM driver 122 first checks the MAXMEM 
option. If it is not set, then the RAM driver 122 may display a message 
indicating that the configuration data must be entered to implement the 
remainder memory. System errors can occur if the MAXMEM option is not set 
since the RAM driver 122 may be attempting to overwrite parts of RAM 104 
that are used by the operating system 108. If the MAXMEM option is set, 
however, then a block of memory space in the RAM 104 may be initialized 
for use as the remainder memory. 
When used with the Microsoft Windows NT.TM. operating system, for example, 
a Microsoft Windows NT.TM. VMM (Virtual Memory Manager) function may be 
called to initialize the remainder memory. For example, such VMM function 
may be "MmMapioSpace," having the input parameters, "physical address", 
"size of file" (i.e., the size of the remainder memory), and "cache." The 
physical address parameter specifies the starting physical address of the 
block of memory reserved as the remainder memory, while the size of file 
parameter specifies the size (in bytes) of the entire remainder memory. 
The Cache parameter preferably is set to "FALSE", thereby preventing the 
operating system from caching stored files. 
After the remainder memory is initialized, the RAM driver 122 continues to 
execute and operates as required by the application program 110. 
Specifically, the RAM driver 122 is used, in conjunction with the file 
system driver 124 (FIG. 1), to store, read, and write to files in the 
remainder memory. 
FIG. 2 shows a flow chart summarizing the steps of a preferred embodiment 
for storing a file in the remainder memory. The process begins at step 
200, in which the application program 110 transmits a request message to 
the I/O manager 114 that a file from the hard disk 106 is to be copied and 
moved to the remainder memory. The message may include the name of the 
file and the address of the file in the hard disk 106. The process 
continues to step 202 in which the file system driver 124 determines the 
unused addresses in the remainder memory and assigns the file to one of 
those addresses as a start address. The file system driver 124 then 
stores, in the RAM 104, the start address of the file in the remainder 
memory. 
The process continues to step 204 in which the file system driver 124 sends 
a message to the RAM driver 122 to store the file in the remainder memory. 
This message may include the name of the file, its current location in the 
hard drive, and the start address assigned to it by the file system driver 
124. The RAM driver 122 then sends a message to the Virtual Memory Manager 
("VMM 112") to store the file in the remainder memory in the appropriate 
address locations (step 206). This message may include the information in 
the message received from the file system driver 124. In response, the VMM 
112 first retrieves the file from the hard drive, and then stores the file 
in the designated location in the remainder memory (step 208). Both the 
retrieval and storage of the file are executed via a VMM function. 
Accordingly, the nonpaged pool memory controller is bypassed and thus, not 
utilized to store the file. If the nonpaged pool memory controller were 
used, then the file would be limited to being stored in the nonpaged pool 
memory. Instead of limiting RAM 104 access to the nonpaged pool memory in 
the RAM 104, however, this direct memory access enables at least a portion 
of the remainder memory to be used to store files. 
FIG. 3 shows a flow chart summarizing preferred steps for retrieving a 
designated file from the remainder memory for use by the application 
program 110. The process begins at step 300 in which the application 
program 110 transmits a request message to the I/O manager 114 requesting 
retrieval of the designated file. The message may include the name of the 
designated file. The I/O manager 114 responsively directs a message to the 
file system driver 124, which determines the start address of the file in 
the computer system 100 (step 302). If a preferred embodiment of the 
invention is used as a RAM disk, then the file is stored in the remainder 
memory. Alternatively, if a preferred embodiment of the invention is used 
as a disk cache, then the address may be in either the remainder memory, 
or in the hard disk 106. If used as a RAM disk, then the file system 
driver 124 transmits a message to the RAM driver 122 with the file start 
address (if in the RAM 104) and the name of the file (step 304). The file 
may be retrieved from the remainder memory in accordance with steps 
314-318 as discussed below. 
If a preferred embodiment of the invention is used as a disk cache, it then 
is determined at step 306 whether the file is in the RAM 104 or in the 
hard disk 106. If the address is in the hard disk 106, then the RAM driver 
122 transmits a message to a SCSI driver (not shown) to retrieve the file 
from the hard disk 106 (step 308). The SCSI driver then locates the file, 
accesses the hard disk 106 via the HAL 116 to retrieve the file (step 
310), and then directs the file to the application program 110 (step 312). 
The file may be retrieved from the hard disk 106 and directed to the 
application program 110 in accordance with conventional processes. 
If the address is in the RAM 104 (i.e., in the remainder memory), then the 
process continues to step 314 in which the RAM driver 122 sends a message 
to the VMM 112 to retrieve the file from the remainder memory. This 
message may include the start address of the file in the remainder memory, 
and a call to the VMM 112 to retrieve the file from the RAM 104. The VMM 
112 responsively accesses the remainder memory at that address, retrieves 
the file (step 316) and then directs the file to the program 110 via the 
file system driver 124 (step 318). In preferred embodiments, the memory 
access, file retrieval, and file directing are performed by a VMM 
function. 
As suggested above, the invention may be implemented as a RAM disk, or as a 
disk cache. In either case, the RAM 104 may be utilized to temporarily 
store large volumes of data, thus enabling more files to be stored in the 
RAM 104. 
In an alternative embodiment, the invention may be implemented as a 
computer program product for use with a computer system. Such 
implementation may include a series of computer instructions fixed either 
on a tangible medium, such as a computer readable media (e.g., a diskette, 
CD-ROM, ROM, or fixed disk), or transmittable to a computer system via a 
modem or other interface device, such as a communications adapter 
connected to a network over a medium. The medium may be either a tangible 
medium (e.g., optical or analog communications lines) or a medium 
implemented with wireless techniques (e.g., microwave, infrared or other 
transmission techniques). The series of computer instructions embodies all 
or part of the functionality previously described herein with respect to 
the system. Those skilled in the art should appreciate that such computer 
instructions can be written in a number of programming languages for use 
with many computer architectures or operating systems. Furthermore, such 
instructions may be stored in any memory device, such as semiconductor, 
magnetic, optical or other memory devices, and may be transmitted using 
any communications technology, such as optical, infrared, microwave, or 
other transmission technologies. It is expected that such a computer 
program product may be distributed as a removable media with accompanying 
printed or electronic documentation (e.g., shrink wrapped software), 
preloaded with a computer system (e.g., on system ROM or fixed disk), or 
distributed from a server or electronic bulletin board over the network 
(e.g., the Internet or World Wide Web). 
Although various exemplary embodiments of the invention have been 
disclosed, it should be apparent to those skilled in the art that various 
changes and modifications can be made which will achieve some of the 
advantages of the invention without departing from the true scope of the 
invention. These and other obvious modifications are intended to be 
covered by the appended claims.