Apparatus and method for background memory test during system start up

Abstract: A system and method is provided for testing a computer system main memory during system startup. An initial block of memory (20) is tested and marked as valid or invalid during a startup sequence, with the remaining system memory initially marked as bad. An operating system and applications can be loaded into the initial block and operate normally, and a concurrent process is invoked to test the remaining system memory. This allows the remaining system memory to be tested and marked as valid during normal system operation.

Description: The present invention relates generally to digital computer systems, and more specifically to a system and method for testing memory in a computer system. When operation of a computer system is started, it is common practice to test the main system memory by writing a preselected data pattern to every memory location and reading the memory locations back to see if they are correct. This allows the system to determine which memory locations are good and mark the bad locations so that they will not be used. A memory test is generally performed when power is first applied to the system, and sometimes after certain system resets. The process of restarting the computer system, of which such memory test is a part, is often referred to as the system boot (bootstrap), or IPL (initial program load). As the amount of main memory used in computer systems increases, a longer period of time is required to test the system memory. Computer systems with several tens of megabytes of memory have become common only relatively recently. Future systems are expected to have one or more hundreds of megabytes. The time required for testing the main memory in such systems is becoming quite long. Since programs cannot be run using the system memory until it has been tested, a significant delay is encountered before the system can be used for productive applications. With some computer systems, the system memory test at boot time is simply skipped, or performed only at the option of a user. In many cases, skipping the memory test causes no problem because of the high reliability of computer semiconductor memories. However, problems do occasionally occur and the risk of not performing the check can be high As the amount of main memory used in computer systems increases, the chances of one or more bad memory locations occurring increases. This means that memory testing, in general, is more important for those computer systems for which it takes the longest amount of time. It is therefore desirable to provide a system and method for testing all of the main memory of a computer system. It is also desirable for such a system and method to test system memory without requiring long delays when a computer system is booted. In accordance with the present invention, a method of operating a computer system in which testing of memory locations of a memory of said computer system is required, the method comprises the steps of first testing an initial portion of the memory; then loading an operating system into said initial portion of the memory and beginning execution thereof; and then testing a further portion of the memory during execution of said operating system. Also in accordance with the present invention, a computer system comprises: a memory; means for testing an initial portion of said memory; means for loading an operating system into said initial portion of said memory; means for executing said operating system; and means for testing a further portion of said memory during execution of said operating system. In order that the invention will be fully understood a preferred embodiment thereof will now be described with reference to the accompanying drawings in which: Figure 1 is a block diagram of portions of a computer system utilizing the present invention; Figure 2 is a flowchart of a method of testing system memory according to the present invention; Figure 3 is a data structure indicating information preferably stored in a nonvolatile memory utilized in the present invention; and Figure 4 is a block diagram showing use of a bitmap by a memory management unit. Referring to Figure 1, a computer system generally referred to by reference number 10 includes a main system memory 12 connected to a central processor 14. A mass storage device 16, typically a magnetic or optical device, is connected to the central processor 14. Various portions of the system 10 well known in the art, such as input/output devices, communications buses and memory management units, are not shown in Figure 1 but would normally be included with the system. Main memory 12, for purposes of the present invention, can be conceptually divided into three regions. A non-volatile memory 18 provides programs and data which must be retained by system 10 when power is not applied thereto. The remaining, volatile, memory is divided into an initially tested block 20 and a dynamically tested block 22. Non-volatile memory 18 is known in the art, and can be, for example, an electrically erasable programable read only memory (EEPROM) or CMOS static random access memory (SRAM) with an integral battery backup. It may also be stored in a known location on a media such as a magnetic disk. Volatile memory, 20, 22 is typically dynamic random access memory (DRAM). Central processor 14 would generally be expected to include a memory management unit (not shown), and a memory cache connected to main system memory 12. When the system 10 is powered up, central processor 14 bootstraps itself into operation using programs and data stored in non-volatile memory 18. It then performs a memory test only on the initially tested block 20. Once memory block 20 has been tested, the boot sequence is completed and an operating system loaded into the initial block 20 from the mass storage device 16. Normal system operation can begin at this time, with a bitmap being retained within system memory 12 which indicates those portions of memory 12 which have been tested and marked as good. The operating system loaded into the initially tested block 20 preferably supports multiprocessing, and should at least support the performance of a background process. The operating system is also preferably a demand paged virtual memory system, so that the virtual memory space in which it runs is not affected by the amount of physical memory which is actually available. A memory testing process is initiated by the operating system, and used to test the dynamically tested memory block 22 while the operating system otherwise operates normally. This allows the dynamically tested block 22 to be tested while the remainder of the system functions in the usual manner. Using this technique, a longer elapsed real time is generally required before all of the main memory 12 has been tested. However, the delay which is experienced before normal system operation begins can be much less. Referring to Figure 2, a flowchart illustrates the preferred steps utilized by the present invention. When power is applied to the system, or a system reset occurs for which a memory test is desired, an initial boot sequence is performed 30. The boot sequence includes a test of the initial memory block 32 followed by loading the main operating system into main memory 34. In some systems, the entire operating system will be loaded in step 34. In others, having very large and complex operating systems, it may be desirable to only load a portion of the operating system into main memory in step 34. The portion loaded in should be enough to enable support of concurrent processes. A concurrent memory test process is then initiated in step 36, and the remainder of the operating system, if any, completes loading 38. At this time, user and other applications can begin processing in the normal manner 40. The memory test process initiated in step 36 is preferably a child process which simply tests memory locations by writing preselected data patterns to every memory location and reading them back to insure that such memory locations are functional. If desirable, more than one test pattern can be written to each location. A small portion of memory, such as one or a few physical memory pages, is tested by the child process at one time 42. Good pages are reported 44 by writing an appropriate bit or bits into a physical memory bitmap used by the virtual memory manager to identify good memory locations. If the memory testing process is not complete 46, control returns to step 42 to test additional memory. When the test of step 46 indicates that all of the dynamically tested portion of main memory 22 has been tested, the child process associated with memory testing ends 48. Figure 3 illustrates a data structure 50 indicating information which is preferably stored in the nonvolatile memory 18 for use in the present invention. A bit definition value 52 indicates the size of the memory block which corresponds to each bit entered in a physical memory bitmap accessed by the virtual memory manager. This value may be expressed in terms of bytes, words, or pages according to the design of the system 10. An initial block size entry 54 indicates the size of the initially tested block 20, and may be expressed in terms of physical pages or other measure as desired. A starting location for the initial block 55 is provided to allow the initial block to be located anywhere in physical memory. In many systems, the starting location 55 can be omitted, with the initial block beginning at memory location 0 or some other default location. A total memory size value 56 indicates the total amount of volatile memory 20, 22 present in the system, or may be used to store a value specifically for the size of dynamically tested block 22 if desired. If the amount of physical main memory present in the system 10 is changed, the values 54, 56 can be changed. Figure 4 illustrates the relationship between a memory management unit 60, the physical memory bitmap 62, and the concurrent memory test process 64. The memory management unit 60 accesses address translation tables 66 to determine which memory pages are available for use. Address translation tables 66 are updated by a virtual memory manager 68 from information available in the bitmap 62. As bitmap 62 is updated to reflect testing of additional memory, the virtual memory manager 68 updates the address translation tables 66 for use by the memory management unit 60. The bitmap 62 is an array of bits, with each bit corresponding to one or more physical pages as defined by the bit definition value 52. If one or more memory locations are bad, usually due to failure of a semiconductor device somewhere within the system, those invalid locations will be reflected within the bitmap 62 and will not be listed in the address translation tables 66 for storage of programs and data. During the boot sequence, bitmap 62 is initialized to show all memory locations invalid, and good pages, or groups of pages, are marked as good therein during the initial memory test. The virtual memory manager 68 then writes the results of the initial memory test into the address translation tables 66. As far as the memory management unit 60 is concerned, there is no difference between a physical page which has been tested and found bad and one which is not yet been tested. The concurrent memory test process 64, as it successfully tests small blocks of memory, marks them as good by setting the appropriate bit or bits within the bitmap 62. The virtual memory manager 68 periodically examines the bitmap 62, and updates the address translation tables 66. These physical memory locations are now available for use by the memory management unit 60. As execution of the concurrent memory test process 64 continues, the bitmap 62 will reflect that more and more physical memory is available for use. The size of the memory bitmap 62 depends on the amount of main memory actually present within the system 10. The bit definition value 52 is used to determine the size of the memory block which corresponds with each single bit entry in the bitmap 62. This can be used to prevent bitmap 62 from growing too large for extremely large memories 12 by increasing the block size corresponding to each bit within bitmap 62. A brief example will illustrate the extent of the time savings which can be encountered when using the present invention. Assume that 200 megabytes of main system memory are present, and they can normally be tested at rate of one megabyte per second. Assume further that at least six megabytes of physical memory are needed to efficiently execute the operating system, and various applications such as input/output device testers and initializers and miscellaneous system housekeeping applications require at least four megabytes for efficient operation. Instead of waiting 200 seconds for the entire physical memory to be tested initially, and initial 10 megabyte block can be tested in 10 seconds followed by loading of the operating system. Within the initial 10 megabyte block, applications can be run to initialize and test various input/output devices connected to the system, including testing communications with other systems which may be connected to this one. One of the processes which begins operation is a special system process which is allowed to perform memory testing on the remaining main memory which was initially marked as bad. As time goes on, more and more physical memory is available to the system, which will tend to speed up system operation as the amount of virtual memory paging which is required decreases. Although the real time which passes before the entire system memory is tested could be much longer than the 200 seconds used if it is tested at boot time, worthwhile system operations are commenced after a delay only 5% as long. Although the preferred embodiment has been described as applying to dynamic RAM, it has applicability elsewhere. It can be used to test SRAM, or to test for the occurrence of non-volatile RAM in selected parts of the physical address map. Non-volatile memory can be tested both to see whether it exists, and whether it is correct using a CRC or other known checking technique. A system and method for testing a computer system memory which can check the entire system memory has been described. Such a system and method minimizes the delay caused by testing before the computer system can be used. Such a system and method is useable with a computer system with any amount of main system memory. In accordance with the present invention, a system and method for testing a computer system main memory during system startup has been described. An initial block of memory is tested and marked as valid or invalid during a startup sequence, with the remaining system memory initially marked as bad. An operating system and applications can be loaded into the initial block and operate normally, and a concurrent process is invoked to test the remaining system memory. This allows the remaining system memory to be tested and marked as valid during normal system operation.

Claims: A method of operating a computer system in which testing of memory locations of a memory of said computer system is required, the method comprising the steps of: first testing an initial portion of the memory; then loading an operating system into said initial portion of the memory and beginning execution thereof; characterised by then testing a further portion of the memory during execution of said operating system. A method as claimed in claim 1 wherein the testing of a further portion of the memory is initiated by said operating system. A method as claimed in any of claims 1 or 2 further comprising the steps of: marking all memory locations as bad in a bitmap before testing said initial portion of the memory; marking those memory locations as good in said bitmap which pass initial portion testing; and marking those memory locations as good in said bitmap as they pass further portion testing. A method as claimed in claim 3 wherein each bit in said bitmap corresponds to a block of memory having a predetermined size. A computer system comprising: a memory; means for testing an initial portion of said memory; means for loading an operating system into said initial portion of said memory; means for executing said operating system; and characterised by means for testing a further portion of said memory during execution of said operating system. A computer system as claimed in claim 5 further comprising: a bitmap for indicating good memory locations, said bitmap being updated by initial portion and future portion testing means.

Inventors: CHENG CHINGSHUN, PORTER SCOTT LYON, RICHARDSON WILLIAM CAIN, ROY PAUL JULIUS, CHENG, CHINGSHUN, PORTER, SCOTT LYON, RICHARDSON, WILLIAM CAIN, ROY, PAUL JULIUS
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1991
Main classification: G11C29
IPC codes: G06F1, G06F12, G06F11, G11C29